正确地从集群中注销imq代理

时间:2011-07-11 14:53:04

标签: connection glassfish openmq

我目前正在尝试管理一个openmq集群(使用glassfish 3.0.1),我遇到了一些奇怪的行为。

集群工作了7个月,现在注册了2个经纪人没有任何问题。

我现在需要暂时在群集中添加另外两个代理。以下是我以前的情况:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

Cluster ID                    MyCluster
Cluster is Highly Available   true

-------------------------------------------------------------------------------------------------------------
                                                                          ID of broker       Time since last 
 Broker ID         Address               State         Msgs in store   performing takeover   status timestamp
-------------------------------------------------------------------------------------------------------------
Broker1         192.168.0.1:7676    OPERATING           5                                     6 seconds
Broker2         192.168.0.2:7676    OPERATING           8                                     6 seconds

然后,我在另外两台服务器上成功启动了另外两个代理,我得到了:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

Cluster ID                    MyCluster
Cluster is Highly Available   true

-------------------------------------------------------------------------------------------------------------
                                                                          ID of broker       Time since last 
 Broker ID         Address               State         Msgs in store   performing takeover   status timestamp
-------------------------------------------------------------------------------------------------------------
Broker1         192.168.0.1:7676    OPERATING           5                                     6 seconds
Broker2         192.168.0.2:7676    OPERATING           8                                     6 seconds
Broker3         192.168.0.3:7676    OPERATING           5                                     6 seconds
Broker4         192.168.0.4:7676    OPERATING           8                                     6 seconds

应用程序运行良好,配置自动使用两个新的代理。使用以下命令从集群停止代理时会发生此问题:

./imqcmd shutdown bkr

在其中一台服务器上。 ./imqcmd list bkr的结果如下:

-------------------------
Host         Primary Port
-------------------------
localhost    7676

Cluster ID                    MyCluster
Cluster is Highly Available   true

-------------------------------------------------------------------------------------------------------------
                                                                          ID of broker       Time since last 
 Broker ID         Address               State         Msgs in store   performing takeover   status timestamp
-------------------------------------------------------------------------------------------------------------
Broker1         192.168.0.1:7676    OPERATING           5                                     6 seconds
Broker2         192.168.0.2:7676    OPERATING           8                                     6 seconds
Broker3         192.168.0.3:7676    TAKEOVER_COMPLETE   0                 Broker1             6 seconds
Broker4         192.168.0.4:7676    OPERATING           8                                     6 seconds

一切似乎都没问题,接管是由Broker1执行的,但是当我查看glassfish的server.log时,我发现了以下行:

[C4003]: Error occurred on connection creation [192.168.0.3:7676]. - cause: java.net.ConnectException: Connection refused|#]

就像玻璃鱼试图连接到倒下的经纪人一样。

我错过了什么吗?

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

缺少的命令行是:

imqdbmgr remove bkr -n Broker3
then a list will ouput:

-------------------------------------------------------------------------------------------------------------
                                                                          ID of broker       Time since last 
 Broker ID         Address               State         Msgs in store   performing takeover   status timestamp
-------------------------------------------------------------------------------------------------------------
Broker1         192.168.0.1:7676    OPERATING           5                                     6 seconds
Broker2         192.168.0.2:7676    OPERATING           8                                     6 seconds
Broker4         192.168.0.4:7676    OPERATING           8                                     6 seconds

Broker3不再在代理HA集群中注册。