0
votes

I have three "replication" mode servers, one is master the two are slaves.

Master has "check-for-live-server" enabled. The slave has "allow-failback" enabled.

Failover works fine, but when the master is available again, after waiting for at least 5 minutes, the slave still does not do the auto-failback.

Here are the HA settings below.

Master (192.168.102.55) broker.xml:

    <connectors>
        <connector name="netty-connector">tcp://192.168.102.55:61616</connector>
    </connectors>

    <acceptors>
        <acceptor name="netty-acceptor">tcp://192.168.102.55:61616</acceptor>
    </acceptors>

    <cluster-user>user</cluster-user>
      <cluster-password>password</cluster-password>

      <broadcast-groups>
         <broadcast-group name="bg-group">
            <group-address>231.7.7.7</group-address>
            <group-port>9876</group-port>
            <broadcast-period>5000</broadcast-period>
            <connector-ref>netty-connector</connector-ref>
         </broadcast-group>
      </broadcast-groups>

      <discovery-groups>
         <discovery-group name="dg-group">
            <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">
            <connector-ref>netty-connector</connector-ref>
            <message-load-balancing>ON_DEMAND</message-load-balancing>
            <max-hops>2</max-hops>
            <discovery-group-ref discovery-group-name="dg-group"/>
         </cluster-connection>
      </cluster-connections>

      <ha-policy>
         <replication>
            <master>
                <check-for-live-server>true</check-for-live-server>
            </master>
         </replication>
      </ha-policy>

Slave (192.168.102.53) broker.xml:

    <connectors>
        <connector name="netty-connector">tcp://192.168.102.53:61616</connector>
    </connectors>

    <acceptors>
        <acceptor name="netty-acceptor">tcp://192.168.102.53:61616</acceptor>
    </acceptors>

    <cluster-user>user</cluster-user>
    <cluster-password>password</cluster-password>

     <broadcast-groups>
         <broadcast-group name="bg-group">
            <group-address>231.7.7.7</group-address>
            <group-port>9876</group-port>
            <broadcast-period>5000</broadcast-period>
            <connector-ref>netty-connector</connector-ref>
         </broadcast-group>
      </broadcast-groups>

      <discovery-groups>
         <discovery-group name="dg-group">
            <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">
            <connector-ref>netty-connector</connector-ref>
            <message-load-balancing>ON_DEMAND</message-load-balancing>
            <max-hops>2</max-hops>
            <discovery-group-ref discovery-group-name="dg-group"/>
         </cluster-connection>
      </cluster-connections>

      <ha-policy>
         <replication>
            <slave>
                <allow-failback>true</allow-failback>
            </slave>
         </replication>
      </ha-policy>

The Artemis version I used is 2.11.0. Does anyone know what I possibly could do wrong?

1

1 Answers

1
votes

Fail-back only works for a live/backup pair. It doesn't work for a live/backup/backup triplet.

In your use-case there are 3 broker instances - one which is live and 2 that are backups. However, a backup server is owned by only one live server. This means that when the 3 broker instances are started there will be 1 live-backup pair and a "left-over" backup which will be in a kind of idle state waiting to attach to a live broker without a backup. Then if the live broker fails the live broker's backup will take over and become live and the other backup will now become the backup of the server which just became live. Once the broker instance which failed is restarted it will attempt to register itself as a backup of the now-live broker and initiate fail-back. However, since the now-live broker already has a backup it will reject the registration message from the original live because it already has a backup, and therefore fail-back will not occur.

To be clear, a live can only replicate to a single backup at a time. It's not really clear to me what benefit multiple backups provide given the fact that they prevent fail-back from working.