Hello,
I'm trying to configure a simple cluster with HA master slave
replication. My goal is only to implement an easy failover, I do not
have load requirements.
My two node configurations are below (amq-n1 as master and amq-n2 as
slave host).
1) When I success to post a message on the n1 queue, then the message is
not visible on the n2, so that means that replications seems not working.
2) How can I manage that the shutdown of the n1 should switch on n2 ?
It's autotic when connecting with ha parameter ? When I try using a "2
tcp connection", I cannot send a message, that only works when I put
only one host in the URL:
jms.broker.url=(tcp://amq-n1:61616,tcp://amq-n2:61616)?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1
--> does not work
jms.broker.url=tcp://amq-n1:61616?ha=true&retryInterval=1000&retryIntervalMultiplier=1.0&reconnectAttempts=-1
--> works
Thanks for your help.
MASTER CONF :
<connectors>
<connector name="netty-connector">tcp://0.0.0.0:61616
<http://0.0.0.0:61616></connector>
<connector name="netty-backup-connector">tcp://amq-n2:61616</connector>
</connectors>
<acceptors><acceptor
name="netty-acceptor">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300
<http://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300></acceptor></acceptors>
<cluster-connections>
<cluster-connection name="my-cluster">
<connector-ref>netty-connector</connector-ref>
<static-connectors>
<connector-ref>netty-backup-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>
<ha-policy>
<replication>
<master>
<check-for-live-server>true</check-for-live-server>
</master>
</replication>
</ha-policy>
SLAVE CONF:
<connectors>
<connector name="netty-connector">tcp://0.0.0.0:61616
<http://0.0.0.0:61616></connector>
<connector name="netty-live-connector">tcp://amq-n1:61616</connector>
</connectors>
<acceptors>
<acceptor
name="netty-acceptor">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300
<http://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300></acceptor>
</acceptors>
<ha-policy>
<replication>
<slave>
<allow-failback>true</allow-failback>
<!-- not needed but tells the backup not to restart
after failback as there will be > 0 backups saved -->
<max-saved-replicated-journals-size>0</max-saved-replicated-journals-size>
</slave>
</replication>
</ha-policy>
<cluster-connections>
<cluster-connection name="my-cluster">
<connector-ref>netty-connector</connector-ref>
<static-connectors>
<connector-ref>netty-live-connector</connector-ref>
</static-connectors>
</cluster-connection>
</cluster-connections>