A: 运行rsync daemon
B: 运行sersync ,会监控目录,发现改变会更新推送到A上

rsync见上面rsync设置

sersync安装配置
1.建立目录
mkdir -p /opt/sersync/{bin,conf,log}
2. 下载解压sersync
wget http://sersync.googlecode.com/files/sersync2.5_64bit_binary_stable_final.tar.gz
tar xvf sersync2.5_64bit_binary_stable_final.tar.gz
3. 拷贝二进制文件和配置文件
cd GNU-Linux-x86
cp confxml.xml /opt/sersync/conf
cp sersync2 /opt/sersync/bin
4. 修改配置文件
confxml.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<head version="2.5">
<host hostip="localhost" port="8008"></host><!-- listen ip and port -->
<debug start="false"/> <!-- debug default off-->
<fileSystem xfs="false"/>
<filter start="false"> <!-- exclude filter,default off -->
<exclude expression="(.*)\.svn"></exclude>
<exclude expression="(.*)\.gz"></exclude>
<exclude expression="^info/*"></exclude>
<exclude expression="^static/*"></exclude>
</filter>
<inotify> <!--monitor event -->
<delete start="false"/>
<createFolder start="true"/>
<createFile start="false"/>
<closeWrite start="true"/>
<moveFrom start="true"/>
<moveTo start="true"/>
<attrib start="false"/>
<modify start="false"/>
</inotify>

<sersync>
<localpath watch="/tmp"> <!-- local file watch -->
<remote ip="192.168.1.111" name="test"/> <!-- remote ip and module name -->
<!--<remote ip="192.168.8.39" name="tongbu"/>-->
<!--<remote ip="192.168.8.40" name="tongbu"/>-->
</localpath>
<rsync>
<commonParams params="-avzP"/> <!-- rsync parmas -->
<auth start="true" users="linuxsir" passwordfile="/etc/rsync.pass"/> <!-- auth user and file -->
<userDefinedPort start="false" port="874"/><!-- port=874 --> <!-- use custom define port -->
<timeout start="false" time="100"/><!-- timeout=100 --> <!-- time out define,default off -->
<ssh start="false"/> <!--- use ssh crypt to transfer,default off -->
</rsync>
<failLog path="/opt/sersync/log/rsync_fail_log.sh" timeToExecute="60"/><!--default every 60mins execute once-->
<crontab start="false" schedule="600"><!--600mins--><!-- use crontab to transfer,default off -->
<crontabfilter start="false">
<exclude expression="*.php"></exclude>
<exclude expression="info/*"></exclude>
</crontabfilter>
</crontab>
<plugin start="false" name="command"/> <!-- after finish rsync tast to execute the plugin after define -->
</sersync>
<!-- plugin examples -->
<plugin name="command">
<param prefix="/bin/sh" suffix="" ignoreError="true"/> <!--prefix /opt/tongbu/mmm.sh suffix-->
<filter start="false">
<include expression="(.*)\.php"/>
<include expression="(.*)\.sh"/>
</filter>
</plugin>
<plugin name="socket">
<localpath watch="/opt/tongbu">
<deshost ip="192.168.138.20" port="8009"/>
</localpath>
</plugin>
<plugin name="refreshCDN">
<localpath watch="/data0/htdocs/cms.xoyo.com/site/">
<cdninfo domainname="ccms.chinacache.com" port="80" username="xxxx" passwd="xxxx"/>
<sendurl base="http://pic.xoyo.com/cms"/>
<regexurl regex="false" match="cms.xoyo.com/site([/a-zA-Z0-9]*).xoyo.com/images"/>
</localpath>
</plugin>
</head>

5. 运行
sersync2 -r -d -o /opt/sersync/conf/confxml.xml
option: -r rsync all the local files to the remote servers before the sersync work
option: -d run as a daemon
option: -o config xml name: /opt/sersync/conf/confxml.xml
6. 测试
/tmp建立文件,测试能否传上去

