我正在尝试使用apache2代理中的mod_cluster以域模式configurationJBoss AS 7.1.1群集。 所有主机都运行Ubuntu,并且是Rackspace云服务器。
我的问题是,当我打开我的应用程序在http://project.example.com/我只是得到一个503
JBoss日志报告:
org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Error [MEM: MEM: Can't read node: {4}] sending command STATUS to proxy proxy-ip/proxy-ip:6666, configuration will be reset
mod_clusterpipe理页面包含以下信息:
DUMP输出
balancer: [1] Name: main-server-group Sticky: 1 [JSESSIONID]/[jsessionid] remove: 0 force: 0 Timeout: 0 maxAttempts: 1 node: [1:1],Balancer: main-server-group,JVMRoute: slave:server-two,LBGroup: [],Host: project-jb-node1,Port: 8159,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 26,ttl: 60,timeout: 0 node: [2:2],Balancer: main-server-group,JVMRoute: master:server-one,LBGroup: [],Host: project-jb-master,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 26,ttl: 60,timeout: 0 node: [3:3],Balancer: main-server-group,JVMRoute: master:server-two,LBGroup: [],Host: project-jb-master,Port: 8159,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 26,ttl: 60,timeout: 0 node: [4:4],Balancer: main-server-group,JVMRoute: slave:server-one,LBGroup: [],Host: project-jb-node1,Port: 8009,Type: ajp,flushpackets: 0,flushwait: 10,ping: 10,smax: 26,ttl: 60,timeout: 0
INFO输出:
Node: [1],Name: slave:server-two,Balancer: main-server-group,LBGroup: ,Host: project-jb-node1,Port: 8159,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 26,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100 Node: [2],Name: master:server-one,Balancer: main-server-group,LBGroup: ,Host: project-jb-master,Port: 8009,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 26,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100 Node: [3],Name: master:server-two,Balancer: main-server-group,LBGroup: ,Host: project-jb-master,Port: 8159,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 26,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100 Node: [4],Name: slave:server-one,Balancer: main-server-group,LBGroup: ,Host: project-jb-node1,Port: 8009,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 26,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
重新启动后,apache error.log有:
[Sun May 26 19:17:51 2013] [notice] Apache/2.2.22 (Ubuntu) mod_cluster/1.2.0.Final configured -- resuming normal operations [Sun May 26 19:17:52 2013] [warn] manager_handler STATUS error: MEM: Can't read node [Sun May 26 19:17:53 2013] [warn] manager_handler STATUS error: MEM: Can't read node [Sun May 26 19:17:55 2013] [warn] manager_handler STATUS error: MEM: Can't read node [Sun May 26 19:18:00 2013] [warn] manager_handler STATUS error: MEM: Can't read node [Sun May 26 19:18:26 2013] [error] proxy: CLUSTER: (balancer://main-server-group). All workers are in error state
如果我打http://project.example.com/index.html我得到这个在apache error.log:
[Sun May 26 19:34:33 2013] [warn] proxy: No protocol handler was valid for the URL /index.html. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
主机名( project-jb-master等)映射到/ etc / hosts中的IP,我可以使用telnet进行连接并可以ping通。
在这个search引擎中,我发现很多关于实例id的提及,所以我把它设置在full-haconfiguration文件中:
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" instance-id="${jboss.node.name}" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/> <virtual-server name="default-host" enable-welcome-root="false"> <alias name="localhost"/> <alias name="project.example.com"/> </virtual-server> </subsystem>
但原来的消息仍然存在。
Rackspace云服务器当前不允许组播。 组播stream量的stream量过大会导致交换层过载,降低了所有stream量的networking性能。
出于这个原因,configuration应该看起来像这样:
Apacheconfiguration:
Listen host:6666 <VirtualHost host:6666> EnableMCPMReceive <Location /mod_cluster-manager> SetHandler mod_cluster-manager </Location> </VirtualHost>
ServerAdvertise未启用
JBossconfiguration:
<subsystem xmlns="urn:jboss:domain:modcluster:1.1"> <mod-cluster-config advertise="false" connector="ajp" proxy-list="host:6666"> ... </mod-cluster-config> </subsystem>
代理列表
定义此节点最初将与之通信的httpd代理的逗号分隔列表。 价值应该是这样的forms:
address1:port1,address2:port2
广告
使用默认的configuration,这个属性可以通过jboss.mod_cluster.proxyList系统属性来操作。
如果启用,httpd代理将通过多播通告自动发现。 这可以用于一致或代替静态proxyList。
mod_cluster文档
将您的Apache HTTP服务器设置为LogLeveldebugging。 那么你将能够在error_log中看到AS7实例发送了什么消息。 此外,更新到mod_cluster 1.2.6。 它完全向后兼容1.2.4,并包含大量重要的错误修复。
代理:没有协议处理程序对URL /index.html有效。 如果您正在使用mod_proxy的DSO版本,请确保代理子模块包含在使用LoadModule的configuration中。
确保你已经加载了mod_proxy_http和/或mod_proxy_ajp。