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实时备份服务部署实践
随机推荐
- ECharts问题--柱状图和折线图中xAxis.data为空时报错问题解决
1. 我们在日常的开发中使用Echarts时,不像在学习的过程中是自己在option中的配置项填写图表需要的参数,而是通过ajax请求后台,获取数据后,使用javascript来动态的修改数据,但是有 ...
- .tar与.gz有什么联系与区别?
我们在windows下经常进行压缩解压等操作.在linux上也经常会用到,但是比较常见的是.tar.gz 很多人见到就条件反射,压缩用czvf,解压用xzvf.但是,你真的了解这个后缀名吗? 其实: ...
- Java 原子性引用 AtomicReference
http://www.jianshu.com/p/882d0e2c3ea6 实现 原子操作 使用场景: 一个线程使用student对象,另一个线程负责定时读表,更新这个对象.那么就可以用AtomicR ...
- Mysql快速导出导入数据的实验
一.创建测试数据库 CREATE database example; use example; create TABLE `user` ( `id` ) NOT NULL, `last_name` v ...
- MySQL的事务理解
在学习事务这一概念前,我们需要需要构思一个场景 场景构思 假设该场景发生于一个银行转账背景下,月中,又到了发工资的日子.学校打算给A老师发放一个月的工资.(此处,我们假设转账都是由人工操作的),整个过 ...
- docker容器间通信
现在在我们的docker中已经有了三个容器,分别是DB/API/UI三个容器,三个容器间肯定是要进行互相通信的 可以查看docker的官方文档,https://docs.docker.com/engi ...
- C# 连接SQL数据库以及操作数据库
1.概述 ado.net提供了丰富的数据库操作,这些操作可以分为三个步骤: 第一,使用SqlConnection对象连接数据库: 第二,建立SqlCommand对象,负责SQL语句的执行和存储过程的调 ...
- HDU 1017 A Mathematical Curiosity (输出格式,穷举)
#include<stdio.h> int main() { int N; int n,m; int a,b; int cas; scanf("%d",&N); ...
- debug 英文翻译
declaration of 'int a' shadows a parameter :函数参数里,已经有这两个名称的变量了,指定义了同名的参数,造成了隐藏. expected primary-exp ...
- ubuntu 进入 pycharm(社区版)
先进入到pycharm所在的目录,然后进入bin 然后./pycharm.sh 例如,我把pycharm 放在桌面上 su ➜ xushukui cd '/home/xushukui/桌面/pycha ...