rsync+sersync实时同步的更多相关文章

  1. Rsync + sersync 实时同步备份

    一      Rsync + Sersync  实时同步介绍 1.Rsync 服务搭建介绍 云机上搭建Rsync server,在本地搭建Rsync Clinet. 2. Sersync 服务搭建介绍 ...

  2. Rsync+Sersync实时同步数据目录

    第1章 Rsync简介 1.1 Rsync基本概述 rsync是一款开源的备份工具,可以在不同主机之间进行同步,可实现全量备份与增量备份 全量:将全部数据,进行传输覆盖 增量:只传输差异部分的数据 1 ...

  3. rsync & sersync 实时同步

    1.根据之前一篇关于rsync的随笔部署好rsync服务后,可以开始inotify的部署 2.sersync的部署 ①.部署服务(安装和配置过程) #Master 部署Sersync服务 mkdir ...

  4. sersync 实时同步工具

    出处:http://code.google.com/p/sersync/ 当前版本的sersync依赖于rsync进行同步.如下图所示,在同步主服务器上开启sersync,将监控路径中的文件同步到目标 ...

  5. Sersync实时同步企业应用配置实战

    一.实验环境 CentOS版本: 6.6(2.6.32.-504.el6.x86_64) Rsync版本:  Rsync-3.0.6(系统自带) Sersync版本:sersync2.5.4_64bi ...

  6. 【转】inotify+rsync实现实时同步

    [转]inotify+rsync实现实时同步 1.1 什么是实时同步:如何实现实时同步 要利用监控服务(inotify),监控同步数据服务器目录中信息的变化 发现目录中数据产生变化,就利用rsync服 ...

  7. sersync 实时同步

    1.什么是实时同步 ​ 监控一个目录的变化, 当该目录触发事件(创建\删除\修改) 就执行动作, 这个动作可以是 rsync同步 ,也可以是其他. 2.为什么要实时同步 1.能解决nfs单点故障问题. ...

  8. 5. Sersync实时同步

    rsync+Sersync数据的实时同步 sersync介绍 1.什么是实时同步 监控一个目录的变化, 当该目录触发事件(创建\删除\修改) 就执行动作, 这个动作可以是 rsync同步 ,也可以是其 ...

  9. rsync nfs 实时同步,结合实战

    目录 rsync nfs 实时同步,实战 一.部署rsync服务端(backup) 二.部署rsync客户端(nfs,web01) 三.部署web代码(web01) 四.NFS服务端部署(nfs) 五 ...

随机推荐

  1. maven Ubuntu14.04 安装

    参考:linux上安装使用maven 下载链接:官网Download 解压. 在root用户下执行: cd /opt mkdir maven chmod 755 /opt/maven tar -zvx ...

  2. 20145235李涛《Java程序设计》第一周学习总结

    教材学习内容总结 JAVA三大平台:Java SE(针对企业).Java EE(针对开发者) .Java ME(针对开发小型消费类电子产品) 其他 Java SE四个组成部分:JVM .JRE. JD ...

  3. JAVA NIO的理解

    在使用JAVA提供的Socket的IO方法时,服务端为了方便操作,会为每一个连接新建一个线程,一个线程处理一个客户端的数据交互.但是当大量客户端同服务端连接时,会创建大量的线程,线程之间的切换会严重影 ...

  4. endsWith和startsWith同样效果其他形式的写法(2016.1.12)

    //判断以什么开始startWith str = "abcdef"; //用其他的形式写的startsWith if(str.indexOf("abc")==0 ...

  5. javaWeb中struts开发——Bean标签

    1.struts标签库中常用标签 使用myeclise标签可以自动注入,其中,前三个是经常使用的,主要的是logic标签 2.Bean标签 Bean标签主要用来定义和访问JavaBean,在Strut ...

  6. Strong AI Versus Weak AI

    Computer Science An Overview _J. Glenn Brookshear _11th Edition The conjecture that machines can be ...

  7. Running Kafka At Scale

    https://engineering.linkedin.com/kafka/running-kafka-scale If data is the lifeblood of high technolo ...

  8. ServletDemo

    1. Servlet 接口 继承 Servlet 接口,实现Servlet 接口的 所有抽象方法! 实现类代码 package xw.servlet; import java.io.IOExcepti ...

  9. 删除本地git版本库中受版本控制的文件

     git乱码解决方案汇总 乱码原因 搜索一番,发现git文件名.log乱码,是普遍问题,这其中有编码的原因,也有跨平台的原因.主要原因是Windows 系统中的Git对中文文件名采用不同的编码保存所致 ...

  10. vs2013 RTM 激活码

    BWG7X-J98B3-W34RT-33B3R-JVYW9