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. slf4j提示Class path contains multiple SLF4J bindings

    报错: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding .jar!/org/slf4j/impl/St ...

  2. 使用 Linux 搭建 VPN

    http://blog.csdn.net/catoop/article/details/7537012 VPN服务器的配置与应用 实验场景 通过将Linux配置VPN服务器允许远程计算机能够访问内网. ...

  3. Delphi 中的结构体与结构体指针

    好多程序都给结构体变量设定了一个结构体指针 例如: PAbc = ^TAbc; TAbc = record a: string[10]; b: string[5]; c: string[1]; end ...

  4. Java 获取类名,函数名,行数

    C++下用宏来实现.分别是__FILE__,__func__,__LINE__分别代表,C++编译自动在每个文件中设定__FILE__类型是字符串常量 ,将__LINE__替换为当前行数,类型是数字常 ...

  5. python 之 utf-8编码的秘密

    python3的默认编码方案是utf-8编码,看了些资料,来做总结. 要说utf-8,就要说说unicode,要说unicode,就要说ASCII,我们还是慢慢来. 1.ASCII ASCII编码最初 ...

  6. 将数据导入hive,将数据从hive导出

    一:将数据导入hive(六种方式) 1.从本地导入 load data local inpath 'file_path' into table tbname; 用于一般的场景. 2.从hdfs上导入数 ...

  7. GetLogicalProcessorInformation(XP3才支持)和GetLogicalProcessorInformationEx(WIN7才支持)

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms683194(v=vs.85).aspx 例子执行结果如下: https://ms ...

  8. 【Android开发学习笔记】【第四课】基础控件的学习

    通过一个简单的例子来学习下面几种控件: 1.TextView:简单的文本显示控件 2.EditText:可以编辑的文本框 3.Button:按钮 4.Menu:这里指的是系统的Menu 5.Toast ...

  9. JS实现一个简单的计算器

    使用JS完成一个简单的计算器功能.实现2个输入框中输入整数后,点击第三个输入框能给出2个整数的加减乘除.效果如上: 第一步: 创建构建运算函数count(). 第二步: 获取两个输入框中的值和获取选择 ...

  10. NAT原理与NAT穿越

    最近在看东西的时候发现很多网络程序中都需要NAT穿越,特意在此总结一下. 先做一个约定: 内网A中有:A1(192.168.0.8).A2(192.168.0.9)两用户 网关X1(一个NAT设备)有 ...