【发布时间】:2016-03-29 11:37:30
【问题描述】:
我有一个负载均衡器,即 aws elb 所有的 pub/sub 都将通过那个 elb elb下的两个蚊子经纪人A和蚊子经纪人B 一个 mosquitto 代理在这两个代理之间同步主题(mosquitto.broker.sync)
试一试
这就是 mosquitto broker 在节点 A 和 B 之间同步主题的配置看起来很相似
mosquitto.broker.sync: ##
connection mosquitto-bridge
try_private false
address mosquitto.broker.A:1883 mosquitto.broker.B:1883
start_type automatic
round_robin true
notifications true
topic # both 2 "" ""
但这不起作用,它只连接到 mosquitto.broker.A 而不是连接到 mosquitto.broker.B
试试两个
全部撤消,先试一试
所以我换一种方式尝试 从 mosquitto.broker.sync 中删除所有网桥配置(只是为了避免循环)
并将此配置添加到节点上
mosquitto.broker.A: ##
connection mosquitto-bridge
try_private false
address mosquitto.broker.sync:1883
start_type automatic
round_robin true
notifications true
topic # both 2 "" ""
mosquitto.broker.B: ##
connection mosquitto-bridge
try_private false
address mosquitto.broker.sync:1883
start_type automatic
round_robin true
notifications true
topic # both 2 "" ""
mosquitto.broker.sync:##
#connection mosquitto-bridge
#try_private false
#address mosquitto.broker.A:1883 mosquitto.broker.B:1883
#start_type automatic
#round_robin true
#notifications true
#topic # both 2 "" ""
但在这种情况下,我发送消息的节点被复制了
【问题讨论】:
-
您能否在第二次尝试中更详细地解释问题,目前尚不完全清楚问题所在。
-
更新问题,答案帮我排序,我都在添加一个虚拟主题