このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
50_dialy:2024:10:04 [2024/10/04 01:59] – 作成 matsui | 50_dialy:2024:10:04 [2024/10/04 03:35] (現在) – matsui | ||
---|---|---|---|
行 6: | 行 6: | ||
lsyncdの設定を適切に調整すれば、NFSのパフォーマンス問題を軽減できる可能性があるでしょう。 | lsyncdの設定を適切に調整すれば、NFSのパフォーマンス問題を軽減できる可能性があるでしょう。 | ||
+ | |||
+ | ===== 相互同期設定 ===== | ||
+ | |||
+ | 下記のサーバで、/ | ||
+ | |||
+ | Aサーバ: 192.168.10.11 | ||
+ | Bサーバ: 192.168.10.12 | ||
+ | |||
+ | ==== 1. インストール ==== | ||
+ | < | ||
+ | sudo apt update | ||
+ | sudo apt install lsyncd | ||
+ | </ | ||
+ | |||
+ | ==== 2.両サーバへ鍵でSSH可能に ==== | ||
+ | |||
+ | < | ||
+ | ssh-copy-id root@192.168.10.12 | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ssh-copy-id root@192.168.10.11 | ||
+ | </ | ||
+ | |||
+ | ==== 3.lsyncd.conf.lua ==== | ||
+ | |||
+ | < | ||
+ | settings { | ||
+ | logfile | ||
+ | statusFile = "/ | ||
+ | statusInterval = 1, -- ステータスログの更新間隔を1秒に設定 | ||
+ | inotifyMode = " | ||
+ | } | ||
+ | |||
+ | sync { | ||
+ | default.rsyncssh, | ||
+ | source = "/ | ||
+ | host = " | ||
+ | targetdir = "/ | ||
+ | delay = 1, -- 変更後1秒で同期 | ||
+ | rsync = { | ||
+ | archive = true, | ||
+ | compress = true, | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | settings { | ||
+ | logfile | ||
+ | statusFile = "/ | ||
+ | statusInterval = 1, -- ステータスログの更新間隔を1秒に設定 | ||
+ | inotifyMode = " | ||
+ | } | ||
+ | |||
+ | sync { | ||
+ | default.rsyncssh, | ||
+ | source = "/ | ||
+ | host = " | ||
+ | targetdir = "/ | ||
+ | delay = 1, -- 変更後1秒で同期 | ||
+ | rsync = { | ||
+ | archive = true, | ||
+ | compress = true, | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== 4.起動と自動起動設定 ==== | ||
+ | |||
+ | < | ||
+ | sudo systemctl start lsyncd | ||
+ | sudo systemctl enable lsyncd | ||
+ | </ | ||
{{tag> | {{tag> |