sersync监测变化触发事件后实现实时同步(迁移服务器)

web01,02安装httpd php php-mbstring php-gd nfs-utils
可道云的软件包安装在/var/www/html里 权限设置为 chmod -R 777
启动httpd

nfs01安装nfs-utils rsync
配置文件 设置权限 启动服务

web01,02/var/www/html/data/User/admin/home/video 挂载nfs共享文件夹

nfs01安装sersync(二进制)
配置sersync_installdir_64bit/sersync/conf/confxml.xml

<fileSystem xfs="true"/>	<!--centos7 xfs 文件系统-->
<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"> <!--监控本地的哪个目录,发生了哪些inotify事件,
	推送到哪个服务器的哪个模块-->
	    <remote ip="172.16.1.41" name="data"/>
<rsync>
	    <commonParams params="-avz"/>参数
	    <auth start="true" users="rsync_backup" passwordfile="/etc/rsync.passwd"/>
	    认证用户和密码放置文件 密码文件设置权限
	    <userDefinedPort start="false" port="874"/><!-- port=874 -->
	    <timeout start="true" time="100"/><!-- timeout=100 -->
	    超时时间

sersync_installdir_64bit/sersync/bin/sersync +x权限
sersync_installdir_64bit/sersync/bin/sersync -rdo sersync_installdir_64bit/sersync/conf/confxml.xml
启动该服务(rsync客户端配置好的情况下)

rsync配置文件 创建虚拟用户 创建登录用户密码文件设置权限 创建模块文件设置权限 启动rsyncd

实时同步工具选择
rsync+inotify
sersync
lsyncd

发布了35 篇原创文章 · 获赞 0 · 访问量 987

猜你喜欢

转载自blog.csdn.net/weixin_45446068/article/details/103312516