Este contenido no está disponible en el idioma seleccionado.

Chapter 10. High Availability and Failover


After creating a cluster configuration, you can link broker instances together to form high availability (HA) pairs. An HA pair consists of a master broker that serves client requests, and one or more slave brokers that replace the master if it can no longer communicate with clients.

In AMQ Broker 7, a cluster configuration is required for HA. Broker clusters can consist of either a set of non-HA brokers or HA pairs.

AMQ Broker 7 provides the following HA policies:

Replication
Replication synchronizes the data between the master and slave brokers over the network. With replication, you can enable failback to return control to the master broker when it comes back online after a failure event and allow clients to fail back to it. You can also create HA groups in which multiple master brokers share one or more slave brokers, and colocate slave brokers in the same JVM as the master broker.
Shared Store

Shared store provides a location for the master and slave brokers to share messaging data. Using a shared store is generally preferable, as it offers the following benefits over replication:

  • Performance (shared stores are faster)
  • No split-brain issues
  • Fewer brokers required to maintain quorum (replication requires at least three)

    Like with replication, you can enable failback to return control to the master broker after a failure event and allow clients to fail back to it. You can configure multiple slave brokers for a master broker, and colocate slave brokers.

For more information about HA and failover, see Implementing high availability in Configuring AMQ Broker.

10.1. High Availability and Failover Changes

High availability in AMQ Broker 7 differs from AMQ 6 based on how the master is determined and when the broker connections become active.

In AMQ Broker 7, the master and slave roles are fixed. You specify which broker instance is the master, and the slave only becomes active in certain conditions. In AMQ 6, the master and slave roles were not fixed. Instead, the brokers in an HA pair would compete for a lock, and the winner would become the master.

In AMQ Broker 7, in an HA pair, the slave broker’s acceptors are active even if the broker is inactive. In AMQ 6, the slave broker’s transport connectors did not become active until the broker became active.

10.2. How High Availability is Configured

You configure HA by adding an HA policy configuration to the BROKER_INSTANCE_DIR/etc/broker.xml configuration file of each broker.

Example: HA Pair with Shared Store

The master broker is configured like this. By setting failover-on-shutdown to true, the HA pair will fail over to the slave broker if the master broker is shut down:

<configuration>
  <core>
    ...
    <ha-policy>
       <shared-store>
         <master/>
            <failover-on-shutdown>true</failover-on-shutdown>
       </shared-store>
    </ha-policy>
    ...
  </core>
</configuration>

The slave broker is configured like this. By setting failover-on-shutdown to true, this slave broker will become the master if the current master broker is shut down:

<configuration>
  <core>
    ...
    <ha-policy>
       <shared-store>
          <slave/>
            <failover-on-shutdown>true</failover-on-shutdown>
       </shared-store>
    </ha-policy>
    ...
  </core>
</configuration>

Related Information

For full details on configuring HA policies, see the following topics:

Revised on 2019-05-07 15:52:04 UTC

Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.