2 Replies Latest reply on Aug 3, 2012 9:57 AM by jbertram

    Problem with client automatic failover. standalones, shared-store

    zont

      Hi All,

       

      I don’t really understand what to do to have the client automatically to failover. Unfortunately the user manual doesn’t describe it well enough for me and the shipped examples don’t help me as well.

       

      I have one live-backup-pair using shared store. The servers are standalone of the version 2.2.14.

       

      The configuration of both servers seems to be correct, because I can start them and the backup server announces its status. Killing the live server starts up the backup.

       

      The client connects to the live server, but after it goes down and the backup starts up, the client is not able to failover to backup. I am sure the client knows nothing about backup, but how to configure it, I couldn’t find any clear information.

       

       

      Connecting to the live server by:

      -----------------------

      Hashtable<String, String> env = new Hashtable<String, String>();

      env.put(Context.PROVIDER_URL, textFieldHost.getText());               

      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

      ctx = new InitialContext(env);

      ConnectionFactory cf = (ConnectionFactory)ctx.lookup("/ConnectionFactory");

       

       

      connection = cf.createConnection();

      session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);

       

      -------------------------

       

       

      hornetq-configuration of the live is:

      ------------------

       

      <configuration xmlns="urn:hornetq"

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

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

                 

      <message-counter-enabled>true</message-counter-enabled>                                                 

      <management-address>jms.queue.hornetq.management</management-address> 

      <management-notification-address>jms.queue.notificationsQueue</management-notification-address>          

      <clustered>true</clustered>

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

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

       

      <paging-directory>../shared-store/paging</paging-directory>

      <bindings-directory>../shared-store/bindings</bindings-directory>

      <journal-directory>../shared-store/journal</journal-directory>  

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

      <large-messages-directory>../shared-store/large-messages</large-messages-directory>

       

      …and more standard stuff including cluster configuration

      -----------------------------

       

       

       

       

      hornetq-jms.xml of live is:

      ------------------------------

      <connection-factory name="NettyConnectionFactory">

            <xa>false</xa>

      <ha>true</ha>

            <connectors>

               <connector-ref connector-name="netty"/>

            </connectors>

            <entries>

               <entry name="/ConnectionFactory"/>

            </entries>

      <client-failure-check-period>5000</client-failure-check-period>

      <connection-ttl>60000</connection-ttl>

      <retry-interval>1000</retry-interval>

      <retry-interval-multiplier>1</retry-interval-multiplier>

      <reconnect-attempts>-1</reconnect-attempts>

      </connection-factory>

      -----------------------------

       

      The configuration of backup is the same plus <backup>true</backup>

       

      So, how to make the client to failover automatically?

       

      Thank you.