rsync + sersync 实现实时数据同步
一、环境: 主机1:youzhuan-bak? ? ?centos 7.2? 主机2:youzhuan-online? ?centos 7.2? 二、部署过程: youzhuan-bak : [[email?protected] ~]#? yum install? ?rsync -y? [[email?protected] ~]#?rsync --daemon [[email?protected] ~]#?netstat -an | grep 873 [[email?protected] ~]# cat /etc/rsyncd.conf? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rsync配置文件修改 [[email?protected] ~]# cat /etc/rsyncd.pwd? ? ? ? 增加秘钥文件 [[email?protected] ~]# chmod 600?/etc/rsyncd.pwd? ? ? ? ?权限必须为 600 [[email?protected] ~]# ll /etc/rsyncd.pwd ? youzhuan-online : 配置? sersync? 下载安装包:??sersync2.5.4_64bit_binary_stable_final.tar.gz [[email?protected] local]# tar -xf sersync2.5.4_64bit_binary_stable_final.tar.gz? [[email?protected] localt]# mv GNU-Linux-x86/? ?sersync [[email?protected] local]# cd sersync [[email?protected] sersync]# cp confxml.xml confxml.xml.bak [[email?protected] sersync]# vim confxml.xml ? ? [[email?protected] sersync]# cat /etc/liang.passwd? [[email?protected] sersync]# chmod 600? /etc/liang.passwd? [[email?protected] sersync]# ll /etc/liang.passwd? ? [[email?protected] sersync]#? /usr/local/sersync/sersync2 -d -r -o /usr/local/sersync/confxml.xml 测试 : [[email?protected] sersync]# cd /data/www/ [[email?protected] www]# mkdir 999 在 youzhuan-bak上验证: 删除后也会实时同步,验证成功。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |