rsync+sersync实时同步
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实时同步的更多相关文章
- Rsync + sersync 实时同步备份
一 Rsync + Sersync 实时同步介绍 1.Rsync 服务搭建介绍 云机上搭建Rsync server,在本地搭建Rsync Clinet. 2. Sersync 服务搭建介绍 ...
- Rsync+Sersync实时同步数据目录
第1章 Rsync简介 1.1 Rsync基本概述 rsync是一款开源的备份工具,可以在不同主机之间进行同步,可实现全量备份与增量备份 全量:将全部数据,进行传输覆盖 增量:只传输差异部分的数据 1 ...
- rsync & sersync 实时同步
1.根据之前一篇关于rsync的随笔部署好rsync服务后,可以开始inotify的部署 2.sersync的部署 ①.部署服务(安装和配置过程) #Master 部署Sersync服务 mkdir ...
- sersync 实时同步工具
出处:http://code.google.com/p/sersync/ 当前版本的sersync依赖于rsync进行同步.如下图所示,在同步主服务器上开启sersync,将监控路径中的文件同步到目标 ...
- Sersync实时同步企业应用配置实战
一.实验环境 CentOS版本: 6.6(2.6.32.-504.el6.x86_64) Rsync版本: Rsync-3.0.6(系统自带) Sersync版本:sersync2.5.4_64bi ...
- 【转】inotify+rsync实现实时同步
[转]inotify+rsync实现实时同步 1.1 什么是实时同步:如何实现实时同步 要利用监控服务(inotify),监控同步数据服务器目录中信息的变化 发现目录中数据产生变化,就利用rsync服 ...
- sersync 实时同步
1.什么是实时同步 监控一个目录的变化, 当该目录触发事件(创建\删除\修改) 就执行动作, 这个动作可以是 rsync同步 ,也可以是其他. 2.为什么要实时同步 1.能解决nfs单点故障问题. ...
- 5. Sersync实时同步
rsync+Sersync数据的实时同步 sersync介绍 1.什么是实时同步 监控一个目录的变化, 当该目录触发事件(创建\删除\修改) 就执行动作, 这个动作可以是 rsync同步 ,也可以是其 ...
- rsync nfs 实时同步,结合实战
目录 rsync nfs 实时同步,实战 一.部署rsync服务端(backup) 二.部署rsync客户端(nfs,web01) 三.部署web代码(web01) 四.NFS服务端部署(nfs) 五 ...
随机推荐
- GDC2016【彩虹六号:围攻 】使丰富的“突破”成为可能的破坏系统
[彩虹六号:围攻 ]使得丰富的“突破”成为可能的破坏系统 深奥的战术游戏的背景下,最新的程序化破坏技术[REALBLAST]! 进行演讲的是Ubisoft Montreal的Julien ...
- jdk Tomcat配置
安装Tomcat需要先安装JDKJDK安装JDK安装会有两次,两次不能再同一目录 你可以新建两个文件夹 JDK JRE 第一次安装在JDK 第二次在JRE在我的电脑右键属性 高级系统设置 环境变量 系 ...
- Android中Intent组件详解
Intent是不同组件之间相互通讯的纽带,封装了不同组件之间通讯的条件.Intent本身是定义为一个类别(Class),一个Intent对象表达一个目的(Goal)或期望(Expectation),叙 ...
- url匹配和match()方法
下面的全局匹配可以找到字符串中的所有数字: "1 plus 2 equals 3".match(/\d+/g) // 返回 ["1", "2" ...
- nrf51822裸机教程-PWM
先简单介绍一下PWM的原理. 原理很简单. 假设COUNTER是个从0开始递增的计数器. 我们设置两个值 counter0 和counter1 在 COUNTER 计数到counter0的值时候翻转 ...
- Oozie协作框架
一:概述 1.大数据协作框架 2.Hadoop的任务调度 3.Oozie的三大功能 Oozie Workflow jobs Oozie Coordinator jobs Oozie Bundle 4. ...
- 在express项目中有效组织和使用mongoose
平凡之路 1.创建express项目 express mongooseExpress 2.最简express var express = require("express"); v ...
- [LeetCode]题解(python):104 Maximum Depth of Binary Tree
题目来源 https://leetcode.com/problems/maximum-depth-of-binary-tree/ Given a binary tree, find its maxim ...
- 【C++】C++求vector中的最大最小值
利用algorithm库里的max_element和min_element可以得到vector的最大最小值,配合distance函数可以得到最大值的位置 #include<vector> ...
- (leetcode) countandsay
class Solution { public: string calcuate(string s) { string result; char pre = s[0]; int cnt = 1; fo ...