博客
关于我
Centos6.9-rsync+sersync实现服务器资源实时同步
阅读量:263 次
发布时间:2019-03-01

本文共 1168 字,大约阅读时间需要 3 分钟。

文章目录

实现方式:

  1. 源服务器 安装sersync 监控文件(inotify)的变动 调用rsync传输数据给目标服务器

  2. 目标服务器 启动rsync的服务

一、目标服务器配置

配置rsync服务

1、安装rsync

yum -y install rsync

2、配置rsync

vim /etc/rsyncd.conf#自行创建该配置文件

配置文件内容

(以下内容复制到刚创建的配置文件,看个人需求修改)uid = rootgid = rootuse chroot = no#设置允许登录的ip,这里没有限制IPhosts allow=*#设置最大连接数max connections = 3#设置启动rsync服务器的文件pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.lock#同步模块[tp5shop]									<-模块名称,自行填写#需要的文件及其文件夹路径path = /usr/local/nginx/html/tp5shop		<-需要同步的本地目录#备注comment = tp5shop#只读关闭read only = false

3、以守护进程方式启动rsync

/usr/bin/rsync --daemon

二、源服务器配置

shell > wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sersync/sersync2.5.4_64bit_binary_stable_final.tar.gzshell > mv sersync2.5.4_64bit_binary_stable_final.tar.gz /usr/local/shell > cd /usr/local/shell > tar xf sersync2.5.4_64bit_binary_stable_final.tar.gzshell > mv GNU-Linux-x86 sersync

在这里插入图片描述

1.修改使用配置文件

shell > vim confxml.xml
#实际修改只用修改以下几段,其他看个人需求 

在这里插入图片描述

2.启动sersync服务

shell > /usr/local/sersync/sersync2 -n 10 -d -o /usr/local/sersync/confxml.xmlshell > ps aux | grep sersync

-n 启用线程数量 -d daemon方式启动 -o 指定配置文件

3.过滤不需要同步的文件

第6行开始


转载地址:http://jbhx.baihongyu.com/

你可能感兴趣的文章
Nio ByteBuffer组件读写指针切换原理与常用方法
查看>>
NIO Selector实现原理
查看>>
nio 中channel和buffer的基本使用
查看>>
NIO_通道之间传输数据
查看>>
NIO三大组件基础知识
查看>>
NIO与零拷贝和AIO
查看>>
NIO同步网络编程
查看>>
NIO基于UDP协议的网络编程
查看>>
NIO笔记---上
查看>>
NIO蔚来 面试——IP地址你了解多少?
查看>>
NISP一级,NISP二级报考说明,零基础入门到精通,收藏这篇就够了
查看>>
NISP国家信息安全水平考试,收藏这一篇就够了
查看>>
NIS服务器的配置过程
查看>>
NIS认证管理域中的用户
查看>>
Nitrux 3.8 发布!性能全面提升,带来非凡体验
查看>>
NiuShop开源商城系统 SQL注入漏洞复现
查看>>
NI笔试——大数加法
查看>>
NLog 自定义字段 写入 oracle
查看>>
NLog类库使用探索——详解配置
查看>>
NLP 基于kashgari和BERT实现中文命名实体识别(NER)
查看>>