rsync sersync2 文件实时双向同步
来源:互联网 发布:襄阳蓝芯软件 编辑:程序博客网 时间:2024/05/16 19:14
操作系统:centos7 64 mini安装 如何安装
server1:192.168.56.102
server1:192.168.56.103
下面以在192.168.56.102 安装为例(红色部分为需要修改的地方,具体IP在192.168.56.103对调就可以)
#安装rsync
yum -y install rsync
#设置本机用户名与密码
vi /etc/rsync.pas
peter:111111
#设置远程服务的密码
vi /etc/rsync_server.pas
111111
chmod 600 /etc/rsync.pas
chmod 600 /etc/rsync_server.pas
vi /etc/rsyncd.conf
uid=root
gid=root
max connections=36000
use chroot=no
log file=/var/log/rsyncd.log
lock file=/var/run/rsyncd.lock
[tongbu]
path=/opt/tongbu
comment = server1
ignore errors = yes
read only = no
auth users=peter
secrets file=/etc/rsync.pas
hosts allow = 192.168.56.103
hosts deny = *
#独立启动
rsync --daemon
#配置开机启动,配置xinetd
vi /etc/xinetd.d/rsync
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
#reboot
netstat -tnlp | grep 873
grep 'rsync' /etc/services #可以看到873端口
#安装sersync2
tar -zxvf sersync2.5.4_64bit_binary_stable_final.tar.gz
cd GNU-Linux-x86
vi confxml.xml
<sersync>
<localpath watch="/opt/tongbu">
<remote ip="192.168.56.103" name="tongbu"/>
<!--<remote ip="192.168.8.39" name="tongbu"/>-->
<!--<remote ip="192.168.8.40" name="tongbu"/>-->
</localpath>
<rsync>
<commonParams params="-artuz"/>
<auth start="true" users="peter" passwordfile="/etc/rsync_server.pas"/>
<userDefinedPort start="false" port="874"/><!-- port=874 -->
<timeout start="false" time="100"/><!-- timeout=100 -->
<ssh start="false"/>
</rsync>
<failLog path="/tmp/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once-->
<crontab start="false" schedule="600"><!--600mins-->
<crontabfilter start="false">
<exclude expression="*.php"></exclude>
<exclude expression="info/*"></exclude>
</crontabfilter>
</crontab>
<plugin start="false" name="command"/>
</sersync>
#独立启动
/home/GNU-Linux-x86/sersync2 -d -r -o /home/GNU-Linux-x86/confxml.xml
#配置开机启动,修改rc.local
vi /etc/rc.d/rc.local
#增加
/home/GNU-Linux-x86/sersync2 -d -r -o /home/GNU-Linux-x86/confxml.xml
0 0
- rsync sersync2 文件实时双向同步
- sersync2+Rsync 同步文件
- sersync2+rsync文件同步测试
- sersync2实时同步
- 双向实时远程同步文件(inotify+rsync与nfs)
- ubuntu 14.04 配置 rsync + inotify 文件双向实时同步
- rsync+inotify实现文件服务器实时双向同步
- 真正的inotify+rsync实时双向同步
- rsync+inotify文件实时同步
- Rsync+inotify文件实时同步
- rsync+inotify文件实时同步
- sersync2.5+rsync实现数据同步
- rsync+sersync2多个web网站同步
- Linux下Rsync+sersync实现数据双向实时同步
- inotify + rsync实现linux文件实时同步
- inotify + rsync 实现 linux 文件实时同步
- Linux下Inotify + Rsync文件实时同步
- rsync+inotify搭建实时同步文件
- Android第三方跳转可能会出现事件传入下一个应用中
- Node.js的mysql数据库操作
- 对象池技术apache-common pool的使用
- Combination Sum II
- A计划(bfs)
- rsync sersync2 文件实时双向同步
- Maven学习(二)- 安装m2eclipse插件
- Android基于源码分析Handler的消息机制
- 深入理解Linux修改hostname
- 通过zabora监控oracle
- python eventlet模块
- js中的this指针的用法
- /dev/mapper/vg_test-lv_root 占用到达100%的解决方法
- 联合索引 一例