我们面临着 ActiveMQ 的几个问题 - MCollective 负载平衡。有人可以帮忙吗?下面是我们的设置
MCO 在故障转移池中配置了两个 ActiveMQ 代理 - Broker1 和 Broker2。我们在server.cfg
和中将 randomize 属性设置为 true client.cfg
。
Broker1 & Broker2 共同组成一个activemq集群。它们还具有updateClientCluster
和 rebalanceClientCluster
属性设置为true
(在两个 activemq 代理上设置)。
问题 1: MCO 客户端在 broker1 和 broker2 之间的负载平衡和连接不均等。700 个 MCO 连接到 Broker1,而只有 100 个 MCO 连接到 broker2。我们是否缺少此负载平衡的任何属性?
问题 2:当我们向 activemq 集群添加新代理时,例如 broker3,MCO 客户端没有重新平衡或连接到新代理。根据 activemq 文档,如果我们启用 updateClientCluster 和 rebalanceClientCluster 属性,它应该会自动通知 MCO 重新平衡。你能告诉我们任何属性吗?
附加activemq.xml
,server.cfg
和client.cfg
.
活动MQ.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>
服务器配置文件
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
客户端.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