sersync 主要用于服务器同步,web镜像等功能。sersync是使用c++编写,在结合rsync同步的时候,节省了运行时耗和网络资源。因此更快。sersync配置起来很简单。另外本项目相比较其他脚本开源项目,使用多线程进行同步,尤其在同步较大文件时,能够保证多个服务器实时保持同步状态,同步及时快速。

安装环境  2台服务器 实时同步文件

10.8.8.9

10.8.8.10

系统是 centos 5.8 x64

10.8.8.9 为 sersync服务器

安装 sersync 服务

下载地址 http://code.google.com/p/sersync/downloads/list

下载最新64位版本 ...

wget http://sersync.googlecode.com/files/sersync2.5.4_64bit_binary_stable_final.tar.gz

mkdir -p /opt/sersync

tar zxvf sersync2.5.4_64bit_binary_stable_final.tar.gz -C /opt/sersync

cd /opt/sersync/GNU-Linux-x86/

vi confxml.xml

修改以下部分

---------------------------------------------------------------------

<sersync>

<localpath watch="/opt/htdocs/">

<remote ip="10.8.8.10" name="system"/>

<!--<remote ip="192.168.8.39" name="tongbu"/>-->

<!--<remote ip="192.168.8.40" name="tongbu"/>-->

</localpath>

修改好以后保存...

yum -y install rsync 安装rsync 同步...( sersync 调用rsync )

10.8.8.10 客户端.... 也安装一个 rsync

yum -y install rsync

mkdir /opt/local/rsync

cd /opt/local/rsync/

vi  /opt/local/rsync/rsyncd.conf

------------------------------------------------------------------------

#Global Settings

uid = root #以什么身份运行rsync

gid = root

use chroot = no #不使用chroot

max connections = 100 #最大连接数

log file = /opt/local/rsync/log/rsyncd.log #指定rsync的日志文件,而不将日志发送给syslog

pid file = /opt/local/rsync/rsyncd.pid #指定rsync的pid文件

lock file = /opt/local/rsync/rsync.lock #指定支持max connections参数的锁文件,默认值是/var/run/rsyncd.lock

comment = hello world

[system] # 这里是认证的模块名,在client端需要指定

path = /opt/htdocs/ # 需要做镜像的目录

read only = no # yes只读 值为NO意思为可读可写模式,数据恢复用NO

hosts allow = 10.8.8.9 10.8.8.10 #允许访问的服务器IP

hosts deny = * #黑名单

list = true # 允许列文件

ignore errors = yes # 可以忽略一些无关的IO错误

------------------------------------------------------------------------

启动rsync 服务

rsync --daemon --config=/opt/local/rsync/rsyncd.conf

然后在 sersync 上面执行

/opt/sersync/GNU-Linux-x86/sersync2 -d -o /opt/sersync/GNU-Linux-x86/confxml.xml

sersync 实时同步文件的更多相关文章

  1. sersync 实时同步工具

    出处:http://code.google.com/p/sersync/ 当前版本的sersync依赖于rsync进行同步.如下图所示,在同步主服务器上开启sersync,将监控路径中的文件同步到目标 ...

  2. Sersync实时同步企业应用配置实战

    一.实验环境 CentOS版本: 6.6(2.6.32.-504.el6.x86_64) Rsync版本:  Rsync-3.0.6(系统自带) Sersync版本:sersync2.5.4_64bi ...

  3. Rsync + sersync 实时同步备份

    一      Rsync + Sersync  实时同步介绍 1.Rsync 服务搭建介绍 云机上搭建Rsync server,在本地搭建Rsync Clinet. 2. Sersync 服务搭建介绍 ...

  4. sersync 实时同步

    1.什么是实时同步 ​ 监控一个目录的变化, 当该目录触发事件(创建\删除\修改) 就执行动作, 这个动作可以是 rsync同步 ,也可以是其他. 2.为什么要实时同步 1.能解决nfs单点故障问题. ...

  5. 5. Sersync实时同步

    rsync+Sersync数据的实时同步 sersync介绍 1.什么是实时同步 监控一个目录的变化, 当该目录触发事件(创建\删除\修改) 就执行动作, 这个动作可以是 rsync同步 ,也可以是其 ...

  6. 搭建WEB、NFS共享、sersync实时同步以及全网定时备份服务流程

    本次实验的主要目的: 1.搭建web服务,使用nfs服务共享的/data目录挂载到web站点目录上. 2.nfs服务器与backup服务器使用sersync实时同步/data目录中的文件. 3.bac ...

  7. day04 sersync实时同步和ssh服务

    day04 sersync实时同步和ssh服务 sersync实时同步 1.什么是实时同步 实时同步是一种只要当前目录发生变化则会触发一个事件,事件触发后会将变化的目录同步至远程服务器. 2.为什么使 ...

  8. linux设置rsync+inotify实时同步文件

    linux设置rsync+inotify实时同步文件   应用场景: 同步接收方:test01 接收目录:/opt/software/test/a/ 同步发起方:test02 同步目录:/opt/so ...

  9. linux下实现多台服务器同步文件(inotify-tools+rsync实时同步文件安装和配置)

    inotify-tools+rsync实时同步文件安装和配置 注:转载https://www.linuxidc.com/Linux/2012-06/63624.htm

随机推荐

  1. uIP学习笔记

    uIP学习笔记 从零开始使用uIP freemodbus modbus TCP 学习笔记

  2. MySql 插入10位以上长度的字符报错or截断

    当a字段为int类型时: 如果用MyBatis向MySql插入10个字符以上长度的字符串,则会报错. 如果直接在MySql中用sql语句插入10个字符以上长度的字符串,则会变成最大的int类型数值:2 ...

  3. 不同版本(2.3,2.4,2.5) web.xml 的web-app头信息

    原址:点击打开链接 Servlet 2.3 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE w ...

  4. sql server数据库查询同义词

    查询数据库同义词: select * from sys.synonyms, 查询同义词个数:select count(1) from sys.synonyms

  5. 链接libtorrent库时出现的问题

    在QtCreator中使用libtorrent库的时候, 项目配置中 libs项配置如下: LIBS += -liconv -ltorrent-rasterbar -lboost_system -lb ...

  6. 把Wordpress集成到zen-cart里方法 各种修改 经典机制

    作者: 闻庭牛 | 分类: zen cart插件精解 | 浏览: 4 | 评论: 暂时没有评论 如果你的Zen-cart需要一个Blog来发布一些你的最新动态,可以试试Wordpress,并且用WOZ ...

  7. Chapter 1 First Sight——21

    They were sitting in the corner of the cafeteria, as far away from where I sat as possible in the lo ...

  8. 【PDF单页转化为图片输出 注意:英文或图片类的PDF可转化,中文抛异常】

    public static void main(String[] args) throws IOException { /** * PDF单页转化为图片输出 注意:英文或图片类的PDF可转化,中文抛异 ...

  9. AngularJS数据建模(转载)

    出处不明 我们知道,AngularJS并没有自带立等可用的数据建模方案.而是以相当抽象的方式,让我们在controller中使用JSON数据作为模 型.但是随着时间的推移和项目的成长,我意识到这种建模 ...

  10. Struts2 设置--Myelipse

    1. Windows---preferrence---Myeclipse---Server----Tomcat 2. Windows---preferrence---Java---Installed ...