Steps to make an existing JNDI HornetQ service as HA? Ask Question

Steps to make an existing JNDI HornetQ service as HA? Ask Question

TL;DR

What are the steps to configure a HA-JNDI service with a HornetQ setup? I believe the documentation is a little scattered. I have read through the docs here but doesn't seem to illustrate in detail.

Longer version:

So we have a HornetQ JMS setup along with JNDI. We have say 5 servers, that run the HornetQ JMS primary instance with JNDI service on each. On each of these 5 servers, we also have a secondary instance running for some other HornetQ primary instance.

To illustrate:

Server A - HornetQa_primary, JNDI, HornetQb_secondary
Server B - HornetQb_primary, JNDI, HornetQc_secondary
Server C - HornetQc_primary, JNDI, HornetQd_secondary
Server D - HornetQd_primary, JNDI, HornetQe_secondary
Server E - HornetQe_primary, JNDI, HornetQa_secondary

Each of these HornetQ servers serve as middleware for our various backend needs, so that means 5 servers, 5 HornetQ primary instances, 5 HornetQ secondary instances and 5 JNDI servers. The problem, however, with this setup is that if a server host (not just the process, the host itself), say A goes down, ideally the service should fallback to the HornetQ running on server E which hosts A's HornetQ secondary. However, to resume as HornetQ primary, the HornetQa_secondary needs to talk to the JNDI process running on server A (I presume to replicate messages). Since the host A is itself down, the HornetQa_secondary running on E has no way to talk to the JNDI on A, and thus, cannot resume as the primary process.

Had the JNDI service been highly available, the secondary HornetQ process could resume as primary as expected. Can anyone point to the docs or illustrate in simple steps how we could convert our existing setup to a HA-JNDI? For what it's worth, I have read multiple sources, but it doesn't seem to illustrate in much detail about how to get going with configuring a HA-JNDI. Please let me know if you need more info about our current setup.

ベストアンサー1

With the architecture described it seems difficult to me, because indeed you need to reconfigure the slave as master and then you will have a certain outage.

HornetQ HA はライブ バックアップ ペアを通じて提供され、負荷分散はクラスターを通じて提供されます。

HA と負荷分散の両方が必要な場合は、2 つのライブ バックアップ ペアをクラスター化する必要があります。

ソース:https://developer.jboss.org/thread/254232

マスターをホスト名ではなく、仮想IPアドレスマスターがダウンした場合には、スレーブの 1 つをマスターとして再設定し、仮想 IP を起動して、残りのスレーブを再設定する必要がないようにすることができます。(マスターがダウンした場合でも HA を維持するには、スレーブを 2 つ用意して、そのうちの 1 つをマスターとして再起動しても、1 つは引き続き実行されるようにする必要があります)。

同じ結果を得るための別の方法は、マスターに固有の DNS ホスト名を使用して、1 つのホストがダウンした場合に別の IP を指すように再構成することです。DNS はキャッシュされるため、このエントリは 'hosts' ファイルにある方が適切です。

HA ドメインあたり 3 台のホストがハードウェアとして多すぎる場合は、追加のハードウェアを購入することなく、仮想サーバーを使用することでこれを簡単に実現できます。

おすすめ記事