Jboss HornetQ Failover in different clustered machines (Virtual machines)
navod Jul 6, 2016 4:15 AMHi,
I need to implement hornetQ with failover for Jboss AS 7.2 (HornetQ: 2.3.0 CR1).
I was able to successfully implement it in the same machine with two different copies of Jboss.
But put my backup server in a VM there are some problems.
These are the steps that happens
Live server up - OK
Back up server up - OK - "backup announced" log message is there
Live server shutdown. My queues are deployed in backup server and backup log says "Backup Server is now live"
Client tries to publish messages - Publisher does nothing. (No error or anything).
(This same steps worked fine when I had both live and back up instances in the same PC (which is a Virtual machine))
I have attached my standalone-config xmls from back up and live servers.
Difference between working configurations in the same machine VS different machines is that I have added <param key="host" value="LIVESERVER"/> to backup server acceptor and connector, because I initially got some errors
Both were VMs are windows server 2012. I started my servers as follows
Live: standalone.bat --server-config=standalone-full-ha.xml -Djboss.bind.address=0.0.0.0 -Djboss.node.name=jl1
Backup: standalone.bat --server-config=standalone-full-ha.xml -Djboss.bind.address=0.0.0.0 -Djboss.node.name=jbu1
Key snippets from the log file
This is same for both live and backup
<broadcast-groups> <broadcast-group name="bg-group1"> <socket-binding>messaging-group</socket-binding> <broadcast-period>5000</broadcast-period> <connector-ref> netty </connector-ref> </broadcast-group> </broadcast-groups> <discovery-groups> <discovery-group name="dg-group1"> <socket-binding>messaging-group</socket-binding> <refresh-timeout>10000</refresh-timeout> </discovery-group> </discovery-groups> <cluster-connections> <cluster-connection name="my-cluster"> <address>jms</address> <connector-ref>netty</connector-ref> <discovery-group-ref discovery-group-name="dg-group1"/> </cluster-connection> </cluster-connections>
Live server
<connectors> <netty-connector name="netty" socket-binding="messaging"> </netty-connector> <netty-connector name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> </netty-connector> <in-vm-connector name="in-vm" server-id="0"/> </connectors> <acceptors> <netty-acceptor name="netty" socket-binding="messaging"> </netty-acceptor> <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> <param key="direct-deliver" value="false"/> </netty-acceptor> <in-vm-acceptor name="in-vm" server-id="0"/> </acceptors>
Backup server
<connectors> <netty-connector name="netty" socket-binding="messaging"> <param key="host" value="LIVESERVER"/> </netty-connector> <netty-connector name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> </netty-connector> <in-vm-connector name="in-vm" server-id="0"/> </connectors> <acceptors> <netty-acceptor name="netty" socket-binding="messaging"> <param key="host" value="LIVESERVER"/> </netty-acceptor> <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput"> <param key="batch-delay" value="50"/> <param key="direct-deliver" value="false"/> </netty-acceptor> <in-vm-acceptor name="in-vm" server-id="0"/> </acceptors>
Any help is appreciated.
(I'm not in a position to use latest versions in EAP 6, Wildfly etc because our jboss version is already been in user for a long time now)