sersync和ssh以及跳板机
sersync简介
1.什么是sersync
实时同步是一种只要当前目录发生变化则会触发一个事件,事件触发后会将变化的目录同步至远程服务器。
2.为什么要用sersync
保证数据的连续性, 减少人力维护成本,解决nfs单点故障
nfs服务端出现故障,全部都不能用
3.怎么用sersync
sersync= inotify+rsync+守护进程
3.1、NFS实时同步到Rsync中
①上传软件包
②解压软件
③解压完移动到/usr/local
④修改配置文件/usr/local/GNU-Linux-x86/confxml.xml
--------------------------------------------------------------------------
[root@nfs ~]# confxml.xml confxml.bak #备份配置文件
[root@nfs ~]# vim /usr/local/sersync/confxml.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<head version="2.5">
<host hostip="localhost" port="8008"></host> #本机ip地址和端口
<debug start="false"/> #是否打开调试模式
<fileSystem xfs="false"/> #是否支持xfs文件系统
<filter start="false"> #是否过滤,是否排除名称中含有制定字符串的文件的同步
<exclude expression="(.*)\.svn"></exclude>
<exclude expression="(.*)\.gz"></exclude>
<exclude expression="^info/*"></exclude>
<exclude expression="^static/*"></exclude>
</filter>
<inotify>
#inotify 监控的动作
<delete start="true"/> #删除动作
<createFolder start="true"/> #创建文件夹动作
<createFile start="true"/> #创建文件动作
<closeWrite start="true"/> #写入完成动作
<moveFrom start="true"/> #移动来自动作
<moveTo start="true"/> #移动到动作
<attrib start="true"/> #属性被更改
<modify start="true"/> #修改动作
</inotify>
<sersync>
<localpath watch="/data">