emqx在k8s容器内启动失败

错误报告

WARNING: Using libs from ‘/opt/emqx/dynlibs’ due to missing from the OS.

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: Use the same config value for all nodes in the cluster.

EMQX_LOG__FILE_HANDLERS__DEFAULT__ENABLE [log.file_handlers.default.enable]: false

EMQX_LOG__CONSOLE_HANDLER__ENABLE [log.console_handler.enable]: true

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.16 is running now!

2023-02-14T04:57:23.394231+00:00 [error] args: [‘emqx@127.0.0.1’], format: ~n** Cannot get connection id for node ~w~n, label: {error_logger,error_msg}

2023-02-14T04:57:30.394975+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘emqx@message-emqx-svc-0.message-emqx-svc.basics-tenant-message.svc.cluster.local’]

2023-02-14T04:57:37.273965+00:00 [error] args: [‘emqx@127.0.0.1’], format: ~n** Cannot get connection id for node ~w~n, label: {error_logger,error_msg}

2023-02-14T04:57:44.274107+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘emqx@message-emqx-svc-0.message-emqx-svc.basics-tenant-message.svc.cluster.local’]

2023-02-14T04:57:51.769123+00:00 [error] args: [‘emqx@127.0.0.1’], format: ~n** Cannot get connection id for node ~w~n, label: {error_logger,error_msg}

2023-02-14T04:57:58.769955+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘emqx@message-emqx-svc-0.message-emqx-svc.basics-tenant-message.svc.cluster.local’]

2023-02-14T04:58:04.836189+00:00 [error] args: [‘emqx@127.0.0.1’], format: ~n** Cannot get connection id for node ~w~n, label: {error_logger,error_msg}

2023-02-14T04:58:11.837062+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘emqx@message-emqx-svc-0.message-emqx-svc.basics-tenant-message.svc.cluster.local’]

2023-02-14T04:58:17.810177+00:00 [error] args: [‘emqx@127.0.0.1’], format: ~n** Cannot get connection id for node ~w~n, label: {error_logger,error_msg}

  • EMQX 版本:5.0.16
  • 操作系统版本:cenos7.9

关键配置:
node {
cookie = “emqxsecretcookie”
data_dir = “data”
process_limit = 2097152
max_ports = 1048576
}

log {
file_handlers.default {
level = info
file = “log/emqx.log”
enable = true
}
}

cluster {
discovery_strategy = dns
dns {
name = “message-emqx-svc.basics-tenant-message.svc.cluster.local”
record_type = srv
}
}

listeners.tcp.default {
bind = “0.0.0.0:1883”
max_connections = 1024000
acceptors = 64
}

重现此问题的步骤

  1. xxx
  2. xxx
  3. xxx

预期行为

实际行为


功能请求

描述你需要的功能

为什么你需要这个功能


其他

2023-02-14T04:57:44.274107+00:00 [warning] Ekka(AutoCluster): discovered nodes outside cluster: [‘emqx@message-emqx-svc-0.message-emqx-svc.basics-tenant-message.svc.cluster.local’]

这个报错是因为发现的节点中有部分节点网络不通,你可以检查下网络或者是你的 DNS 记录设置。

目前是创建了有一个有状态服务,只有有一个实例,集群的发现策略是dns,是我的配置有什么问题吗?不清楚集群发现策略是dns时,node.name应该怎么配置?两者之间会相互影响吗?

2023-02-14T08:35:24.616258+00:00 [error] args: [‘emqx@127.0.0.1’], format: ~n** Cannot get connection id for node ~w~n, label: {error_logger,error_msg}
这个错误日志是什么意思?

这个在 5.0.17 中修复了。

关于DNS配置问题强烈推荐使用GitHub - emqx/emqx-operator: A Kubernetes Operator for EMQX

我们现在使用的k8s版本过低,没法使用operator