<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster" managerClassName="org.apache.catalina.cluster.session.DeltaManager" expireSessionsOnShutdown="false" useDirtyFlag="true"> <Membership className="org.apache.catalina.cluster.mcast.McastService" mcastAddr="228.0.0.4" mcastPort="45564" mcastFrequency="500" mcastDropTime="3000"/> <Receiver className="org.apache.catalina.cluster.tcp.ReplicationListener" tcpListenAddress="auto" tcpListenPort="4001" tcpSelectorTimeout="100" tcpThreadCount="6"/> <Sender className="org.apache.catalina.cluster.tcp.ReplicationTransmitter" replicationMode="pooled"/> <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/> <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/" deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false"/> </Cluster>
<!-- Define the top level container in our container hierarchy --> <Engine name="Catalina" defaultHost="localhost" debug="0" jvmRoute="tomcat1">
<!-- Define the top level container in our container hierarchy --> <Engine name="Catalina" defaultHost="localhost" debug="0" jvmRoute="tomcat2">
tar zxfv jakarta-tomcat-connectors-current-src.tar.gz
#mod_jkモジュールをロード LoadModule jk_module modules/mod_jk.so #workers.propertiesファイルを指定 JkWorkersFile conf/workers.properties #ログファイル JkLogFile logs/mod_jk.log JkLogLevel error #URLマッピング JkMount ⁄* loadbalancer
#ワーカーリストの定義 worker.list=loadbalancer # ← mod-jk.conf のURLマッピングとあわせておくこと # Load-balancingワーカー worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=tomcat1, tomcat2 worker.loadbalancer.sticky_session=1 #tomcat1ワーカー worker.tomcat1.port=8009 worker.tomcat1.host=server1 worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=1 #tomcat2ワーカー worker.tomcat2.port=8009 worker.tomcat2.host=server2 worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor=1
Include conf/mod-jk.conf