温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

全网备份配置

发布时间:2020-07-19 23:05:43 来源:网络 阅读:234 作者:为学者 栏目:系统运维

第1节. 如何部署搭建备份服务器: rsync服务

1.1 rsync服务部署安装过程

linux系统安装部署服务流程:
a 下载安装软件  yum
b 编写配置文件
c 搭建服务环境  备份的目录/目录权限
d 启动服务程序  开机自动启动
e 测试服务功能

1.2 rsync守护进程部署方式

rsync守护进程服务端配置:

第一个历程: 下载安装软件
    rpm -qa|grep rsync
    yum install -y rsync

第二个历程: 编写配置文件

vim /etc/rsyncd.conf 
#rsync守护进程服务端配置文件#
###rsyncd.conf start##

uid = rsync       
gid = rsync       
port = 873        
fake super = yes  
use chroot = no   
max connections = 200  
pid file = /var/run/rsyncd.pid  
lock file = /var/run/rsync.lock  
log file = /var/log/rsyncd.log   
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 oldboy" 
path = /backup  

配置文件解释说明

man rsyncd.conf 帮助命令

  uid = rsync       --- 指定管理备份目录的用户 
    gid = rsync       --- 指定管理备份目录的用户组
    port = 873        --- 定义rsync备份服务的网络端口号
    fake super = yes  --- 将rsync虚拟用户伪装成为一个超级管理员用户
    use chroot = no   --- 和安全相关的配置
    max connections = 200  --- 最大连接数  同时只能有200个客户端连接到备份服务器
    timeout = 300          --- 超时时间(单位秒)
    pid file = /var/run/rsyncd.pid   --- 记录进程号码信息 1.让程序快速停止进程 2. 判断一个服务是否正在运行
    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 oldboy" 
    path = /backup                   --- 模块中配置参数 指定备份目录

第三个历程: 创建rsync服务的虚拟用户

   useradd rsync -M -s /sbin/nologin``

第四个历程: 创建备份服务认证密码文件
   echo "rsync_backup:oldboy123" >/etc/rsync.password
   chmod 600 /etc/rsync.password

第五个历程: 创建备份目录并修改属主属组信息
   mkdir /backup
chown rsync.rsync /backup/

第六个历程: 启动备份服务
   systemctl start rsyncd
   systemctl enable rsyncd
   systemctl status rsyncd  
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI