OpenMicroServerで負荷分散(Balance編)
結局、poundはうまく導入できず、balanceの導入に再挑戦。
そのままではmake installに失敗するので、Makefileの中でエラーの出る箇所;
- rootのグループ設定
- マニュアルの場所指定
を変更する。
LinuxServer[376]# make install
install -o root -g wheel -m 755 balance \
/usr/sbin/balance
install -o root -g wheel -m 755 balance.1 \
/usr/share/man/man1
mkdir -p /var/run/balance
chmod 1777 /var/run/balance
ってな具合で導入に成功。これで、MoodleのWebサーバのクラスタリングが可能となる。
Moodleだけでなく、いろいろなサービスサーバのクラスタリングに使える。
Linuxサーバによるクラスタリングやフェイルオーバーについては下記の書籍が
一番詳しく書かれていると思う。
Linuxアドバンストネットワークサーバ構築ガイド HAサーバ構築編 (Network server construction guide series (13))
- 作者: デージーネット
- 出版社/メーカー: 秀和システム
- 発売日: 2005/11
- メディア: 単行本
- 購入: 4人 クリック: 188回
- この商品を含むブログ (32件) を見る
以下、balanceの使い方。
これを見る限りは、クラスタリングだけではなく、MySQLサーバのフェイルオーバーにも
使える。ただし、データのレプリケーションは必要。
balance 3.35
Copyright (c) 2000-2006,2007 by Inlab Software GmbH, Gruenwald, Germany.
All rights reserved.usage:
balance [-b addr] [-B addr] [-t sec] [-T sec] [-adfpHM] \
port [h1[:p1[:maxc1]] [!%] [ ... hN[:pN[:maxcN]]]]
balance [-b addr] -i [-d] port
balance [-b addr] -c cmd [-d] port-a enable channel autodisable option
-b host bind to specific address on listen
-B host bind to specific address for outgoing connections
-c cmd execute specified interactive command
-d debugging on
-f stay in foregound
-i interactive control
-H failover even if Hash Type is used
-M use MMAP instead of SHM for IPC
-p packetdump
-t sec specify connect timeout in seconds (default=5)
-T sec timeout (seconds) for select (0 => never) (default=0)
! separates channelgroups (declaring previous to be Round Robin)
% as !, but declaring previous group to be a Hash Typeexample:
balance smtp mailhost1:smtp mailhost2:25 mailhost3
balance -i smtp