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
同时,要对系统的这些文件夹有写权限。

特别声明:本站注明稿件来源为其他媒体的文/图等稿件均为转载稿,本站转载出于非商业性的教育和科研之目的,并不意味着赞同其观点或证实其内容的真实性。如转载稿涉及版权等问题,请作者在两周内速来电或来函联系。