1. 程式人生 > >搭建backup服務器之rsyncdaemon服務模式

搭建backup服務器之rsyncdaemon服務模式

linux rsync

deamon方式就是先搭建一個服務器,這個服務器上面跑一個rsync服務,服務就稱為deamon(deamon就是實時運行的程序),rsync監聽端口是873,然後在客戶端上面使用rsync命令,實現和服務器之間推拉動作。(推拉都是在客戶端執行rsync命令)

1. 統一版本:

[[email protected] ~]# uname -m
x86_64
[[email protected] ~]# uname -r
2.6.32-642.el6.x86_64
[[email protected] ~]# rsync --version
rsync version 3.0.6 protocol version 30

Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes

rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you

are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.

查看rsync程序是否存在

[[email protected] ~]# rpm -qa rsync
rsync-3.0.6-12.el6.x86_64

如果不存在rsync就用yum install rsync -y 安裝。

2.rsync服務器搭建在備份服務器上面,然後在所有服務器上面通過命令就是推拉了。

[[email protected] ~]# ll /etc/rsyncd.conf

ls: cannot access /etc/rsyncd.conf: No such file or directory

配置文件rsyncd.conf默認是不存在的

[[email protected] ~]# vim /etc/rsyncd.conf

中插入如下信息:
#rsync_config__________start
##rsyncd.conf start##
uid=rsync
gid=rsync
use chroot=no
max connections=200
timeout=300
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsync.lock
log file=/var/log/rsyncd.log
[backup]
path=/backup
ignore errors
read only=false
list=false
hosts allow=172.16.1.0/24
hosts deny=0.0.0.0/32
auth users=rsync_backup
secrets file=/etc/rsync.password
#rsync_config________end


/etc/rsyncd.conf配置信息解釋

##rsyncd.conf start##
uid=rsync #用戶uid
gid=rsync #用戶gid
use chroot=no
max connections=200 #最大連接數
timeout=300 #超時參數
pid file=/var/run/rsyncd.pid #進程號對應的文件
lock file=/var/run/rsync.lock #鎖文件,防止文件不一致
log file=/var/log/rsyncd.log #日誌文件
[backup] #模塊
path=/backup
ignore errors
read only=false
list=false
hosts allow=172.16.1.0/24
hosts deny=0.0.0.0/32
auth users=rsync_backup
secrets file=/etc/rsync.password
#rsync_config________end


本文出自 “sandshell” 博客,請務必保留此出處http://sandshell.blog.51cto.com/9055959/1952198

搭建backup服務器之rsyncdaemon服務模式