基于docker swarm模式在一台主机上部署了拥有两个节点的emqx伪集群,节点启动成功,但集群节点间心跳检测失败

EMQX 版本

EMQX 5.7.2

EMQX 安装部署方式

基于docker swarm模式在一台主机上部署了拥有两个节点的emqx伪集群,节点启动成功,但集群节点间心跳检测失败

报什么错,有日志么

Node ‘emqA@photoframe-emqx-node1’ not responding to pings.

[root@iZ0xiitmphpxjiek7z1aybZ docker]# docker service logs photoframe-emqx-cluster_photoframe-emqx-node1
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_RPC__PORT_DISCOVERY [rpc.port_discovery]: manual
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_CLUSTER__STATIC__SEEDS [cluster.static.seeds]: […]
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_CLUSTER__STATIC__SEEDS [cluster.static.seeds.2]: emqxB@photoframe-emqx-node2
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_CLUSTER__STATIC__SEEDS [cluster.static.seeds.1]: emqxA@photoframe-emqx-node1
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_CLUSTER__DISCOVERY_STRATEGY [cluster.discovery_strategy]: static
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_NODE__COOKIE [node.cookie]: ******
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX_NODE__NAME [node.name]: emqxA@photoframe-emqx-node1
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | Listener tcp:default on 0.0.0.0:1883 started.
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | Listener ssl:default on 0.0.0.0:8883 started.
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | Listener ws:default on 0.0.0.0:8083 started.
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | Listener wss:default on 0.0.0.0:8084 started.
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | Listener http:dashboard on :18083 started.
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | EMQX 5.7.2 is running now!
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | 2025-03-24T09:43:08.333282+08:00 [error] ** System running to use fully qualified hostnames **, ** Hostname photoframe-emqx-node2 is illegal **
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | 2025-03-24T09:43:14.791797+08:00 [error] ** System running to use fully qualified hostnames **, ** Hostname photoframe-emqx-node2 is illegal **
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | 2025-03-24T09:43:20.360789+08:00 [error] ** System running to use fully qualified hostnames **, ** Hostname photoframe-emqx-node2 is illegal **
photoframe-emqx-cluster_photoframe-emqx-node1.1.shymio2a2khb@iZ0xi0wb3y2v8lu1ph4bdhZ | 2025-03-24T09:43:27.359882+08:00 [error] ** System running to use fully qualified hostnames **, ** Hostname photoframe-emqx-node2 is illegal **

不要这样用hostname,命名节点,要符合 full qualified hostname 可以参考一下 https://docker.emqx.dev/
这个里面的方法

好的,我重新试下

集群部署完成后通过命令查询集群状态正常,但访问后台管理只能看到一个节点,[root@iZ0xifs8o9t2pk69wlxng4Z docker]# docker exec -it b4b87568a882 sh -c “emqx_ctl cluster status”
Cluster status: #{running_nodes => [‘emqxB@docker.emqx.node2’],
stopped_nodes => }

看看你的 cluster 配置:
emqx_ctl conf show cluster

你这个是不正常,只有一个节点。

嗯嗯,已经检查发现了,谢谢提醒