Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Rsync + Sersync 實現海量資料即時同步架構部署指南

編輯:關於 Linux

對比 Rsync + Inotify-tools(全量掃描、效率低)與 Rsync + Sersync(記錄具體變更檔案、增量同步、高效能),建議資料量超過百 GB 時採用 Sersync。

架構規劃

  • 來源伺服器:192.168.21.129
  • 目標伺服器:192.168.21.127、.128
  • 同步目錄:/home/www.jb51.net
  • OS:CentOS 5.x

目標端部署(兩台同步執行)

  1. 關閉 SELinux:setenforce 0、修改 /etc/selinux/config 設 SELINUX=disabled。
  2. 開放防火牆 873 埠(rsync 預設)。
  3. 安裝 yum install rsync xinetd,編輯 /etc/xinetd.d/rsync 設 disable = no,啟動 /etc/init.d/xinetd start。
  4. 配置 /etc/rsyncd.conf:設定模組、授權帳號、讀寫權限。
  5. 建立密碼檔 /etc/rsyncd.pass,權限 600。

來源端部署

  1. 安裝 rsync、sersync(需手動編譯或第三方 repo)。
  2. 配置 confxml.xml:指定來源目錄、目標伺服器 IP、模組名、密碼檔、過濾規則。
  3. 啟動 sersync:sersync -r -d -o confxml.xml(-r 全量同步、-d 守護進程、-o 指定配置)。
  4. 驗證:來源端建立/修改/刪除檔案,觀察目標端即時同步。

完整配置檔範例與多目標負載均衡設定請參考原文分頁。

上一頁123456下一頁共6頁

Copyright © Windows教程網 All Rights Reserved