服务刚从北京搬到本地,原来设想的架构只有一个WEB前台,结果jboss老莫名当机,弄得我们做hosting的忙的焦头烂耳,最后没办法只好先拿备份的那台顶上,弄两个前台,通过apache来集群,具体配置如下:
httpd.conf添加
Include conf/mod_jk2.conf
mod_jk2.conf 配置
#mod_jk.so 网上可下载
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers2.properties
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
JkMount /* loadbalancer
HostnameLookups Off
#apache will serve the static picture.
#by chencj Non-jboss image.
JkUnMount /images/* loadbalancer
.........
#JkUnMount /*.pl loadbalancer
JkUnMount /images/private_root/* loadbalancer
JkUnMount /images/erased_root/* loadbalancer
#服务器维护提示页面
JkUnMount /503error/* loadbalancer
workers2.properties 配置如下:
worker.list=loadbalancer
worker.maintain=60
worker.kd-web.port=8009
worker.kd-web.host=IP1
worker.kd-web.type=ajp13
worker.kd-web.lbfactor=2 #值越大,权中越大
worker.kd-web.local_worker=1
worker.kd-web.cachesize=128
worker.kd-web.socket_timeout=300
worker.kd-web.cache_timeout=600
#worker.kd-web.retries=5
worker.kd-backup.port=8009
worker.kd-backup.host=IP2
worker.kd-backup.type=ajp13
worker.kd-backup.lbfactor=1
worker.kd-backup.local_worker=0
worker.kd-backup.cachesize=128
worker.kd-backup.socket_timeout=300
worker.kd-backup.cache_timeout=600
#worker.kd-backup.retries=5
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=kd-web,kd-backup
#worker.loadbalancer.balanced_workers=kd-web
#worker.loadbalancer.balanced_workers=kd-backup
worker.loadbalancer.sticky_session=1
配好以后分别在WEB的jboss-4.0.*SP1/server/default/deploy/jbossweb-tomcat55.sar下的 server.xml 修改如下
另一台的 jvmRoute="kd-backup"
完毕重启jboss/apache生效
阅读(1781) | 评论(0) | 转发(0) |