非常好用的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 ...
随机推荐
- centos7重置root密码
修改centos7的root密码重置非常简单,只需要登录系统,执行passwd按enter即可, 但是如果忘记root密码,该如何修改呢 1, 重启系统之后,系统启动进入欢迎界面,加载内核步骤时,选中 ...
- Spring通过注释配置Bean2 关联关系
接着我们讲讲关联关系的配置,我们耳熟能详的MVC结构,Controller关联着Service,Service关联着UserRepository,接着上一节的代码,完成上诉功能 在Main方法里,我们 ...
- syntax error near unexpected token `$'\r''
这种情况发生的原因是因为你所处理的文件换行符是dos格式的"\r\n"可以使用cat -v 文件名 来查看换行符是否是,如果是上述的,则行结尾会是^m需要转换成linux/unix ...
- mysql-笔记-默认值
1 指定列的默认值 columnName int default '-1' 2 integer 列-设置自增列 也是指定默认值的方式 3 默认值必须是常量 不能使用函数.表达式---特例:timest ...
- 前端动态菜单-bootstrap-treeview
一.bootstrap-treeview 官网 Demo bootstrap-treeview是一款效果非常酷的基于bootstrap的jQuery多级列表树插件.该jQuery插件基于Twitter ...
- content-type 组件
content-type初识 什么是content-type ContentType是Django的内置的一个应用,可以追踪项目中所有的APP和model的对应关系,并记录在ContentType表中 ...
- dgraph实现基本操作
dgraph实现基本操作 简单介绍 dgraph 是一个分布式图数据库 mutate 为一个突变, 一般认为添加数据或者是删除数据为一个突变 query 为一个查询 golang实现dgraph的基本 ...
- Idea查看并过滤某个接口或者类的实现
查看当前类的父类 会出现一个图 不过这个有点鸡肋,我们通常想看一个类的实现有哪些,虽然有个方法可以,但是没有图. 查看类的实现 在你想查看的类上 Ctrl+H(Ctrl+Alt+B是直接弹窗,不能过滤 ...
- JavaWeb之DButils整理
一.DBUtils介绍 apache 什么是dbutils,它的作用 DBUtils是java编程中的数据库操作实用工具,小巧简单实用. 用前导包!!!DBUtils包!!! 二.DBUtils的三 ...
- apue——无缓冲读写操作
stdrw.c文件 #include "apue.h" #define BUFFSIZE 4096 #include <stdio.h> int main(int ar ...