2 Replies Latest reply on Sep 26, 2011 5:32 PM by jhannah

    Backup Server 'Unable to announce backup'

    jhannah

      I've been attempting to get a Live-Backup configuration deployed on two distinct servers.  I've been using the user guide and examples to assist with my configuration, however, I've run into a problem that I haven't been able to resolve.  With the attached configuration, my Live server starts up without any problems.  However, when I startup my Backup server, I get a warning stating "Unable to announce backup" with the following exception:

       

      12:19:04,612 WARN  [ClientSessionFactoryImpl] Tried 1 times to connect. Now giving up on reconnecting it.

      12:19:04,622 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/jboss/jboss-6.1.0.Final/bin/native/lib

      12:19:04,612 WARN  [ClusterManagerImpl] Unable to announce backup: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]

          at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:619) [:6.1.0.Final]

          at org.hornetq.core.client.impl.ServerLocatorImpl.connect(ServerLocatorImpl.java:503) [:6.1.0.Final]

          at org.hornetq.core.server.cluster.impl.ClusterManagerImpl$1.run(ClusterManagerImpl.java:860) [:6.1.0.Final]

          at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.1.0.Final]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

       

      Has anyone else experience this issue?  If so, has a resolution been found?  If anyone could comment on my configuration files, I'd appreciate any insights that could be provided.

       

      Thanks,

       

      J

        • 1. Re: Backup Server 'Unable to announce backup'
          jhannah

          Configuration files didn't attach... so here they are:

           

          Live server hornetq-configuration.xml


          <configuration xmlns="urn:hornetq"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

             <!--  Don't change this name.
                   This is used by the dependency framework on the deployers,
                   to make sure this deployment is done before any other deployment -->
             <name>HornetQ.main.config</name>
          <clustered>true</clustered>
          <failover-on-shutdown>true</failover-on-shutdown>
          <allow-failback>true</allow-failback>
          <journal-type>NIO</journal-type>
             <log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>

          <bindings-directory>/mnt/jwh1/jhannah/hornetq/bindings</bindings-directory>
          <journal-directory>/mnt/jwh1/jhannah/hornetq/journal</journal-directory>
          <large-messages-directory>/mnt/jwh1/jhannah/hornetq/largemessages</large-messages-directory>
          <paging-directory>/mnt/jwh1/jhannah/hornetq/paging</paging-directory>
            
             <!-- Default journal file size is set to 1Mb for faster first boot -->
             <journal-file-size>${hornetq.journal.file.size:1048576}</journal-file-size>

             <!-- Default journal min file is 2, increase for higher average msg rates -->
             <journal-min-files>${hornetq.journal.min.files:2}</journal-min-files>

          <shared-store>true</shared-store>

             <connectors>
                <connector name="netty-connector">
                   <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                   <param key="port" value="5445"/>
                </connector>
             </connectors>

             <acceptors>  
                <acceptor name="netty-acceptor">
                   <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                   <param key="port" value="5445"/>
                </acceptor>
             </acceptors>

            <!-- Clustering configuration -->
             <broadcast-groups>
            <broadcast-group name="bg-group1">
             <group-address>231.7.7.7</group-address>
             <group-port>9876</group-port>
             <broadcast-period>1000</broadcast-period>
                   <connector-ref>netty-connector</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>60000</refresh-timeout>
            </discovery-group>
          </discovery-groups>

          <cluster-connections>
            <cluster-connection name="my-cluster">
             <address>jms</address>
                   <connector-ref>netty-connector</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>

           

          Live server hornetq-jms.xml

          <configuration xmlns="urn:hornetq"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

             <!--the connection factory used by the example-->
             <connection-factory name="ConnectionFactory">
                <connectors>
                   <connector-ref connector-name="netty-connector"/>
                </connectors>

                <entries>
                   <entry name="ConnectionFactory"/>
                </entries>
                
                 <ha>true</ha>
                <!-- Pause 1 second between connect attempts -->
                <retry-interval>1000</retry-interval>

                <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
                implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
                pause is the same length -->
                <retry-interval-multiplier>1.0</retry-interval-multiplier>

                <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
                <reconnect-attempts>-1</reconnect-attempts>
                
             </connection-factory>
            
             <queue name="DLQ">
                <entry name="/queue/DLQ"/>
             </queue>
            
             <queue name="ExpiryQueue">
                <entry name="/queue/ExpiryQueue"/>
             </queue>

             <queue name="RequestQueue">
                <entry name="/queue/RequestQueue" />
             </queue>

             <queue name="PendingQueue">
                <entry name="/queue/PendingQueue" />
             </queue>

          </configuration>

           

           

          Backup server hornetq-configuration.xml


          <configuration xmlns="urn:hornetq"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

             <!--  Don't change this name.
                   This is used by the dependency framework on the deployers,
                   to make sure this deployment is done before any other deployment -->
             <name>HornetQ.main.config</name>
          <clustered>true</clustered>
          <failover-on-shutdown>true</failover-on-shutdown>
          <allow-failback>true</allow-failback>
          <journal-type>NIO</journal-type>
             <log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
           
             <bindings-directory>/mnt/jwh1/jhannah/hornetq/bindings</bindings-directory>
             <journal-directory>/mnt/jwh1/jhannah/hornetq/journal</journal-directory>
             <large-messages-directory>/mnt/jwh1/jhannah/hornetq/largemessages</large-messages-directory>
             <paging-directory>/mnt/jwh1/jhannah/hornetq/paging</paging-directory>
            
             <!-- Default journal file size is set to 1Mb for faster first boot -->
             <journal-file-size>${hornetq.journal.file.size:1048576}</journal-file-size>

             <!-- Default journal min file is 2, increase for higher average msg rates -->
             <journal-min-files>${hornetq.journal.min.files:2}</journal-min-files>

          <shared-store>true</shared-store>
          <backup>true</backup>

             <connectors>
                <connector name="netty-connector">
                   <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
                   <param key="port" value="5446"/>
                </connector>
             </connectors>

             <!-- Acceptors -->
             <acceptors>
                <acceptor name="netty-acceptor">
                   <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
                   <param key="port" value="5446"/>
                </acceptor>
             </acceptors>

             <!-- Clustering configuration -->
              <broadcast-groups>
            <broadcast-group name="bg-group1">
             <group-address>231.7.7.7</group-address>
             <group-port>9876</group-port>
             <broadcast-period>1000</broadcast-period>
                   <connector-ref>netty-connector</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>60000</refresh-timeout>
            </discovery-group>
          </discovery-groups>

          <cluster-connections>
            <cluster-connection name="my-cluster">
             <address>jms</address>
                   <connector-ref>netty-connector</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>

           

          Backup server hornetq-jms.xml

          <configuration xmlns="urn:hornetq"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

             <!--the connection factory used by the example-->
             <connection-factory name="ConnectionFactory">
                <connectors>
                   <connector-ref connector-name="netty-connector"/>
                </connectors>

                <entries>
                   <entry name="ConnectionFactory"/>
                </entries>
                
                 <ha>true</ha>
                <!-- Pause 1 second between connect attempts -->
                <retry-interval>1000</retry-interval>

                <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to
                implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect
                pause is the same length -->
                <retry-interval-multiplier>1.0</retry-interval-multiplier>

                <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->
                <reconnect-attempts>-1</reconnect-attempts>
             </connection-factory>
            
             <queue name="DLQ">
                <entry name="/queue/DLQ"/>
             </queue>
            
             <queue name="ExpiryQueue">
                <entry name="/queue/ExpiryQueue"/>
             </queue>

             <queue name="RequestQueue">
                <entry name="/queue/RequestQueue"/>
             </queue>
            
             <queue name="PendingQueue">
                <entry name="/queue/PendingQueue"/>
             </queue>

          </configuration>

          • 2. Re: Backup Server 'Unable to announce backup'
            jhannah

            Adding host parameters (ie: <param key="host" value="ip_address"/>) into the connector and acceptor elements resolved the problem.  These don't exist within the examples as they are intended to be run on the same machine.