​CentOS搭建rsync服务器

     2013年10月25日       teddy.sun       运维笔记->系统管理       rsync xinetd 

1.安装软件包
yum install -y rsync
yum install -y xinetd
2.配置xinetd
sed -i '/disable/ s/yes/no/g' /etc/xinetd.d/rsync
如果没有/etc/xinetd.d/rsync文件,直接复制以下内容到/etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
#       allows crc checksumming etc.
service rsync
{
        disable = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
}
3.增加rsyncd配置
配置文件/etc/rsyncd.conf,内容如下(根据实际情况修改)
[hadoop]
   comment = hadoop
   path = /home/hadoop/hadoop
   uid = hadoop
   gid = hadoop
   use chroot = no
   read only = yes
   list = yes
4.启动xinetd
/etc/init.d/xinetd start
4.测试
rsync rsync://localhost/
显示:
#rsync rsync://localhost/
hadoop          hadoop
OK,完成!