sersync+rsync实现数据同步
实验拓扑 (1)配置rsync配置文件 编辑配置文件vim /etc/rsyncd.conf,默认是没有这个配置文件的,然后添加如下内容: Rsyncservergid =rsync #设置运行权限为rsync用户 (1)配置交换式密码,具体操作如下 [[email?protected]]# vim /etc/rsync.password #设置交换式密码br/>hjm [[email?protected]]# (2)测试Sersync服务端,测试sersync是否可以进行pull或push操作,首先,我们先在Resync服务端的backup目录下新建几个文件夹,然后在sersync端看是否可以进行push或pull,如果可以的话,才能进sersync+resync的实战,具体操作如下: a) Resync服务端 [[email?protected]~]# cd /backup/ #进入目录 [[email?protected]]# touch {1..4}.txt [[email?protected]]# ls 1.txt 2.txt 3.txt 4.txtbr/>[[email?protected]]# b) Sersync服务端 [[email?protected]]# rsync -azv [email?protected]::backup/hjm/ --password-file=/etc/rsync.password receivingincremental file list ./ 1.txt 2.txt 3.txt 4.txt sent 143bytes received 294 bytes 874.00 bytes/sec totalsize is 0 speedup is 0.00 [[email?protected]]# ls 1.txt 2.txt 3.txt 4.txt 5.txt hahhabr/>[[email?protected]]# (3)安装sersync软件 Sersync软件包,在网上都能下载的到,我们这里事先已经下载好sersync软件包,然后对其进行解压,并把它们移动合适的位置。具体操作 如下: [[email?protected]]# tar xvf sersync_64bit_binary_stable_final.tar.gz -C /usr/local/ GNU-Linux-x86/sersync2 [[email?protected]]# ll /usr/local/GNU-Linux-x86/ -rwxr-xr-x.1 root root 2214 10月 26 2011 confxml.xmlbr/>[[email?protected]]# (4)编辑sersync配置文件 编辑配置文件,vim /usr/local/GNU-Linux-x86/confxml.xml ,然后修改如下几个地方: (5)启动sersync服务 set thesystem param execute:echo 50000000 >/proc/sys/fs/inotify/max_user_watches parse thecommand param daemonthread num: 10 host ip :localhost host port: 8008 daemonstart,sersyncrun behind the console user is rsync_backup configxml parse success pleaseaccording your cpu ,use-n param to adjust the cpu rate rsync thedirectory recursivly to the remote servers once -file=/etc/rsync.password>/dev/null 2>&1 run the sersync: [[email?protected]]# (1)Rsync服务端配置 [[email?protected]]# lsbr/>[[email?protected]]# [[email?protected]]# lsbr/>[[email?protected]]# QQ在线Zabbix答疑群177428068 上一篇:为什么Nginx总体性能要比Apache高? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |