非常好用的sersync同步工具
作者:邓聪聪
常用同步工具sync的进阶软件
服务端的配置:
uid = rsync
gid = rsync
port =
use chroot = on
max connections =
timeout =
lock file = /var/run/rsyncd.lock
log file = /var/log/rsyncd.log
read only = false
list = false
fake super = yes
hosts allow = 172.16.16.0/
hosts deny = 0.0.0.0/
secrets file = /etc/rsyncd.password
auth users = rsync [backup]
path = /data

客户端在推送时,有这样一个报错,但不影响文件的传输:
[root@ data]# rsync -avzP a.txt backup@172.16.16.10::backup
Password:
sending incremental file list
a.txt
% .00kB/s :: (xfr#, to-chk=/)
rsync: chgrp "/.a.txt.llMDKO" (in backup) failed: Operation not permitted () ###无法操作 sent bytes received bytes 90.00 bytes/sec
total size is speedup is 0.04
rsync error: some files/attrs were not transferred (see previous errors) (code ) at main.c() [sender=3.1.]

解决后:
[root@ data]# rsync -avzP /root/data/b.txt rsync@172.16.16.10::backup
Password:
sending incremental file list
b.txt
% .00kB/s :: (xfr#, to-chk=/) sent bytes received bytes 56.40 bytes/sec
total size is speedup is 0.04
源同步服务器上,同步本端目录内容到目标服务器,用sersync:
将 sersync2.5.4_64bit_binary_stable_final.tar.gz 文件解压后(主要用sersync、inotify)
[root@ansible-server ~]# cd sersync/
[root@ansible-server sersync]# ll
total
drwxr-xr-x. root root Mar : GNU-Linux-x86
drwxrwxrwx. rsync rsync Mar inotify-tools-3.14
-rw-r--r--. root root Mar : inotify-tools-3.14.tar.gz
-rw-r--r--. root root Mar : README.md
drwxrwxr-x. root root Mar : rsync-3.1.
-rw-r--r--. root root Mar : rsync-3.1..tar.gz
为了方便管理调整目录结构:
[root@ansible-server sersync]# tree /usr/local/sersync/
/usr/local/sersync/
├── bin
│ └── sersync
├── conf
│ ├── conf-www.xml
│ ├── confxml.xml
│ └── confxml.xml-bak
└── log
├── rsync_fail_log
└── rsync_fail_log-www
mv GNU-Linux-x86/sersync /usr/local/sersync/bin/
mv GNU-Linux-x86/confxml.xml /usr/local/sersync/conf
[root@ansible-server sersync]# cat /usr/local/sersync/conf/confxml.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<head version="2.5">
<host hostip="localhost" port=""></host>
<debug start="false"/>
<fileSystem xfs="false"/>
<filter start="false">
<exclude expression="(.*)\.svn"></exclude>
<exclude expression="(.*)\.gz"></exclude>
<exclude expression="^info/*"></exclude>
<exclude expression="^static/*"></exclude>
</filter>
<inotify>
<delete start="true"/>
<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"> #需要监听的本地目录
<remote ip="172.16.16.10" name="backup"/> #目标及目标路径的模块
<!--<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="rsync" passwordfile="/etc/rsync.pwd"/> #目标服务器的rsync认证用户及密码,本端保存的认证密码文件
<userDefinedPort start="true" port=""/><!-- port= --> #监听端口
<timeout start="false" time=""/><!-- timeout= -->
<ssh start="false"/>
</rsync>
<failLog path="/usr/local/sersync/log/rsync_fail_log.sh" timeToExecute=""/><!--default every 60mins execute once-->
<crontab start="false" schedule=""><!--600mins-->
<crontabfilter start="false">
<exclude expression="*.php"></exclude>
<exclude expression="info/*"></exclude>
</crontabfilter>
</crontab>
<plugin start="false" name="command"/>
</sersync> <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=""/>
</localpath>
</plugin>
<plugin name="refreshCDN">
<localpath watch="/data0/htdocs/cms.xoyo.com/site/">
<cdninfo domainname="ccms.chinacache.com" port="" 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>
非常好用的sersync同步工具的更多相关文章
- Rsync数据同步工具及sersync同步工具
Rsync简介 Rsync英文全称Remote synchronization,从软件的名称就可以看出来,Rsync具有可使本地和远程两台主机之间的数据快速复制同步镜像,远程备份的功能,这个功能类似s ...
- 三十、sersync高级同步工具实时数据同步架构
一.项目介绍 Sersync项目利用inotity与rsync技术实现对服务器数据实时同步的解决方案,其中inotity用于监控sersync所在服务器上的文件变化. Sersync项目的优点: 1. ...
- Linux实战教学笔记21:Rsync数据同步工具
第二十一节 Rsync数据同步工具 标签(空格分隔): Linux实战教学笔记-陈思齐 ---本教学笔记是本人学习和工作生涯中的摘记整理而成,此为初稿(尚有诸多不完善之处),为原创作品,允许转载,转载 ...
- rsync数据同步工具的配置
rsync数据同步工具的配置 1. rsync介绍 1.1.什么是rsync rsync是一款开源的快速的,多功能的,可实现全量及增量的本地或远程数据同步备份的优秀工具.Rsync软件适用于 unix ...
- RSYNC 同步工具
Rsync 数据同步工具 一.Rsync简介 1.检测一下你的机器上是否已经安装 --->可以通过yum安装 或者 源码 Server 192.168.201.151 Client ...
- 【基础】:Rsync数据同步工具
第二十一节 Rsync数据同步工具 1.1 Rsync介绍 1.1.1 什么是Rsync? 1.1.2 Rsync简介 1.3 Rsync的特性 1.1.4 Rsync的企业工作场景说明 1.2 Rs ...
- Java并发之CyclicBarrier 可重用同步工具类
package com.thread.test.thread; import java.util.Random; import java.util.concurrent.*; /** * Cyclic ...
- Java并发之CountDownLatch 多功能同步工具类
package com.thread.test.thread; import java.util.Random; import java.util.concurrent.*; /** * CountD ...
- Java核心知识点学习----线程同步工具类,CyclicBarrier学习
线程同步工具类,CyclicBarrier日常开发较少涉及,这里只举一个例子,以做备注.N个人一块出去玩,相约去两个地方,CyclicBarrier的主要作用是等待所有人都汇合了,才往下一站出发. 1 ...
随机推荐
- 高橋君とカード / Tak and Cards AtCoder - 2037 (DP)
Problem Statement Tak has N cards. On the i-th (1≤i≤N) card is written an integer xi. He is selectin ...
- JDBC 初识
JDBC是 "Java Database Connective" 的缩写,是使用Java去连接数据库进行数据操作的过程. 首先通过Eclipse 创建动态项目,Dynamic We ...
- springboot全局捕获异常
捕获 捕获原理,使用AOP技术,采用异常通知. 1.捕获返回json格式 2.捕获返回页面 步骤: 1.@ControllerAdvice(pasePackage="") 注释异常 ...
- 关于flex布局【转】
很受用,原文链接:http://blog.csdn.net/magneto7/article/details/70854472
- 用CNN对CIFAR10进行分类(pytorch)
CIFAR10有60000个\(32*32\)大小的有颜色的图像,一共10种类别,每种类别有6000个. 训练集一共50000个图像,测试集一共10000个图像. 先载入数据集 import nump ...
- spring 中的设计模式
https://mp.weixin.qq.com/s?__biz=MzU0MDEwMjgwNA==&mid=2247485205&idx=1&sn=63455d2313776d ...
- eclipse JVM 性能调优
最近因项目存在内存泄漏,故进行大规模的JVM性能调优 , 现把经验做一记录. 一.JVM内存模型及垃圾收集算法 1.根据Java虚拟机规范,JVM将内存划分为: New(年轻代) Tenured(年老 ...
- 基于Redis缓存几十万条记录的快速模糊检索的功能实现(c#)
在开发一套大型的信息系统中,发现很多功能需要按公司查询,各个模块在实现时都是直接查数据库进行模糊检索,虽然对表进行向各个应用的库中进行了同步,但是在使用中发现,模糊检索公司时还是比较卡,原始的查询数据 ...
- 全局鼠标钩子:WH_MOUSE_LL, 在【 win 10 上网本】上因为太卡,运行中丢失全局鼠标钩子
一台几年前买的上网本,让我安装了一个 win 10,然后用来测试程序的时候, 发现 使用 SetWindowsHookEx(WH_MOUSE_LL, mouseHook, GetModuleHandl ...
- easyui Datagrid 表格高度计算及自适应页面的实现
因为页面上既要计算表格的高度,又要自适应浏览器大小,之前都都采用固定表格高度,这样就会导致不同的分辨率电脑上看起来表格高矮不一, 所以采用了计算网页高度和其他div 的高度之差作为表格的初始高度: H ...