<p>I am new to RabbitMQ and I have troubles when handling RabbitMQ cluster.</p>

<p>The topology is like:</p>

<p><a href="https://i.stack.imgur.com/srHSW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/srHSW.png" alt="enter image description here"></a></p>

<p>At first, every is ok. RabbitMQ node1 and RabbitMQ node2 are in a cluster.
They are interconnected by a RabbitMQ plugin called autocluster.</p>

<p>Then I delete pod rabbitmq-1 by <code>kubectl delete pod rabbitmq-1</code>. And I found that RabbitMQ application in node1 is stopped. I don't understand why RabbittoMQ will stop application if it detects another node's failure. It does not make sense. Is this behaviour designed by RabbitMQ or autocluster? Can you enlighten me?</p>

<p>My config is like:</p>

<pre><code>[
  {rabbit, [
    {tcp_listen_options, [
                          {backlog,       128},
                          {nodelay,       true},
                          {linger,        {true,0}},
                          {exit_on_close, false},
                          {sndbuf,        12000},
                          {recbuf,        12000}
                         ]},
    {loopback_users, [&lt;&lt;"guest"&gt;&gt;]},
    {log_levels,[{autocluster, debug}, {connection, debug}]},
    {cluster_partition_handling, pause_minority},
    {vm_memory_high_watermark, {absolute, "3276MiB"}}
  ]},

  {rabbitmq_management, [
    {load_definitions, "/etc/rabbitmq/rabbitmq-definitions.json"}
  ]},

  {autocluster, [
    {dummy_param_without_comma, true},
    {autocluster_log_level, debug},
    {backend, etcd},
    {autocluster_failure, ignore},
    {cleanup_interval, 30},
    {cluster_cleanup, false},
    {cleanup_warn_only, false},
    {etcd_ttl, 30},
    {etcd_scheme, http},
    {etcd_host, "etcd.kube-system.svc.cluster.local"},
    {etcd_port, 2379}
   ]}
]
</code></pre>

<p>In my case, x-ha-policy is enabled.</p>

<p>You set <code>cluster_partition_handling</code> to <code>pause_minority</code>. One out of two nodes isn't the majority, so the cluster stops as configured. You either have to add an additional node or set <code>cluster_partition_handling</code> to <code>ignore</code>.</p>

<p>From the <a href="https://www.rabbitmq.com/partitions.html" rel="nofollow noreferrer">docs</a>:</p>

<blockquote>
  <p>In pause-minority mode RabbitMQ will automatically pause cluster nodes
  which determine themselves to be in a minority (i.e. fewer or equal
  than half the total number of nodes) after seeing other nodes go down.
  It therefore chooses partition tolerance over availability from the
  CAP theorem. This ensures that in the event of a network partition, at
  most the nodes in a single partition will continue to run. The
  minority nodes will pause as soon as a partition starts, and will
  start again when the partition ends.</p>
</blockquote>
