centos7.5-----rsync部署流程
rsync守护进程服务端配置:
1)安装软件
rpm -qa|grep rsync
yum install -y rsync
2) 编写配置文件
vim /etc/rsyncd.conf
#created by ysx at 2020
#syncd.conf start
uid = rsync ----------- 管理备份目录的用户
gid = rsync ----------- 管理备份目录的用户组
port = 873 ------------ rsync备份服务的网络端口号
fake super = yes — 将rsync虚拟用户伪装成为一个超级管理员用户
use chroot = no ----- 和安全相关的配置
max connections = 500 ------------------ 最大连接数 同时只能有500个客户端连接到备份服务器
timeout = 300 ------------------------------ 连接超时时间(单位秒)
pid file = /var/run/rsyncd.pid ------------ 记录程序进程号
lock file = /var/run/rsync.lock ---------- 锁文件
log file = /var/log/rsyncd.log ------------ rsync服务的日志文件
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 ---- 指定认证用户密码文件 用户名称:密码信息
[backup] ------------------------------------- 模块信息
comment = “backup dir by ysx”
path = /backup -----------------------------指定备份目录
3)创建rsync服务的虚拟用户
useradd rsync -M -s /sbin/nologin
4)创建备份服务认证密码文件
echo “rsync_backup:000000” >/etc/rsync.password
chmod 600 /etc/rsync.password
5)创建备份目录并修改属主属组信息
mkdir /backup
chown rsync.rsync /backup/
6) 启动备份服务
systemctl start rsyncd
systemctl enable rsyncd
systemctl status rsyncd
rsync守护进程客户端配置:
1)创建一个密码文件
echo “000000” >/etc/rsync.password
chmod 600 /etc/rsync.password
2)免交互传输数据测试
客户端nfs01推操作:
rsync -avz /etc/hosts [email protected]::backup --password-file=/etc/rsync.password
服务端backup验证
拉操作:
服务端:
客服端已接收