Linux的镜像服务器,Linux 实时镜像服务器的部署

Sersync主要具有服务器同步、Web镜像等功能,它使用C++编写,在结合Rsync同步时,能节省运行时耗和网络资源,同时配置很简单。另外本项目相比其他脚本开源项目,使用多线程进行同步,尤其在同步较大文件时,能够保证多个服务器保持实时同步状态。

由于Sersync是开源项目,通过在该项目基础上进行扩展完成Linux 主机的镜像部署,是非常有效、简便的手段。该目标系统为CentOS 5.4,镜像软件为Sersync。Sersync软件基于boost1.41.0、inotify api、rsync command开发,同步效率比inotify-tools+rsync高。

通常,部署镜像服务器只需要简单的两步。如果曾部署过Rsync服务器,将会发现镜像服务器的部署是很简单的。

1、在镜像主机上部署Rsync

部署Rsync的方法通常很简单,可以参照“System Log Anylize (on Linux Systems)”上面的方法进行部署。不过要注意,在配置文件里面要开启写权限。

例如,要镜像源服务器的/ h o m e /anylizer、/etc/awstats、/var/www文件夹,需要配置对rsync.conf文件进行如下配置。

pidfile=/var/run/rsyncd.pid

port=873

uid=anylizer

gid=anylizer

use chroot = yes

#read only = no

max connections=5

motd file = /etc/rsyncd.motd

log file=/var/log/rsync.log

log format = %t %a %m %f %b

syslog facility = local3

timeout=300

[mirror229]

path=/home/anylizer

list=yes

ignore errors

authusers=logsync

readonly=false

secrets file=/etc/rsyncd.secrets

comment=mirror of 229

[mirrorAwstats]

path=/etc/awstats

list=yes

ignore errors

auth users=logsync

read only=false

secrets file=/etc/rsyncd.secrets

comment=mirror of 229 AWSTAT

[mirrorWeb]

path=/var/www

list=yes

ignore errors

auth users=logsync

read only=false

secrets file=/etc/rsyncd.secrets

comment=mirror of 229 web

同时,要对系统的这些文件夹有写权限。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值