标签:
项目需求,需要JBoss在windows下集群,记录一下以备后查
JDK:1.7
服务器环境:个人电脑windows xp
jboss版本:7.1.1 Final
mode_cluster:1.2.0 Final
1、配置mode_cluster
下载mode_cluster 1.2.0 Final windows 32位版本(测试电脑为32位,生产环境依据服务器而定)和Jboss7.1.1 Final
解压mode_cluster 压缩包到目录D:\mySoftware\httpd_mod_cluster\
运行D:\mySoftware\httpd_mod_cluster\bin\下的installconf.bat文件生成默认配置
修改conf\httpd.conf
修改#Listen 12.34.56.78:80 为 Listen 192.168.196.114:8085,端口随意
修改#ServerName 12.34.56.78:80为ServerName 192.168.196.114:8085
在末尾修改<IfModule manager_module>为以下部分
<IfModule manager_module>
Listen 192.168.196.114:7777
ManagerBalancerName mycluster
<VirtualHost *:7777>
<Location />
Order deny,allow
Deny from all
Allow from all
</Location>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
#ServerAdvertise on http://127.0.0.1:6666
AdvertiseFrequency 5
AdvertiseSecurityKey 1234567890
#AdvertiseGroup 224.0.1.105:23364
EnableMCPMReceive
AllowDisplay On
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from all
</Location>
</VirtualHost>
</IfModule>
ListenListen 192.168.196.114:8085是监听IP和端口,这样httpd才会处理访问访问这个IP端口的请求,
ServerName Listen 192.168.196.114:8085是对外的访问地址,当服务器有DNS功能时,可以改成ServerName www.example.com:80,由DNS来解析域名的IP
Listen 192.168.196.114:7777是jboss集群模块连接httpd cluster的ip和接口,同时也是管理页面访问的地址
2、配置jboss7.1.1
解压jboss压缩包到目录D:\mySoftware\jboss7
配置环境变量JBOSS_HOME为D:\mySoftware\jboss7
删除standalone\configuration\standalone.xml(删除前最好备份)
复制standalone-full-ha.xml并重命名为standalone.xml
修改文件内容
修改<serverxmlns="urn:jboss:domain:1.2">为
<server name="standalone-node1" xmlns="urn:jboss:domain:1.2">
修改<mod-cluster-configadvertise-socket="modcluster">为
<mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.196.114:7777" advertise-security-key="1234567890">
ps:proxy-list="192.168.196.114:7777"为mod_cluster中Listen 192.168.196.114:7777
advertise-security-key="1234567890"与mod_cluster中AdvertiseSecurityKey 1234567890要一致
我参考的两篇博客都是在Linux下配置的,没有配置proxy-list="192.168.196.114:7777,我在windows下为配置proxy-list时mod_cluster和jboss始终无法取得联系
修改<subsystem xmlns="urn:jboss:domain:web:1.1"default-virtual-server="default-host" native="false">为
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" instance-id="${jboss.node.name}" native="false">
修改<interfaces></interfaces>标记中的内容为
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:192.168.196.114}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:192.168.196.114}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:192.168.196.114}"/>
</interface>
</interfaces>
启动mod_cluster目录bin\httpd.exe
部署web项目到\standalone\deployments\
启动jboss目录下bin\standalone.bat
浏览器输入http://192.168.196.114:7777/mod_cluster_manager看到如下画面表示配置成功
访问http://192.168.196.114:8085/项目名/index.html就能通过httpd mode_cluster进行访问了
参考博客:
http://blog.csdn.net/xixixi9988/article/details/21651449
http://yang-min.iteye.com/blog/1961574
http://wenku.baidu.com/link?url=bteMg0-59v44fnB7T85n9lRgT8ARikkERacGkYp3qWP05Ib977_1lZ2QJGEUyEW7YYU7RdYL6IlOVPuPobZ_00DKc-9tYm3daxUcopBgT83
本文地址:http://www.cnblogs.com/wangjiajun/p/4211605.html
JBoss7.1.1 Final+mod_cluster-1.2.0.Final集群配置
标签:
原文地址:http://www.cnblogs.com/wangjiajun/p/4211605.html