Zabbix高可用-Rsync+inotify安裝

1.rsync安裝
zabbix-server01和zabbix-server02上執行:

[root@@localhost ~]# yum -y install rsync

2.rsync配置
zabbix-server01配置如下:

[root@@localhost ~]# cd /etc && ll|grep rsync

在這裏插入圖片描述
注意pwd文件的權限爲600

rsyncd.conf內容

[root@localhost ~]# more /etc/rsyncd.conf
uid=root
gid=root
max connections=100
use chroot=true
log file=/var/log/rsyncd.log
motd file = /etc/rsyncd.motd
transfer logging = true
hosts allow=192.168.153.134(根據自己的ip修改)
[zabbix]
path=/etc/zabbix/
exclude = web
comment = etc zabbix 
read only = no 
list = yes 
auth users = root 
secrets file=/etc/rsyncd.pwd
[web1]
path=/etc/httpd/conf/
comment = httpd conf
read only = no
list = yes
auth users = root
secrets file=/etc/rsyncd.pwd
[web2]
path=/etc/httpd/conf.d/
comment = httpd conf.d
read only = no
list = yes
auth users = root
secrets file=/etc/rsyncd.pwd

rsyncd.motd內容

[root@localhost etc]# more rsyncd.motd 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	welcome to use the zabbix rsync services!
			2019.12.25

rsyncd.pwd內容

[root@localhost etc]# more rsyncd.pwd
#用戶名:密碼
root:root

rsyncd.pwd2內容

[root@localhost etc]# more rsyncd.pwd2
#密碼
root

相關參數

uid=root        #服務器端傳輸文件時,要發哪個用戶和用戶組來執行
gid=root        #服務器端傳輸文件時,要發哪個用戶和用戶組來執行
max connections=100      #客戶端最多連接數
use chroot=true          #用chroot,在傳輸文件之前,服務器守護程序在將chroot到文件系統中的目錄中,這樣做的好處是可能保護系統被安裝漏洞侵襲的可能。缺點是需要超級用戶權限。另外對符號鏈接文件,將會排除在外。也就是說,你在rsync服務器上,如果有符號鏈接,你在備份服務器上運行客戶端的同步數據時,只會把符號鏈接名同步下來,並不會同步符號鏈接的內容
log file=/var/log/rsyncd.log        #rsync服務器的日誌
motd file=/etc/rsyncd.motd          #定義motd file路徑,rsyncd.motd內容是定義服務器信息的,用戶登錄時會看到這個信息
transfer logging = true             #傳輸文件日誌
hosts allow=192.168.153.134             #允許的ip地址
[zabbix]                  #模塊名
path=/etc/zabbix/     #同步的目錄
exclude = web                 #同步目錄中去除的目錄,即web不同步
comment = etc zabbix    #註釋,註釋內容可自己定義,起提示作用
read only = no          #只讀選擇,如爲yes則不讓客戶端上傳文件到服務器上
list = yes              #服務器上提供同步數據的目錄是否顯示
auth users = root       #認證用戶是root
secrets file=/etc/rsyncd.pwd        #密碼文件保存路徑
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章