<p>I am deploying a simple master/slave replication configuration within Kubernetes environment. They use static connectors. When I delete the master pod the slave successfully takes over duties, but when the master pod comes back up the slave pod does not terminate as live so I end up with two live servers. When this happens I notice they also form an internal bridge. I've ran the exact same configurations locally, outside of Kubernetes, and the slave successfully terminates and goes back to being a slave when the master comes back up. Any ideas as to why this is happening? I am using Artemis version 2.6.4.</p>

<p>master <code>broker.xml</code>:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd"&gt;
  &lt;jms xmlns="urn:activemq:jms"&gt;
    &lt;queue name="jms.queue.acmadapter_to_acm_design"&gt;
      &lt;durable&gt;true&lt;/durable&gt;
    &lt;/queue&gt;
  &lt;/jms&gt;
  &lt;core xmlns="urn:activemq:core" xsi:schemaLocation="urn:activemq:core "&gt;
    &lt;acceptors&gt;
      &lt;acceptor name="netty-acceptor"&gt;tcp://0.0.0.0:61618&lt;/acceptor&gt;
    &lt;/acceptors&gt;
    &lt;connectors&gt;
      &lt;connector name="netty-connector-master"&gt;tcp://artemis-service-0.artemis-service.falconx.svc.cluster.local:61618&lt;/connector&gt;
      &lt;connector name="netty-connector-backup"&gt;tcp://artemis-service2-0.artemis-service.falconx.svc.cluster.local:61618&lt;/connector&gt;
    &lt;/connectors&gt;
    &lt;ha-policy&gt;
      &lt;replication&gt;
        &lt;master&gt;
           &lt;!--we need this for auto failback--&gt;
           &lt;check-for-live-server&gt;true&lt;/check-for-live-server&gt;
        &lt;/master&gt;
      &lt;/replication&gt;
    &lt;/ha-policy&gt;
    &lt;cluster-connections&gt;
      &lt;cluster-connection name="my-cluster"&gt;
          &lt;connector-ref&gt;netty-connector-master&lt;/connector-ref&gt;
          &lt;static-connectors&gt;
            &lt;connector-ref&gt;netty-connector-master&lt;/connector-ref&gt;
            &lt;connector-ref&gt;netty-connector-backup&lt;/connector-ref&gt;
          &lt;/static-connectors&gt;
      &lt;/cluster-connection&gt;
    &lt;/cluster-connections&gt;
  &lt;/core&gt;
&lt;/configuration&gt;
</code></pre>

<p>slave <code>broker.xml</code>:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;configuration xmlns="urn:activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd"&gt;
  &lt;core xmlns="urn:activemq:core" xsi:schemaLocation="urn:activemq:core "&gt;
    &lt;acceptors&gt;
      &lt;acceptor name="netty-acceptor"&gt;tcp://0.0.0.0:61618&lt;/acceptor&gt;
    &lt;/acceptors&gt;
    &lt;connectors&gt;
      &lt;connector name="netty-connector-backup"&gt;tcp://artemis-service2-0.artemis-service.test.svc.cluster.local:61618&lt;/connector&gt;
      &lt;connector name="netty-connector-master"&gt;tcp://artemis-service-0.artemis-service.test.svc.cluster.local:61618&lt;/connector&gt;
    &lt;/connectors&gt;
    &lt;ha-policy&gt;
      &lt;replication&gt;
          &lt;slave&gt;
            &lt;allow-failback&gt;true&lt;/allow-failback&gt;
            &lt;!-- not needed but tells the backup not to restart after failback as there will be &gt; 0 backups saved --&gt;
            &lt;max-saved-replicated-journals-size&gt;0&lt;/max-saved-replicated-journals-size&gt;
          &lt;/slave&gt;
      &lt;/replication&gt;
    &lt;/ha-policy&gt;
    &lt;cluster-connections&gt;
      &lt;cluster-connection name="my-cluster"&gt;
          &lt;connector-ref&gt;netty-connector-backup&lt;/connector-ref&gt;
          &lt;static-connectors&gt;
            &lt;connector-ref&gt;netty-connector-master&lt;/connector-ref&gt;
            &lt;connector-ref&gt;netty-connector-backup&lt;/connector-ref&gt;
          &lt;/static-connectors&gt;
      &lt;/cluster-connection&gt;
    &lt;/cluster-connections&gt;
  &lt;/core&gt;
&lt;/configuration&gt;
</code></pre>

user3508309
<p>It's likely that the master's journal is being lost when it is stopped. The journal (specifically the <code>server.lock</code> file) holds the node's unique identifier (which is shared by the replicated slave). If the journal is lost when the node is dropped then it has no way to pair with its slave when it comes back up which would explain the behavior you're observing. Make sure the journal is on a persistent volume claim.</p>

<p>Also, it's worth noting that a single master/slave pair is not recommended due to the risk of split brain. In general, it's recommended that you have 3 master/slave pairs to establish a proper quorum.</p>
