rsync+nfs+lrsync服务
主机信息
主机角色 | 外网IP | 内网IP | 主机名 |
---|---|---|---|
nfs、lsync | 10.0.0.31 | 176.16.1.31 | nfs |
客户端 | 10.0.0.7 | 176.16.1.7 | web01 |
rsync、nfs | 10.0.0.41 | 172.16.1.41 | backup |
部署流程
1.backup服务器部署rsync
--下载rsync服务
[root@backup ~]# yum install -y rsync
--配置rsync服务
[root@backup ~]# vim /etc/rsyncd.conf
uid = rsync
gid = rsync
port = 873
fake super = yes
use chroot = no
max connections = 200
timeout = 600
ignore errors
read only = false
list = false
auth users = rsync_backup
secrets file = /etc/rsync.passwd
log file = /var/log/rsyncd.log
[backup]
path = /backup #存放系统重要文件
[nfs]
path = /nfs #存放用户数据文件
--创建必要文件(组、用户、匿名用户密码文件、模块目录、对应权限)
[root@backup ~]# groupadd -g 666 rsync
[root@backup ~]# useradd -g 666 -u 666 -M -s /sbin/nologin rsync
[root@backup ~]# id rsync
uid=666(rsync) gid=666(rsync) groups=666(rsync)
[root@backup ~]# echo rsync_backup:123 > /etc/rsync.passwd
[root@backup ~]# chmod 600 /etc/rsync.passwd
[root@backup ~]# mkdir /backup /nfs
[root@backup ~]# chown rsync.rsync /backup /nfs
[root@backup ~]# ll -d /backup /nfs /etc/rsync.passwd
drwxr-xr-x 2 rsync rsync 6 Dec 2 16:29 /backup
-rw------- 1 root root 17 Dec 2 16:29 /etc/rsync.passwd
drwxr-xr-x 2 rsync rsync 6 Dec
标签:rsync,root,etc,nfs,lrsync,666,backup
From: https://blog.csdn.net/dingzy1/article/details/144358343