UPDATE
多播地址
是我搞错了。感谢 @heeejianbo 科普
阿里云 ec2 不支持多播
https://help.aliyun.com/document_detail/25412.html?source=5176.11533457&userCode=r3yteowb&type=copy
算是一个小坑, 给后来人看一眼
环境信息
- EMQX 版本:5.0.3
- 操作系统及版本:Debian11
- 其他
问题描述
按照官方文档 ,尝试用 mcast
方式建立集群
配置文件及日志
先不考虑脑裂等问题,假设两个节点
- a, ip: 10.2.24.1
- b, ip: 10.2.8.4
cluster 配置部分
节点 a
cluster {
name = emqx
discovery_strategy = mcast
mcast {
addr = "10.2.24.1"
ports = [4369, 4370]
iface = "0.0.0.0"
ttl = 255
loop = true
}
}
节点 b
cluster {
name = emqx
discovery_strategy = mcast
mcast {
addr = "10.2.8.4"
ports = [4369, 4370]
iface = "0.0.0.0"
ttl = 255
loop = true
}
}
分别修改配置之后,重启服务,使用 emqx_ctl cluster staus
查看,各自节点上只能查到自己,并未形成集群
日志部分
打开 debug
日志
2022-08-25T15:53:32.570859+08:00 [info] Ekka(AutoCluster): all discovered nodes already in cluster; ignoring
2022-08-25T15:53:32.570953+08:00 [debug] Ekka(AutoCluster): join result: ignore
2022-08-25T15:53:32.571004+08:00 [info] Ekka(AutoCluster): no discovered nodes outside cluster
2022-08-25T15:53:35.571737+08:00 [warning] Ekka(AutoCluster): discovery did not succeed; retrying in 5000 ms
2022-08-25T15:53:43.801819+08:00 [info] Ekka(AutoCluster): all discovered nodes already in cluster; ignoring
2022-08-25T15:53:43.801902+08:00 [debug] Ekka(AutoCluster): join result: ignore
2022-08-25T15:53:43.801999+08:00 [info] Ekka(AutoCluster): no discovered nodes outside cluster
2022-08-25T15:53:46.802704+08:00 [warning] Ekka(AutoCluster): discovery did not succeed; retrying in 5000 ms
其他信息
从 b
探测 a
的两个端口 4369, 4370 ,都是打开的
root@tsing-int-devsrv-mqtt-edge-3:/var/log/emqx# nc -vuz 10.2.24.1 4369
10.2.24.1: inverse host lookup failed: Unknown host
(UNKNOWN) [10.2.24.1] 4369 (?) open
root@tsing-int-devsrv-mqtt-edge-3:/var/log/emqx# nc -vtz 10.2.24.1 4370
10.2.24.1: inverse host lookup failed: Unknown host
(UNKNOWN) [10.2.24.1] 4370 (?) open