0 Replies Latest reply on May 11, 2014 5:59 AM by Yair Ogen

    Replication FailOver not working

    Yair Ogen Expert

      I am trying to check out the replication mode. I see that if I create the SessionFactory with only the primary IP and in the middle of working with it I kill it the secondary doesn't take over and I see client errors in my client log. Doesn't look like it is switching to the replicated. If I add both IP's to my session factory I see it behave like a regular cluster and not as a Promary/Backup - I.e. both server get consumer producer connections. What am I missing? Both files are located in /config/stand-alone/clustered. I run the server using: ./run.sh ../config/stand-alone/clustered.

       

      primary config:

      <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>
      
      
         <connectors>      
            
         <connector name="netty">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${hornetq.remoting.netty.host:10.45.37.122}"/>
               <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:10.45.37.122}"/>
               <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.45.37.122}"/>
               <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:10.45.37.122}"/>
               <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>
      
      
         <shared-store>false</shared-store>
         
         <cluster-connections>
            <cluster-connection name="my-cluster">
               <address>foundation</address>  
               <connector-ref>netty</connector-ref>
            <discovery-group-ref discovery-group-name="dg-group1"/>
        <!-- 
        <static-connectors>
            <connector-ref>netty</connector-ref>
            <connector-ref>netty-2</connector-ref>
         </static-connectors>
         -->
            </cluster-connection>
         </cluster-connections>
         
         <security-enabled>false</security-enabled>
         
         <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 config:

       

      <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>
      
      
         <connectors>      
            
         <connector name="netty">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${hornetq.remoting.netty.host:10.45.37.123}"/>
               <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
            </connector>
         <connector name="netty-2">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${hornetq.remoting.netty.host:10.45.37.123}"/>
               <param key="port"  value="${hornetq.remoting.netty.port:6445}"/>
            </connector>
            
            <connector name="netty-throughput">
               <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
               <param key="host"  value="${hornetq.remoting.netty.host:10.45.37.123}"/>
               <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.45.37.123}"/>
               <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:10.45.37.123}"/>
               <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>
      
      
         <shared-store>false</shared-store>
      
      
         <backup>true</backup>
         
         <cluster-connections>
            <cluster-connection name="my-cluster">
               <address>foundation</address>  
               <connector-ref>netty</connector-ref>
            <discovery-group-ref discovery-group-name="dg-group1"/>
        <!-- 
        <static-connectors>
            <connector-ref>netty</connector-ref>
            <connector-ref>netty-2</connector-ref>
         </static-connectors>
         -->
            </cluster-connection>
         </cluster-connections>
         
         <security-enabled>false</security-enabled>
         
         <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>