2台公网上的docker,想组成一个集群,由于机器特殊,只能开放8000~9000的端口,所以需要修改emqx的各种端口配置,以下是docker的命令
[root@I emqx]# docker run -d --name emqx \
--restart=always \
-p 8370:8370 \
-p 8369:8369 \
-p 8883:8883 \
-p 8884:8884 \
-p 8083:8083 \
-p 8084:8084 \
-p 8783:18083 \
-v /data/emqx/etc:/opt/emqx/etc \
-v /data/emqx/data:/opt/emqx/data \
-v /data/emqx/log:/opt/emqx/log \
-e EMQX_NODE_NAME="nodeB@175.178.160.222" \
-e EMQX_CLUSTER__DISCOVERY_STRATEGY=static \
-e EMQX_CLUSTER__STATIC__SEEDS="[nodeA@111.29.61.111, nodeB@175.178.160.222]" \
emqx/emqx:5.3.0
配置文件
node {
cookie = "xxxxxxxxxxxxxx"
data_dir = "data"
}
cluster {
name = emqxcl
discovery_strategy = static
static {
seeds = ["nodeA@111.29.61.111", "nodeB@175.178.160.222"]
}
}
rpc {
port_discovery = manual
tcp_server_port = 8370
ssl_server_port = 8369
}
listeners.tcp.default {
bind = 8883
}
listeners.ssl.default{
bind = 8884
}
listeners.ws.default{
bind = 8083
}
listeners.wss.default{
bind = 8084
}
dashboard {
listeners.http {
bind = 18083
}
}
运行 emqx ctl status 报错,运行任何命令都报错,是端口还有端口没改吗,还是配置有问题吗
emqx@f735b522126b:/opt/emqx/etc$ emqx ctl status
Node 'nodeB@175.178.160.222' not responding to pings.