1 Reply Latest reply on Aug 31, 2012 3:35 AM by qtm

    HornetQ 2.3.0.Alpha replication journal synchronization

    qtm

      Hi,

       

      I'm testing the replication and I'm using the replicated-transaction-failover example. I have 2 servers on my localhost for this test. I'm getting some weird behaviour for a simple test with a live and a back-up. The live starts well, the back-up starts and announces itself, but with a warning : WARN  [org.hornetq.core.server] HQ112216: Moving data directory ../data/backup/journal to ../data/backup/journal1 . Each time(at least 5 times) it restarts it creates a new folder. Does anybody know why and how can I stop it?

       

      If I kill the live, the back-up becomes live ([org.hornetq.core.server] HQ111044: HornetQServerImpl::serverUUID=332251e7-ec63-11e1-a171-094394aeb4ba to become live  - can't this message be improved, it doesn't state the back-up has become live, just that it is in the process of becoming) and it works well. The next step is to start the old-live server. I'm expecting it to become live again and the now-live to get back to being a back-up. This does not happen( setting allow-failback and failback-connectors doesn't help either). I'm having two live servers with the same journal and a lot of conflicts. The following message shows up continuously:

      HQ112050: There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node. nodeID=332251e7-ec63-11e1-a171-094394aeb4ba

       

      Since the files are copied during replication, I guess this makes sense - it's the same file present in 2 servers. Shouldn't the back-up update it's journal when the live becomes available again?

       

      Any other hints?

       

      Thanks a lot

        • 1. Re: HornetQ 2.3.0.Alpha replication journal synchronization
          qtm

          The example I've tried couldn't have worked on 2.3.0Alpha(it was specified in the documentation that the failback example doesn't work). I've tried the trunk version, but I think I'm missing something, because after restarting the live server (replication works fine for a little while) the back-up node dies:

           

          HQ112044: error starting server locator: HornetQException[errorType=ILLEGAL_STATE message=null]

              at org.hornetq.core.client.impl.ServerLocatorImpl.initialise(ServerLocatorImpl.java:350) [hornetq-core.jar:]

          ERROR [org.hornetq.core.server] HQ114036: Failed to decode packet: java.lang.IllegalStateException: Missing replication token on the queue.

              at org.hornetq.core.replication.ReplicationManager.replicated(ReplicationManager.java:407) [hornetq-core.jar:]

           

          My configuration:

          live:

          [..]

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

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

           

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

           

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

             <journal-type>ASYNCIO</journal-type>

           

             <connectors>

           

                <connector name="netty-connector">

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

                   <param key="host" value="[my_ip]"/>

                   <param key="port" value="5445"/>

                </connector>

                <connector name="netty-connector-2">

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

                   <param key="host" value="[my_ip]"/>

                   <param key="port" value="5545"/>

                </connector>

             </connectors>

            

             <!-- Acceptors -->

             <acceptors>

                <acceptor name="netty-acceptor">

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

                   <param key="host" value="[my_ip]"/>

                   <param key="port" value="5445"/>

                </acceptor>

             </acceptors>

              <cluster-connections>

                  <cluster-connection name="my-cluster">

                      <address>jms</address>

                           <connector-ref>netty-connector</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>

                       <static-connectors>

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

                                  </static-connectors>

                  </cluster-connection>

              </cluster-connections>

          [..]

          back-up:

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

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

           

             <backup>true</backup>  

           

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

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

             <journal-type>ASYNCIO</journal-type>

           

             <connectors>

           

                <connector name="netty-connector">

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

                   <param key="host" value="[my_ip]"/>

                   <param key="port" value="5545"/>

                </connector>

                <connector name="netty-connector-2">

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

                   <param key="host" value="[my_ip]"/>

                   <param key="port" value="5445"/>

                </connector>

             </connectors>

            

             <!-- Acceptors -->

             <acceptors>

                <acceptor name="netty-acceptor">

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

                   <param key="host" value="[my_ip]"/>

                   <param key="port" value="5545"/>

                </acceptor>

             </acceptors>

              <cluster-connections>

                  <cluster-connection name="my-cluster">

                      <address>jms</address>

                           <connector-ref>netty-connector</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>

                       <static-connectors>

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

                                  </static-connectors>

                  </cluster-connection>

              </cluster-connections>

           

          What else needs to be added?