溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

全網備份配置

發(fā)布時間:2020-07-19 23:05:43 來源:網絡 閱讀:317 作者:為學者 欄目:系統(tǒng)運維

第1節(jié). 如何部署搭建備份服務器: rsync服務

1.1 rsync服務部署安裝過程

linux系統(tǒng)安裝部署服務流程:
a 下載安裝軟件  yum
b 編寫配置文件
c 搭建服務環(huán)境  備份的目錄/目錄權限
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                   --- 模塊中配置參數 指定備份目錄

第三個歷程: 創(chuàng)建rsync服務的虛擬用戶

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

第四個歷程: 創(chuàng)建備份服務認證密碼文件
   echo "rsync_backup:oldboy123" >/etc/rsync.password
   chmod 600 /etc/rsync.password

第五個歷程: 創(chuàng)建備份目錄并修改屬主屬組信息
   mkdir /backup
chown rsync.rsync /backup/

第六個歷程: 啟動備份服務
   systemctl start rsyncd
   systemctl enable rsyncd
   systemctl status rsyncd  
向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI