ITコンサルの日常

ITコンサル会社に勤務する普通のITエンジニアの日常です。

HornetQでクラスタ構成にしたとき、HQ212034が出続ける場合の対処法

事象

下記のように、HQ212034のワーニングメッセージが繰り返し表示される。下記の通り、1回だけ表示されるなら無視してよいが、繰り返し表示される場合は問題がある。

20:59:08,455 WARN  [org.hornetq.core.client] HQ212034: There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node. nodeID=7bd67d54-4603-11e7-b22d-3906e90608b0
20:59:11,493 WARN  [org.hornetq.core.client] HQ212034: There are more than one servers on the network broadcasting the same node id. You will see this message exactly once (per node) if a node is restarted, in which case it can be safely ignored. But if it is logged continuously it means you really do have more than one node on the same network active concurrently with the same node id. This could occur if you have a backup node active at the same time as its live node. nodeID=7bd67d54-4603-11e7-b22d-3906e90608b0
...

原因

data/journal以下のファイルをコピペしたのが問題。

standaloneで動作させたHornetQのフォルダをコピーして、HornetQA、HornetQBの2つを作った際、不要なjournalファイルもコピーされてしまった。

対策

data/journal以下のファイルを全て削除する。

うまくいくと下記のようにコンソールに表示されます。

...
21:02:41,447 INFO  [org.hornetq.core.server] HQ221007: Server is now live
21:02:41,448 INFO  [org.hornetq.core.server] HQ221001: HornetQ Server version 2.5.0.SNAPSHOT (Wild Hornet, 124) [36142974-46c2-11e7-9e68-d926168704eb]
21:02:41,606 INFO  [org.hornetq.core.server] HQ221027: Bridge ClusterConnectionBridge@7fccef71 [name=sf.my-cluster.33add7f4-46c2-11e7-8de4-b158f74a0e2a, queue=QueueImpl[name=sf.my-cluster.33add7f4-46c2-11e7-8de4-b158f74a0e2a, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=36142974-46c2-11e7-9e68-d926168704eb]]@5556b4bd targetConnector=ServerLocatorImpl (identity=(Cluster-connection-bridge::ClusterConnectionBridge@7fccef71 [name=sf.my-cluster.33add7f4-46c2-11e7-8de4-b158f74a0e2a, queue=QueueImpl[name=sf.my-cluster.33add7f4-46c2-11e7-8de4-b158f74a0e2a, postOffice=PostOfficeImpl [server=HornetQServerImpl::serverUUID=36142974-46c2-11e7-9e68-d926168704eb]]@5556b4bd targetConnector=ServerLocatorImpl [initialConnectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=localhost], discoveryGroupConfiguration=null]]::ClusterConnectionImpl@263833514[nodeUUID=36142974-46c2-11e7-9e68-d926168704eb, connector=TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=6445&host=localhost, address=jms, server=HornetQServerImpl::serverUUID=36142974-46c2-11e7-9e68-d926168704eb])) [initialConnectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ?port=5445&host=localhost], discoveryGroupConfiguration=null]] is connected