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实时备份服务部署实践
随机推荐
- DotNETCore 学习笔记 宿主
Hosting -------------------------------------------------------------------------- Setting up a Host ...
- QML与C++混合编程详解(转)
原文转自:http://blog.csdn.net/ieearth/article/details/42243553 原文转自:https://www.cnblogs.com/findumars/p/ ...
- [Leetcode Week3]Clone Graph
Clone Graph题解 原创文章,拒绝转载 题目来源:https://leetcode.com/problems/clone-graph/description/ Description Clon ...
- UVALIVE 2954 Task Sequences
竞赛图:图中的任意两点间有且仅有一条有向弧连接 求竞赛图中的哈密顿路的算法: 首先,由数学归纳法可证竞赛图在n>=2时必存在哈密顿路: (1)n=2时显然: (2)假设n=k时,结论成立,哈密顿 ...
- 函数:module_put ( )【转】
转自:http://book.2cto.com/201307/27049.html 文件包含: #include <linux/module.h> 函数定义: 函数在内核源码中的位置:li ...
- PL/SQL 10 管理用户子程序
--查看存储过程源代码IKKI@ test10g> select text from user_source where name='ADD_DEPT'; TEXT--------------- ...
- spring 声明式事务中try catch捕获异常
原文:http://heroliuxun.iteye.com/blog/848122 今天遇到了一个这个问题 最近遇到这样的问题,使用spring时,在业务层需要捕获异常(特殊需要),当前一般情况下不 ...
- easyUi根据一个日期给另一日期自动赋值的js
$('#loanbegindate').datebox({ onSelect:function(date){ changeDate(); } }); $('#loanterm,#loantermtyp ...
- Python/CMD 文件备份
1.使用Python压缩文件并另存 import zipfile, os #备份文件ZIP格式: folder 目标文件夹 : Targetfolder:另存地址 def backuptozip(fo ...
- [ Python - 10 ] 练习:批量管理主机工具
需求: 主机分组 登录后显示主机分组,选择分组后查看主机列表 可批量执行命令.发送文件,结果实时返回 主机用户名密码可以不同 流程图: 说明: ## 需求: 主机分组 登录后显示主机分组,选择分组后查 ...