• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • bios
  • 系统安装
  • 系统进程
  • Windows
  • LINUX
  • RedHat/Centos
  • Ubuntu/Debian
  • Fedora
  • Solaris
  • 麒麟系统
  • 红旗Linux
  • 苹果MAC
  • 注册表
  • 其它系统
您的位置:首页 > 操作系统 >Ubuntu/Debian > Ubuntu Server Rsync服务端与Windows cwRsync客户端实现数据同步配置教程

Ubuntu Server Rsync服务端与Windows cwRsync客户端实现数据同步配置教程

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-05-12

佚名 通过本文向大家介绍了Ubuntu Server Rsync服务端与Windows cwRsync客户端实现数据同步配置教程等相关知识,希望对您有所帮助,也希望大家多多支持linkedu.com

说明:
1、Rsync服务端
系统:Ubuntu Server 11.10
IP地址:192.168.21.168
数据存放目录:/home/mysql_data
2、cwRsync客户端
系统:Windows Server 2003
IP地址:192.168.21.130
同步的目录:D:\mysql_data
实现目的:
cwRsync客户端每天凌晨3:00钟自动同步Rsync服务端/home/mysql_data目录中的数据到D:\mysql_data目录
一、Rsync服务端配置

1、开启防火墙tcp 873端口(Rsync默认端口)

说明:Ubuntu默认安装是没有开启任何防火墙的,为了服务器的安全,建议大家安装启用防火墙设置,这里推荐使用iptables防火墙。

whereis iptables #查看系统是否安装防火墙

iptables: /sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz #表示已经安装iptables防火墙

apt-get install iptables #如果默认没有安装,请运行此命令安装防火墙

iptables -L #查看防火墙配置信息,显示如下:

Chain INPUT (policy ACCEPT)

target prot opt source destination

Chain FORWARD (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

nano /etc/iptables.default.rules #设置防火墙规则,添加以下内容
##################################################################################################
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
# You could modify this to only allow certain traffic
-A OUTPUT -j ACCEPT
# Allows HTTP and MySQLconnections from anywhere (the normal ports for websites)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp --dport 873 -j ACCEPT
# Allows SSH connections for script kiddies
# THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
# Now you should read up on iptables rules and consider whether ssh access
# for everyone is really desired. Most likely you will only allow access from certain IPs.
# Allow ping
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
# log iptables denied calls (access via 'dmesg' command)
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
# Reject all other inbound - default deny unless explicitly allowed policy:
-A INPUT -j REJECT
-A FORWARD -j REJECT
COMMIT
##################################################################################################

ctrl+o #保存

ctrl+x #退出

备注:873是Rsync端口

iptables-restore < /etc/iptables.default.rules #使防火墙规则生效

nano /etc/network/if-pre-up.d/iptables #创建文件,添加以下内容,使防火墙开机启动

##########################################################

#!/bin/bash
/sbin/iptables-restore </etc/iptables.default.rules

##########################################################

chmod +x /etc/network/if-pre-up.d/iptables #添加执行权限

2、安装Rsync服务端软件
whereis rsync #查看系统是否已安装rsync,出现下面的提示,说明已经安装
rsync: /usr/bin/rsync /usr/share/man/man1/rsync.1.gz

apt-get install rsync #如果没有安装,请执行这行命令来安装rsync

nano /etc/default/rsync #编辑配置文件

RSYNC_ENABLE=true #把false改为true,设置开机启动rsync
ctrl+o #保存
ctrl+x #退出

3、创建rsyncd.conf配置文件

nano /etc/rsyncd.conf #创建配置文件,添加以下代码
log file = /var/log/rsyncd.log #日志文件位置,启动rsync后自动产生这个文件,无需提前创建。
[MySQL_Backup] #自定义名称
path = /home/mysql_data #Rsync服务端数据目录路径
comment = MySQL_Backup #模块名称与[MySQL_Backup]自定义名称相同
uid = root #设置rsync运行权限为root
gid = root #设置rsync运行权限为root
port=873 #默认端口
read only = no #设置为no,cwRsync客户端可上传文件,yes只读
write only = no #设置为no,cwRsync客户端可下载文件,yes不能下载
auth users = mysqlbakuser #执行数据同步的用户名,可以设置多个,用英文状态下逗号隔开
secrets file = /etc/rsync.pass #用户认证配置文件,里面保存用户名称和密码,后面会创建这个文件
hosts allow = 192.168.21.130 #允许进行数据同步的客户端IP地址,可以设置多个,用英文状态下逗号隔开
hosts deny = 192.168.21.254 #禁止数据同步的客户端IP地址,可以设置多个,用英文状态下逗号隔开
list = yes #显示Rsync服务端资源列表

ctrl+o #保存

ctrl+x #退出

4、创建用户认证文件
nano /etc/rsync.pass #配置文件,添加以下内容
mysqlbakuser:123456 #格式,用户名:密码,可以设置多个,每行一个用户名:密码

ctrl+o #保存
ctrl+x #退出

5、设置文件权限
chmod 600 /etc/rsyncd.conf #设置文件所有者读取、写入权限
chmod 600 /etc/rsync.pass #设置文件所有者读取、写入权限

6、启动rsync
/etc/init.d/rsync start #启动
service rsync stop #停止
service rsync restart #重新启动
二、cwRsync客户端设置

1、下载cwRsync客户端软件

下载地址:http://jaist.dl.sourceforge.net/project/sereds/cwRsync/4.0.3/cwRsync_4.0.3_Installer.zip

2、安装cwRsync客户端

解压cwRsync_4.0.3_Installer.zip 双击打开cwRsync_4.0.3_Installer.exe


Next 下一步


IAgree 同意安装


Next

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

相关文章

  • 2017-05-12Ubuntu14.04不支持U盘exfat格式该如何解决
  • 2017-05-12在Ubuntu系统下安装音乐播放器的教程
  • 2017-05-12Ubuntu/Mint添加不了PPA源的原因及修复方法
  • 2017-05-12Ubuntu使用音乐播放器Steam Music的方法
  • 2017-05-12Ubuntu 13.10安装最新Linux内核的可行方法
  • 2017-05-12Ubuntu14.04更新软件导致登录死循环但是可以进入tty模式的快速解决方法
  • 2017-05-12打造轻巧的 Linux 服务器的步骤
  • 2017-05-12Ubuntu 9.10安装开启3D桌面特效[多图]
  • 2017-05-12Linux系统中使用Grub启动器启动ISO镜像的方法
  • 2017-05-12ubuntu系统忘记root密码?

文章分类

  • bios
  • 系统安装
  • 系统进程
  • Windows
  • LINUX
  • RedHat/Centos
  • Ubuntu/Debian
  • Fedora
  • Solaris
  • 麒麟系统
  • 红旗Linux
  • 苹果MAC
  • 注册表
  • 其它系统

最近更新的内容

    • 解决Ubuntu系统下Wireshark无响应的方法
    • Ubuntu10.10 Zend FrameWork配置方法及helloworld显示
    • SSH无法连上虚拟机中Ubuntu Linux的解决方法
    • ubuntu虚拟机怎么使用VirtualBox软件增强功能安装?
    • ubuntu14.04如何安装Realsense驱动?
    • Ubuntu17.04开放下载:支持AMD Ryzen和Intel Kaby Lake处理器
    • Ubuntu14.04下ssh安装,基本操作及无密码登陆分享
    • Ubuntu 17.04更新了哪些内容?Ubuntu 17.04更新内容一览
    • Ubuntu上使用Fcitx安装中文输入法的简单方法
    • Ubuntu虚拟机里怎么编译内核?

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有