sersync部署
rsync : wget http://rsync.samba.org/ftp/rsync/src/rsync-3.1.1.tar.gz
Sersync: wget https://raw.githubusercontent.com/wsgzao/sersync/master/sersync2.5.4_64bit_binary_stable_final.tar.gz
Sersync 安装:
tar zxf sersync2.5.4_64bit_binary_stable_final.tar.gz
mv GNU-Linux-x86 /usr/local/sersync
客户端rsync部署:
RSYNC 部署: tar xf rsync-3.1.1.tar.gz
./config
Make && make install
配置文件:vim /etc/rsyncd.conf
uid=root
gid=root
max connections=36000
use chroot=yes
log file=/var/log/rsyncd.log
ignore errors = yes
read only = no
auth users = root
secrets file = /etc/rsync.pass #rsync 客户端配置, 格式为: root:klg2go 权限为 600
[rsync] #服务器端需对应的模块名
comment = rsync
path=/data/koala_ira #同步到此目录
配置文件: vim /etc/rsync.pass
root:klg2go
启动rsync : rsync --daemon --config /etc/rsyncd.conf
服务器端(同步端)
sersync部署
vim /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="/data/koala_ira/"> //服务器端需要同步过去的目录
<remote ip="183.6.104.133" name="rsync"/> // 客户端的IP地址和模块名,和上面rsync对应
<!--<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="root" passwordfile="/usr/local/sersync/user.pass"/> //start 需要为 true 才同步 同步到客户端,用到的账号和密码,需和客户端一致
<userDefinedPort start="false" port=""/><!-- port=874 -->
<timeout start="false" time=""/><!-- timeout=100 -->
<ssh start="false"/>
</rsync>
<failLog path="/tmp/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 密码文件:
Vim /usr/local/sersync/user.pass
klg2go
启动 sersync :
sersync2 -r -d -o /usr/local/sersync/conf/confxml.xml > /var/log/sersync/rsync.log 2>&1 &
另一台服务器按照改服务器相互配置即可做成相互同步: PS:同步时候注意选到目录,如果目录为空将会把对面同步的目录文件也清空。
sersync部署的更多相关文章
- Rsync+sersync部署
内核版本:2.6.32-431.el6.x86_64 系统采用最小化安装,系统经过了基本优化,selinux 为关闭状态,iptables 为无限制模式 源码包存放位置:/root Rsync 客户端 ...
- 二进制sersync部署安装
一.为什么要用rsync+sersync架构? 1.sersync是基于inotify开发的,类似于inotify-tools的工具 2.sersync可以记录下被监听目录中发生变化的(包括增加.删除 ...
- sersync+rsync进行数据同步
一:环境 操作系统环境:redhat6.6 内核版本:2.6.32-358.el6.x86_64 rsync server:192.168.2.3(部署rsync server) rsync clie ...
- sersync自动化同步部署
目录 0. 前提: 1. 部署rsync server服务 1.1 配置rsync配置文件 1.2 rsync配置文件说明: 1.3 创建密码文件修改权限600 1.4 创建提示文件(可有可无) 1. ...
- sersync+rsync原理及部署
标签:sersync+rsync部署文档 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://liubao0312.blog.51ct ...
- Ansible部署rsync、nfs及sersync
rsync nfs sersync httpd环境: 角色 外网IP(NAT) 内网IP(LAN) 主机名 Rsync服务端 eth0:10.0.1.51 eth1:172.16.1.51 backu ...
- [sersync+rsync] centos6.5 远程文件同步部署记录
针对本地文件的修改,自动同步到远程文件夹,远程备份很方面.研究了下大家的主流同步方案一般是 rsync+inotify和rsync+sersync, 我这里使用sersync的方案,当然大部分都是参照 ...
- centos6.5下部署sersync+rsync --daemon同步数据
rsync --daemon端配置 [root@rsync-daemon etc]# /etc/init.d/iptables stop [root@rsync-daemon ~]# dos2unix ...
- Sersync实时备份服务部署实践
随机推荐
- 【BZOJ】1604: [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居
[算法]并查集+平衡树+数学+扫描线 [题解] 经典曼哈顿距离转切比雪夫距离. 曼哈顿距离:S=|x1-x2|+|y1-y2|<=c 即:max(x1-x2+y1-y2,x1-x2-y1+y2, ...
- 创建堆 HeapCreate
创建额外的堆的原因1.对组件进行保护2.更有效的内存管理3.局部访问4.避免线程同步开销5.快速释放 HeapCreate函数原型:HANDLE WINAPI HeapCreate( _In_ DWO ...
- gcc 簡單操作
gcc -c test.c 產出 test.o object file gcc -c test.c -o XXX 產出 XXX object file gcc test.c -o aaa 產出 aaa ...
- 智联招聘的python岗位数据结巴分词(二)
上次获取第一次分词之后的内容了 但是数据数据量太大了 ,这时候有个模块就派上用场了collections模块的Counter类 Counter类:为hashable对象计数,是字典的子类. 然后使用m ...
- stylus安装以及使用命令行生成css文件
Stylus 是一个CSS的预处理框架,2010年产生,来自Node.js社区,主要用来给Node项目进行CSS预处理支持,所以 Stylus 是一种新型语言,可以创建健壮的.动态的.富有表现力的CS ...
- Centos安装流量监控工具iftop笔记
Centos安装流量监控工具iftop笔记 一.概述 iftop可以用来监控网卡的实时流量(可以指定网段).反向解析IP.显示端口信息等,详细的将会在后面的使用参数中说明.官方网站:http://ww ...
- [ Openstack ] Openstack-Mitaka 高可用之 Mariadb-Galera集群部署
目录 Openstack-Mitaka 高可用之 概述 Openstack-Mitaka 高可用之 环境初始化 Openstack-Mitaka 高可用之 Mariadb-Galera集群 ...
- [ 总结 ] Linux 下文件描述符
1.概述: 文件描述符是内核为了高效管理已被打开的文件所创建的索引.是一个非负整数,用于代指被打开的文件.所有通过I/O操作的系统调用都通过文件描述符. 文件描述符用以表明每一个被进程所打开的文件和s ...
- Docker Ubuntu容器安装ping(zz)
更新apt-get的软件包信息,然后再安装 sudo docker run ubuntu apt-get update sudo docker run ubuntu apt-get install i ...
- “equals”和“==”
“equals”和“==” 首先对于基本类型来说,当值相同的时候,地址也是相同的,所以可以使用“==”进行比较,但是对于equals来说,equals比较的是栈中引用指向的堆中的对象.所以在比较对象的 ...