歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Linux站群rsync同步基礎教程

Linux站群rsync同步基礎教程

日期:2017/3/2 9:56:13   编辑:關於Linux

目標:主服務器程序向多個子服務器同步程序

1. 配置同步源

安裝rsync:yum -y install rsync xinetd

開啟rsync:vim /etc/xinetd.d/rsync 把disable = yes 改為disable = no

配置:vim /etc/rsyncd.conf

#同步源標識,可隨意更改
[site]
#程序路徑
path = /home/backup
#允許同步的主機
hosts allow = 192.168.1.14
hosts deny = *
list = true
uid = root
gid = root
read only = false

2.配置同步服務器

同樣安裝rsync,並可以設置過濾列表,然後執行:

rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /var/www/html/ server_ip ::site

這裡的server_ip即為服務器IP或域名,site是同步源標識

另外再設置定時腳本。這樣同步服務器的站群便能及時從主服務器rsync同步。

Copyright © Linux教程網 All Rights Reserved