2 Replies Latest reply on Jan 18, 2014 1:56 AM by karna1824

    Standalone Hornetq Cluster Setup on Remote Machines

    karna1824

      hi, i'm using hornetq-2.3.0.Final. i want to setup cluster between two hornetq servers which are running on remote machines.

      So, can anybody tell me what are the configurations i need to do..?

       

      thanks in advance... :-)

        • 1. Re: Standalone Hornetq Cluster Setup on Remote Machines
          ataylor

          have you looked at the user manual or one of the many clustered examples that ships with HornetQ?

          • 2. Re: Standalone Hornetq Cluster Setup on Remote Machines
            karna1824

            Hi Andy,

            Thanks for your quick response. Basically, in the manual I could not find complete setup guide (step by step procedure) and I tried to follow the steps provided in different chapters.  I am trying to setup the HA with Live and backup servers with replication mode.

            1. I am trying to setup HA between two physical nodes having hornet q deployed

            2. As I don't have any storage, I disabled <shared-store>. I want the HA to be enabled with replication mode. I don't find any specific setting to enable replication mode. I am assuming it is default behavior and no need of specific configuration for that.

            3. When I started the individual hornetq on each physical, they are just starting. But not able to find that they are part of the live & backup servers. There are no log messages which say that. (I have also enabled the log in DEBUG mode)

            4. When I enabled <shared-store> (by just making it true), backup server kept on showing a warning message saying "HQ222137: Unable to announce Backup, Retrying"

            5. Created the acceptor and connector on each server. We defined the connector with remote IP and acceptor with local IP.

             

            Could you please us to understand where i am making the mistake..? Please find the configuration i have made for both live&backup servers...

             

            1.Live server Configuration,

             

            <configuration xmlns="urn:hornetq"

                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

              

               <paging-directory>${data.dir:../data}/paging</paging-directory>

              

               <bindings-directory>${data.dir:../data}/bindings</bindings-directory>

              

               <journal-directory>${data.dir:../data}/journal</journal-directory>

              

               <journal-min-files>10</journal-min-files>

              

               <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>

               <shared-store>false</shared-store>

               <clustered>true</clustered>

               <failover-on-shutdown>true</failover-on-shutdown>

               <allow-failback>true</allow-failback>

               <check-for-live-server>true</check-for-live-server>

               <connectors>     

                  <connector name="netty">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                  <!--   <param key="host"  value="${hornetq.remoting.netty.host:10.202.9.184}"/> -->

                     <param key="host" value="10.202.102.61"/>

                     <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

                  </connector>

                 

                  <connector name="netty-throughput">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                     <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>

                     <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>

                     <param key="batch-delay" value="50"/>

                  </connector>

                  

               </connectors>

             

               <acceptors>

                  <acceptor name="netty">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                    <!-- <param key="host"  value="${hornetq.remoting.netty.host:10.202.9.184}"/> -->

                     <param key="host"  value="10.202.9.184"/>

                     <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

                  </acceptor>

                 

                  <acceptor name="netty-throughput">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                     <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>

                     <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>

                     <param key="batch-delay" value="50"/>

                     <param key="direct-deliver" value="false"/>

                  </acceptor>

               </acceptors>

             

               <broadcast-groups>

                  <broadcast-group name="bg-group1">

                     <group-address>231.7.7.7</group-address>

                     <group-port>9876</group-port>

                     <broadcast-period>5000</broadcast-period>

                     <connector-ref>netty</connector-ref>

                  </broadcast-group>

               </broadcast-groups>

             

               <discovery-groups>

                  <discovery-group name="dg-group1">

                     <group-address>231.7.7.7</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>

                      <discovery-group-ref discovery-group-name="dg-group1"/>

                  </cluster-connection>

               </cluster-connections>

              

               <security-settings>

                  <security-setting match="#">

                     <permission type="createNonDurableQueue" roles="guest"/>

                     <permission type="deleteNonDurableQueue" roles="guest"/>

                     <permission type="consume" roles="guest"/>

                     <permission type="send" roles="guest"/>

                  </security-setting>

               </security-settings>

             

               <address-settings>

                  <!--default for catch all-->

                  <address-setting match="#">

                     <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                     <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                     <redelivery-delay>0</redelivery-delay>

                     <max-size-bytes>10485760</max-size-bytes>      

                     <message-counter-history-day-limit>10</message-counter-history-day-limit>

                     <address-full-policy>BLOCK</address-full-policy>

                  </address-setting>

               </address-settings>

             

              

             

            </configuration>

             

             

             

            2. Backup server Configuration

             

            <configuration xmlns="urn:hornetq"

                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

              

               <paging-directory>${data.dir:../data}/paging</paging-directory>

              

               <bindings-directory>${data.dir:../data}/bindings</bindings-directory>

              

               <journal-directory>${data.dir:../data}/journal</journal-directory>

              

               <journal-min-files>10</journal-min-files>

              

               <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>

               <shared-store>false</shared-store>

               <clustered>true</clustered>

               <failover-on-shutdown>true</failover-on-shutdown>

               <allow-failback>true</allow-failback>

               <check-for-live-server>true</check-for-live-server>

               <backup>true</backup>

               <connectors>     

                  <connector name="netty">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                  <!--   <param key="host"  value="${hornetq.remoting.netty.host:10.202.9.184}"/> -->

            <param key="host" value="10.202.9.184"/>

                     <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

                  </connector>

                 

                  <connector name="netty-throughput">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                     <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>

                     <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>

                     <param key="batch-delay" value="50"/>

                  </connector>

                  

               </connectors>

             

               <acceptors>

                  <acceptor name="netty">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                    <!-- <param key="host"  value="${hornetq.remoting.netty.host:10.202.9.184}"/> -->

                     <param key="host"  value="10.202.102.61"/>

                     <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>

                  </acceptor>

                 

                  <acceptor name="netty-throughput">

                     <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                     <param key="host"  value="${hornetq.remoting.netty.host:localhost}"/>

                     <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>

                     <param key="batch-delay" value="50"/>

                     <param key="direct-deliver" value="false"/>

                  </acceptor>

               </acceptors>

             

               <broadcast-groups>

                  <broadcast-group name="bg-group1">

                     <group-address>231.7.7.7</group-address>

                     <group-port>9876</group-port>

                     <broadcast-period>5000</broadcast-period>

                     <connector-ref>netty</connector-ref>

                  </broadcast-group>

               </broadcast-groups>

             

               <discovery-groups>

                  <discovery-group name="dg-group1">

                     <group-address>231.7.7.7</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>

                      <discovery-group-ref discovery-group-name="dg-group1"/>

                  </cluster-connection>

               </cluster-connections>

              

               <security-settings>

                  <security-setting match="#">

                     <permission type="createNonDurableQueue" roles="guest"/>

                     <permission type="deleteNonDurableQueue" roles="guest"/>

                     <permission type="consume" roles="guest"/>

                     <permission type="send" roles="guest"/>

                  </security-setting>

               </security-settings>

             

               <address-settings>

                  <!--default for catch all-->

                  <address-setting match="#">

                     <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                     <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                     <redelivery-delay>0</redelivery-delay>

                     <max-size-bytes>10485760</max-size-bytes>      

                     <message-counter-history-day-limit>10</message-counter-history-day-limit>

                     <address-full-policy>BLOCK</address-full-policy>

                  </address-setting>

               </address-settings>

             

              

             

            </configuration>