linux下实现web数据同步的四种方式(性能比较)

2019-10-14 21:56:16于海丽

hosts deny = *                  #设置禁止连接rsync服务器的主机地址,*表示  拒绝所有除了hosts allow定义的
uid = root
gid = root
auth users = backuper            #连接模块的用户名
secrets file = /etc/rsyncd.pwd   #连接模块用户名的密码文件存放路径
#####################################################################
[root@jie1 ~]#vim  /etc/rsyncd.pwd  #用户的密码文件
#####################################################################
backuper:pwd123        #用户名:密码
#####################################################################
[root@jie1 ~]# chmod 600  /etc/rsyncd.pwd   #权限给600
[root@jie1 ~]# chkconfig rsync on
[root@jie1 ~]# chkconfig xinetd on
[root@jie1 ~]# service  xinetd start
Starting xinetd:                                           [  OK  ]
[root@jie1 ~]# netstat -pant | grep 873
tcp        0      0 :::873                      :::*                        LISTEN      19876/xinetd

rsync+inotify+web客户端的配置:

1)、inotify-tools软件的安装及设置


[root@jie3 ~]#wget http://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz             #下载inotify-tools软件
[root@jie3 ~]# ls
anaconda-ks.cfg            install.log    
inotify-tools-3.14.tar.gz  install.log.syslog
[root@jie3 ~]# tar xf inotify-tools-3.14.tar.gz          #解压软件
[root@jie3 ~]# cd inotify-tools-3.14
[root@jie3 inotify-tools-3.14]# ./configure --prefix=/usr/local/inotify && make && make install                 #编译安装软件
[root@jie3 ~]#cd /usr/local/inotify/
[root@jie3 inotify]# echo "PATH=/usr/local/inotify/bin:$PATH" >>/etc/profile.d/inotify.sh             #设置能与系统关联的path路径
[root@jie3 inotify]# source /etc/profile.d/inotify.sh
[root@jie3 inotify]# echo "/usr/local/inotify/lib" >/etc/ld.so.conf.d/inotify.conf         #设置系统能识别软件的库文件