centos安装sersync

服务端安装

yum install -y rsync

#创建同步文件的目录
mkdir rsync

#认证密码文件
vim /etc/rsync.passwd
123456

chmod 600 /etc/rsync.passwd

连接测试rsync是否成功
rsync  -avzP /rsync/ liuyang@192.168.1.171::sersync/ --password-file=/etc/rsync.passwd

wget --no-check-certificate https://raw.githubusercontent.com/orangle/sersync/master/release/sersync2.5.4_64bit_binary_stable_final.tar.gz
tar zxvf sersync2.5.4_64bit_binary_stable_final.tar.gz
mv GNU-Linux-x86 /opt/sersync

cd /opt/sersync
mkdir conf bin logs
mv confxml.xml conf
mv sersync2 bin/sersync

编辑配置文件

vim /opt/sersync/conf/confxml.xml
<localpath watch="/rsync">
            <remote ip="192.168.1.171" name="sersync"/>
        </localpath>
        <rsync>
            <commonParams params="-aruz"/>
            <auth start="true" users="liuyang" passwordfile="/etc/rsync.passwd"/>
            <userDefinedPort start="false" port="874"/><!-- port=874 -->
            <timeout start="true" time="100"/><!-- timeout=100 -->
            <ssh start="false"/>
        </rsync>
        <failLog path="/opt/sersync/logs/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once-->

启动sersync

/opt/sersync/bin/sersync -r -d -o /opt/sersync/conf/confxml.xml

客户端安装

yum install -y rsync

创建同步文件的目录
mkdir rsync

编辑rsync配置文件

vim /etc/rsyncd.conf
uid = root
gid = root
use chroot = no
max connections = 2000
timeout = 600
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
ignore errors
read only = false
list = false
hosts allow = 192.168.1.0/24
hosts deny = 0.0.0.0/32
auth users = liuyang
secrets file = /etc/rsync.passwd

[sersync]
path = /rsync/

认证密码文件

vim /etc/rsync.passwd
liuyang:123456

chmod 600 /etc/rsync.passwd

/usr/bin/rsync --daemon
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值