Symmetric cluster replication over network
raivil Sep 29, 2014 4:17 PMHi,
I'm trying to deploy a symmetric cluster using two physical servers.
Using two hornetq instances on the same machine works perfectly. The data is replicated on the nodes. If one node dies the application can continue to work using other instance. I can add a new instances to the cluster. Perfect.
But, using a remote instance doesnt seems to work. The bridges are created, but the data is not replicated, If the node that the application is connected dies, the app cant find the remote node to continue.
Is there anything wrong with the configuration? Did i miss something?
Client config.
<bean id="jmsConnectionFactoryUserCredential" primary="true" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> <property name="targetConnectionFactory" ref="hornetConnectionFactory"/> <property name="username" value="username"/> <property name="password" value="password"/> </bean> <bean id="hornetConnectionFactory" class="org.hornetq.api.jms.HornetQJMSClient" factory-method="createConnectionFactoryWithHA"> <constructor-arg index="0"> <util:constant id="CF" static-field="org.hornetq.api.jms.JMSFactoryType.CF" /> </constructor-arg> <constructor-arg index="1"> <bean class="org.hornetq.api.core.TransportConfiguration"> <constructor-arg value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory" /> <constructor-arg> <map key-type="java.lang.String" value-type="java.lang.Object"> <entry key="host" value="127.0.0.1"></entry> <entry key="port" value="5445"></entry> </map> </constructor-arg> </bean> </constructor-arg> </bean>
Server configuration.
<connectors> <connector name="inVM"> <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class> </connector> <connector name="netty"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class> <param key="port" value="${hornetq.remoting.netty.port:5445}" /> </connector> </connectors> <acceptors> <acceptor name="inVM"> <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class> </acceptor> <acceptor name="netty"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class> <param key="port" value="${hornetq.remoting.netty.port:5445}" /> </acceptor> </acceptors> <!-- Clustering configuration --> <broadcast-groups> <broadcast-group name="my-broadcast-group"> <group-address>${udp-address:224.0.0.1}</group-address> <group-port>9876</group-port> <broadcast-period>1000</broadcast-period> <connector-ref>netty</connector-ref> </broadcast-group> </broadcast-groups> <discovery-groups> <discovery-group name="my-discovery-group"> <group-address>${udp-address:224.0.0.1}</group-address> <group-port>9876</group-port> <refresh-timeout>10000</refresh-timeout> </discovery-group> </discovery-groups> <cluster-connections> <cluster-connection name="my-cluster"> <address>jms</address> <connector-ref>netty</connector-ref> <retry-interval>500</retry-interval> <use-duplicate-detection>true</use-duplicate-detection> <forward-when-no-consumers>true</forward-when-no-consumers> <max-hops>1</max-hops> <discovery-group-ref discovery-group-name="my-discovery-group"/> </cluster-connection> </cluster-connections>