httpd - mod_cluster 1.2 in Jboss 7.1.1 - Problem with endpoint webService
ngthphat Aug 21, 2012 11:41 AMHi everyone,
I'm trying install cluster for jboss. I followed the instructions as described in the following documents: https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto.
I have one master and one slave defined. I can start-up the master and when I start-up the slaves, the correctly authenticate to the master.
My problem is I cannot request to my web service when I stop one of my nodes.
I deployed cluster-demo and my_ear-xxx.ear (my web services).
This is my enviroment:
_ Jboss AS 7.1.1
_ mod_cluster 1.2.0 : (win-x86) (I cannot use win-x64 version, I can start httpd, however when I try access to mod_cluster_manager, httpd alway crash)
_ Windows 7 64bit (all nodes)
_ MS SQL 2008
_ SOAPSonar Personal for test web services
This is some section I config:
Master node:
- domain.xml
<server-groups> <server-group name="cluster-server-group" profile="full-ha"> <jvm name="default"> <heap size="64m" max-size="512m"/> </jvm> </server-group> <profile name="full-ha"> ... <subsystem xmlns="urn:jboss:domain:modcluster:1.0"> <mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.72.101:8888"> <dynamic-load-provider> <load-metric type="busyness"/> </dynamic-load-provider> </mod-cluster-config> </subsystem> <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="true"> <alias name="xcrm.com"/> </virtual-server> </subsystem> <subsystem xmlns="urn:jboss:domain:webservices:1.1"> <modify-wsdl-address>true</modify-wsdl-address> <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host> <endpoint-config name="Standard-Endpoint-Config"/> <endpoint-config name="Recording-Endpoint-Config"> <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM"> <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/> </pre-handler-chain> </endpoint-config> </subsystem> ... </profile>
-host.xml
<host name="master" xmlns="urn:jboss:domain:1.2"> <servers> <server name="full-ha-server-1" group="cluster-server-group" auto-start="true"> <socket-bindings port-offset="100"/> </server> </servers> ... </host>
Slave1 node:
-Domain.xml
<subsystem xmlns="urn:jboss:domain:webservices:1.1"> <modify-wsdl-address>true</modify-wsdl-address> <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host> <endpoint-config name="Standard-Endpoint-Config"/> <endpoint-config name="Recording-Endpoint-Config"> <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM"> <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/> </pre-handler-chain> </endpoint-config> </subsystem>
-host.xml
<host name="slave1" xmlns="urn:jboss:domain:1.2"> <security-realms> <security-realm name="ManagementRealm"> <server-identities> <secret value="MTIzMTIz="/> </server-identities> </security-realm> ... </security-realms> ... <domain-controller> <remote host="${jboss.domain.master.address:192.168.73.12}" port="${jboss.domain.master.port:9999}" security-realm="ManagementRealm"/> <!-- Alternative remote domain controller configuration with a host and port --> <!-- <remote host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}"/> --> </domain-controller> ... <servers> <server name="full-ha-server-2" group="cluster-server-group" auto-start="true"> <socket-bindings port-offset="100"/> </server> </servers> </host>
And this is my httpd.conf
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule slotmem_module modules/mod_slotmem.so LoadModule manager_module modules/mod_manager.so LoadModule proxy_cluster_module modules/mod_proxy_cluster.so LoadModule advertise_module modules/mod_advertise.so LoadModule authz_host_module modules/mod_authz_host.so Listen 192.168.72.101:8888 <VirtualHost 192.168.72.101:8888> <Location /> Order deny,allow Allow from all </Location> <Location /mod_cluster_manager> SetHandler mod_cluster-manager Order deny,allow Allow from all </Location> KeepAliveTimeout 60 MaxKeepAliveRequests 0 AllowDisplay On ManagerBalancerName cluster-server-group ServerAdvertise On EnableMCPMReceive </VirtualHost>
Then I start master node with this param:
domain.bat -b 192.168.73.12
After Master node is started. I open one in my wsdl files to check soap:address , follow this path:
\domain\servers\full-ha-server-2\data\wsdl\my_ear-1.01.20-SNAPSHOT.ear\my_service-1.01.20-SNAPSHOT.jar\TestService.wsdl
soap:address in master node
<soap:address location="http://192.168.73.12:8180/my_service-1.01.20-SNAPSHOT/TestService/TestService"/>
After that, I start slave1 node with this param:
domain.bat -b 192.168.72.101
and this is soap:address is slave1 node
<soap:address location="http://192.168.72.101:8180/my_service-1.01.20-SNAPSHOT/TestService/TestService"/>
I can use SOAPSonar Personal and test direct on above addresses --> work fine
Because I just have 2 pc, so I installed Apache httpd on 192.168.72.101 (slave1)
Test with cluster-demo:
- Start master and slave1 node
- Access to 192.168.72.101:8888/cluster-demo. --> work fine (request is redirect to master node)
- Stop master node in Jboss Management
- Request to 192.168.72.101:8888/cluster-demo. --> work fine (request is redirect to slave1 node)
Test session replication with cluster-demo:
- Start master and slave1 node
- Access to 192.168.72.101:8888/cluster-demo/put.jsp --> work fine (request is redirect to master node)
- Stop master node
- Access to 192.168.72.101:8888/cluster-demo/get.jsp --> It doesn't work, I got session Null
Test with my web services:
- Restart master node in Jboss Management
- Use SOAPSonar Personal invoke to httpd, (http://192.168.72.101:8888/my_service-1.01.20-SNAPSHOT/TestService/TestService) - request go to slave1 node --> Work fine
- Stop slave1 node
- Re-invoke that service, - It dose not work as my expectation, I see a message "Unable connect to....".
Finally, I have some question:
session replication:
- I followed on the guide on https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto, but the result is difference. Do I miss something?
- Do somebody know which module Jboss use for session replication? HornetQ or something....?
And about my web service:
- Is possible invoke the endpoint web service through httpd? I think yes but I don't know how to config?
- I deployed my_ear to Glassfish 3, but the soap:address is quite difference. I can invoke soap:address without the name "my_service-1.01.20-SNAPSHOT". Can I config on jboss to get the result like Glassfiss? like this:
http://192.168.72.101:8888/TestService/TestService
Any Ideas Welcome.