我们面临着ActiveMQ的几个问题 - MCollective负载平衡。有人可以帮忙吗?以下是我们的设置
MCO在故障转移池中配置了两个ActiveMQ代理 - Broker1& Broker2。我们已在server.cfg
和client.cfg
中将randomize属性设置为true。
Broker1& Broker2一起形成activemq集群。他们还将updateClientCluster
和rebalanceClientCluster
属性设置为true
(在两个activemq代理上设置)。
问题1: MCO客户端在broker1和broker2之间的负载平衡和连接不均衡。 700 MCO连接到Broker1,而只有100 MCO连接到broker2。我们是否缺少此负载均衡的任何属性?
问题2:当我们添加新代理时,将broker3称为activemq集群时,MCO客户端不会重新平衡或连接到新代理。根据activemq文档,如果我们启用updateClientCluster和rebalanceClientCluster属性,它应该自动通知MCO重新平衡。能告诉我们任何房产吗?
附加activemq.xml
,server.cfg
和client.cfg
。
activemq.xml中
<transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?jms.prefetchPolicy.all=1000&useQueueForAccept=false&transport.closeAsync=false&maximumConnections=2500&wireFormat.maxFrameSize=104857600&jms.watchTopicAdvisories=false" />
<transportConnector name="stomp+ssl" uri="stomp+nio+ssl://0.0.0.0:61614?useQueueForAccept=false&transport.closeAsync=false&needClientAuth=true&trace=true&maximumConnections=2500&wireFormat.maxFrameSize=104857600&updateClusterClients=true&rebalanceClusterClients=true&updateClusterClientsOnRemove=true" />
</transportConnectors>
SERVER.CFG
loglevel = info
daemonize = 1
# Plugins
securityprovider = psk
plugin.psk = unset
connector = activemq
plugin.activemq.heartbeat_interval = 60
plugin.activemq.pool.size = 2
plugin.activemq.pool.1.host = broker 1
plugin.activemq.pool.1.port = port no.
plugin.activemq.pool.1.user = user
plugin.activemq.pool.1.password = password
plugin.activemq.pool.1.ssl = 1
plugin.activemq.pool.1.ssl.fallback = 0
#classesfile = /var/lib/puppet/state/classes.txt
# Registration:
# We don't configure a listener, and only send these messages to keep the
# Stomp connection alive. This will use the default "agentlist" registration
# plugin.
registerinterval = 600
plugin.activemq.pool.2.host = broker 1
plugin.activemq.pool.2.port = port no.
plugin.activemq.pool.2.user = user
plugin.activemq.pool.2.password = password
plugin.activemq.pool.2.ssl = 1
plugin.activemq.pool.1.ssl.fallback = 0
securityprovider = ssl
rpcauthorization = 1
rpcauthprovider = action_policy
plugin.actionpolicy.allow_unconfigured = 0
plugin.actionpolicy.enable_default = 1
plugin.actionpolicy.default_name = default
\n
plugin.activemq.initial_reconnect_delay = 0.01
plugin.activemq.max_reconnect_delay = 30.0
plugin.activemq.use_exponential_back_off = true
plugin.activemq.back_off_multiplier = 2
plugin.activemq.max_reconnect_attempts = 0
plugin.activemq.randomize = true
plugin.activemq.timeout = -1
client.cfg
main_collective = mcollective
libdir = /etc/mcollective
logger_type = console
loglevel = warn
# Plugins
securityprovider = psk
plugin.psk = unset
connector = activemq
plugin.activemq.heartbeat_interval = 60
plugin.activemq.pool.size = 2
plugin.activemq.pool.1.host = borker 1
plugin.activemq.pool.1.port = port no.
plugin.activemq.pool.1.user = user
plugin.activemq.pool.1.password = password
plugin.activemq.pool.1.ssl = 1
plugin.activemq.pool.1.ssl.fallback = 0
plugin.activemq.pool.1.host = borker 2
plugin.activemq.pool.1.port = port no.
plugin.activemq.pool.1.user = user
plugin.activemq.pool.1.password = password
plugin.activemq.pool.2.ssl = 1
plugin.activemq.pool.2.ssl.fallback = 0
factsource = yaml
securityprovider = ssl
答案 0 :(得分:0)
问题2:您将自动重新平衡设置为URI的一部分,而不是transportConnector的属性。
所以你需要这样的东西:
<transportConnector name="stomp+ssl" uri="stomp+nio+ssl://0.0.0.0:61614?useQueueForAccept=false&transport.closeAsync=false&needClientAuth=true&trace=true&maximumConnections=2500&wireFormat.maxFrameSize=104857600"
updateClusterClients="true"
rebalanceClusterClients="true"
updateClusterClientsOnRemove="true" />
</transportConnectors>
另外知道这只适用于通过一个传输连接器而不是另一个传输连接器连接的客户端,您只能指定一个URI。连接到61616上的tcp传输的任何客户端都不会知道您的Stomp传输上的任何设置。
其他一切看起来都不错,虽然我没有设置任何具有这么多属性的Stomp客户端,所以你可能想要仔细检查它们是否都有效。