非常好用的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 ...
随机推荐
- Linux 安装多个版本JDK并设置默认版本
1 官网下载JDK版本 jdk-8u181-linux-x64.tar.gz 2 利用ssh工具上传安装包到Linux系统 传至:/usr/local 3 Linux用户安装的程序一般放在 /usr/ ...
- mysql union 与 union all 语法及用法
1.mysql union 语法 mysql union 用于把来自多个select 语句的结果组合到一个结果集合中.语法为: select column,......from tabl ...
- golang文件操作
一.读写文件 1.读文件操作 os.File 封装所有文件相关操作 例子: package main import ( "fmt" "os" "io/ ...
- 如何用Electron Js创建第一个应用Hello World
什么是Electron Node.js和Chromium的结合品.允许只使用HTML,CSS和JavaScript来开发跨平台桌面应用. 编写第一个Electron程序(Hello World) 在开 ...
- 【洛谷P1659】啦啦队排练
题目大意:给定一个长度为 N 的字符串,求前 K 个长度为奇数的回文子串的长度的乘积是多少. 题解:利用回文自动机,将所有长度的回文串和个数求出来,按照长度排序进行模拟即可. 代码如下 // luog ...
- vim打开退出命令
打开文件方法:cd /Users/liuchang/.jenkins/secrets && vim initialAdminPassword 退出方法:先按ESC,再输入冒号,在输入命 ...
- React踩坑记
一: Support for the experimental syntax 'classProperties' isn't currently enabled ERROR in ./src/inde ...
- GWAS后续分析:多基因风险评分(Polygenic Risk Score)的计算
一.什么是多基因风险评分 传统的GWAS研究只计算单个SNP位点与表型之间的关联性,再用Bonferroni校正,通过给定的阈值,筛选出显著的SNP位点. 这样会存在两个问题,第一.Bonferron ...
- Day057--django
1. http协议 请求的格式(request ---浏览器向服务器发送的消息) 请求方式: URL HTTP/1.1\r\n K1:V1\r\n K2:V2\r\n \r\n 请求正文/请求体(ge ...
- The 16th Zhejiang Provincial Collegiate Programming Contest Sponsored E.Sequence in the Pocket(思维题)
传送门 题意: 给出一个序列,你可以将任意一个数移到最前面: 求最少需要移动多少次,可以是此序列变成非递减序列: 思路: 定义 (ai,aj) 为逆序对 ( i < j , ai > aj ...