sersync服务

1. 在网站的分发机器上安装sersync和rsync(rsync已经作为了svn服务器对应的服务端了)
tar -zxf sersync2.5.4_64bit_binary_stable_final.tar.gz    
mkdir /usr/local/sersync/{etc,bin} -p

cp GNU-Linux-x86/sersync2 /usr/local/sersync/bin/
cp GNU-Linux-x86/confxml.xml /usr/local/sersync/etc/

#新建一个rsync密码文件
echo "1qaz2wsx" >> /usr/local/rsync/etc/zgxcw_im_server.pass
chown -R root /usr/local/rsync/etc/zgxcw_im_server.pass
chmod 600  /usr/local/rsync/etc/ zgxcw_im_server.pass

2. 在所有客户端服务器安装rsync服务端
tar -zxf rsync-3.1.0.tar.gz && cd rsync-3.1.0
./configure --prefix=/usr/local/rsync && make && make install
cd /usr/local/rsync && mkdir etc

vim /usr/local/rsync/etc/rsyncd.conf                                     
-----------------------------------------------------------------
uid=root
gid=root
max connections=36000
use chroot=no
log file=/usr/local/rsync/rsyncd.log
pid file=/usr/local/rsync/rsyncd.pid
lock file=/usr/local/rsync/rsyncd.lock

[zgxcw_im_server]                                         
path=/data/web/zgxcw_im_server                                   
comment = www.meizi.com rsync web                     
ignore errors = yes  
read only = no
hosts allow = 192.168.30.24                         
hosts deny = *
auth users = zgxcw                             
secrets file = /usr/local/rsync/etc/ zgxcw_im_server.pass        
-----------------------------------------------------------------
echo "1qaz2wsx" >> /usr/local/rsync/etc/zgxcw_im_server.pass    
chown -R root /usr/local/rsync/etc/zgxcw_im_server.pass
chmod 600   /usr/local/rsync/etc/ zgxcw_im_server.pass
mkdir /data/web/zgxcw_im_server -p
/usr/local/rsync/bin/rsync --daemon --config=/usr/local/rsync/etc/rsyncd.conf

3. 配置sersync服务
cp /usr/local/sersync/etc/confxml.xml /usr/local/sersync/etc/zgxcw_im_server.xml
vim /usr/local/sersync/etc/zgxcw_im_server.xml  

#修改如下红色部分,其余保持默认即可
-------------------------------------------------------------

        #监视的本地目录

            

             #客户端地址和项目名称

              

           

       

       

           

            #开启认证和指定密码文件位置

              

           

           

           

       

        #指定日志的位置和名称

        

       

           

               

               

           

       

       

   


-------------------------------------------------------------
测试rsync是否能正常工作: 
/usr/local/rsync/bin/rsync -avzP --password-file=/usr/local/rsync/etc/zgxcw_im_server.pass /data/web/zgxcw_im_server  [email protected]::zgxcw_im_server

启动sersync服务:
/usr/local/sersync/bin/sersync2 -r -d -o /usr/local/sersync/zgxcw_im_server.xml

你可能感兴趣的:(服务器)