案例:
某电子商务企业有一个门户网站,Web服务器的操作系统是Linux,网站数据每天都会增加。为保证数据安全,需要建立一个远程容灾系统,将网站数据在每天凌晨3点30分备份到远程的容灾服务器上。由于数据量很大,每天只能进行增量备份,即仅仅备份当天增加的数据,当网站出现故障后,可以通过备份最大程度地恢复数据
rsync服务端配置:/etc/rsyncd.conf(需手动创建):
#全局配置
uid = nobody
gid = nobodyuse
chroot = no
max connections = 10
strict modes = yes
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log
#模块配置
[webdata]
path = /webdata
comment = webdata file
ignore errors
read only = no
write only = no
hosts allow = *
hosts deny = 192.168.12.131
list = false
uid = root
gid = root
auth users = test
secrets file = /etc/server.pass
/etc/server.pass文件内容为认证帐号密码信息
vim /etc/server.pass
test:testpass
启动守护进程:
rsync --daemon
ss -antp | grep rsync
rsync客户端:
/etc/test.pass内容为test用户密码
testpass