// 下階層用テンプレート
#topicpath
----
//ここにコンテンツを記述します。
JBossは内部にTomcatを同梱していますが、そのTomcatのクラスタリングで必要な、セッションのレプリケーションの設定を勉強したので手順をメモっておきます。


**WEBコンテナに名前を付ける [#p3c334ff]
WEBコンテナ1で
${install_root}/server/all/deploy/jbossweb-tomcat55.sar/server.xml
 前: <Engine name="jboss.web" defaultHost="localhost" >
 後: <Engine name="jboss.web" defaultHost="localhost" jvmRoute="tc1">
tc1はWEBコンテナ1に付けた名前。。

同様にWEBコンテナ2で jvmRoute="tc2" などとします。


**mod_jkのダウンロード [#x500bd94]
http://sunsite.tus.ac.jp/pub/apache/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.6/

**ディレクトリへのコピー [#vbf55bdb]
 cp -pfr jakarta-tomcat-connectors-jk-1.2.6-linux-fc2-i386-apache-2.0.50.so /etc/httpd/modules/mod_jk.so
 chmod 755 /etc/httpd/modules/mod_jk.so


**workers.propertiesの作成 [#s39710a9]
/etc/httpd/conf/workers.properties を作成します。

 #Define tc1 <- このtc1は jvmRoute="tc1" とあわせる
 worker.tc1.port=8009
 worker.tc1.host=xxxxxxxx <- ホスト名。IPアドレス
 worker.tc1.type=ajp13
 worker.tc1.lbfactor=1
 worker.tc1.local_worker=1
 worker.tc1.cachesize=10
 
 # Define tc2  <- このtc2は jvmRoute="tc2" とあわせる
 worker.tc2.port=8009
 worker.tc2.host=yyyyyyyy <- ホスト名。IPアドレス
 worker.tc2.type=ajp13
 worker.tc2.lbfactor=1
 worker.tc2.local_worker=1
 worker.tc2.cachesize=10
 
 # Load-balancing behaviour
 worker.loadbalancer.type=lb
 worker.loadbalancer.balanced_workers=tc1, tc2
 worker.loadbalancer.sticky_session=1
 worker.loadbalancer.local_worker_only=1
 worker.list=loadbalancer



**httpd.confへconfファイルを追加 [#yfea4693]
最後尾に
 Include conf/mod-jk.conf
と追加しておきます。

** mod-jk.conf の作成 [#x349eb3e]
vi /etc/httpd/conf/mod-jk.conf

 # Load mod_jk module
 # Specify the filename of the mod_jk lib
 LoadModule jk_module modules/mod_jk.so
 # Where to find workers.properties
 JkWorkersFile conf/workers.properties
 
 # Where to put jk logs
 JkLogFile logs/mod_jk.log
 # Set the jk log level [debug/
 JkLogLevel info
 # Select the log format
 JkLogStampFormat "[%a %b
 # JkOptions indicates to send
 JkOptions +ForwardKeySize
 # JkRequestLogFormat
 JkRequestLogFormat "%w %V
 JkMount /JBossSamplesWeb/* loadbalancer
 

***関連リンク [#i19d036b]
-[[[ThinkIT] 第4回:JBossのクラスタ設定:http://www.thinkit.co.jp/free/compare/14/3/1.html]]
-[[JBoss クラスタ入門(PDF):http://h50146.www5.hp.com/products/software/oe/linux/summary/reference/pdfs/hp_jboss1.0.pdf]]

----
この記事は
#vote(おもしろかった[1],そうでもない[0])
#vote(おもしろかった[2],そうでもない[0])

#comment
#topicpath


SIZE(10){現在のアクセス:&counter;}

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS