同样的配置文件。如果用centos7直接部署emqx5.0.24,那么可以进行集群部署。
如果用docker部署,那么会找不到节点。
配置文件:
node {
name = “node2@192.168.16.41”
cookie = “emqxsecretcookie”
data_dir = “data”
}
log {
file_handlers.default {
level = warning
file = “log/emqx.log”
}
}
cluster {
name = emqxcl
discovery_strategy = manual
discovery_strategy = static
static {
seeds = ["node2@192.168.16.41", "node1@192.168.16.42"]
}
}
docker部署日志:
WARNING: Default (insecure) Erlang cookie is in use.
WARNING: Configure node.cookie in /opt/emqx/etc/emqx.conf or override from environment variable EMQX_NODE__COOKIE
WARNING: NOTE: Use the same cookie for all nodes in the cluster.
EMQX_RPC__PORT_DISCOVERY [rpc.port_discovery]: manual
EMQX_LOG__FILE_HANDLERS__DEFAULT__ENABLE [log.file_handlers.default.enable]: false
EMQX_LOG__CONSOLE_HANDLER__ENABLE [log.console_handler.enable]: true
EMQX_NODE__NAME [node.name]: emqx@172.17.0.2
Listener ssl:default on 0.0.0.0:8883 started.
Listener tcp:default on 0.0.0.0:1883 started.
Listener ws:default on 0.0.0.0:8083 started.
Listener wss:default on 0.0.0.0:8084 started.
Listener http:dashboard on :18083 started.
EMQX 5.0.24 is running now!
2023-06-06T06:43:29.868286+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘node2@192.168.16.41’,‘node1@192.168.16.42’]
2023-06-06T06:43:36.067900+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘node2@192.168.16.41’,‘node1@192.168.16.42’]