5.8.6版本如何开启会话持久化功能?

在emqx.conf配置文件中,新增了如下代码配置:
durable_sessions {
enable = true
}

重启后失败,报如下错误:

搞点emqx的日志看看

在/var/log/emqx/emqx.log.1查看的所有日志,看不出来啥,看着跟持久化相关的没有

2025-04-25T15:43:57.253294+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:52628, reason: bad_username_or_password
2025-04-25T15:44:01.947505+08:00 [warning] msg: log_events_throttled_during_last_period, dropped: #{authentication_failure => 2}, period: 1 minutes, 0 seconds
2025-04-25T15:44:04.386156+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:52631, reason: bad_username_or_password
2025-04-25T15:46:45.097684+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:52656, reason: bad_username_or_password
2025-04-25T15:55:33.137635+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:52987, reason: bad_username_or_password
2025-04-25T15:56:01.959315+08:00 [warning] msg: log_events_throttled_during_last_period, dropped: #{authentication_failure => 1}, period: 1 minutes, 0 seconds
2025-04-25T16:55:26.940906+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:55422, reason: bad_username_or_password
2025-04-25T16:56:30.485153+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:55434, reason: bad_username_or_password
2025-04-25T16:57:24.788832+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:55451, reason: bad_username_or_password
2025-04-25T16:57:54.535845+08:00 [warning] tag: AUTHN, clientid: server_mqtt_sub_device, msg: authentication_failure, peername: 114.254.35.19:55457, reason: bad_username_or_password

先不要用systemd启动,用emqx console启动看看报什么错

2025-04-25T19:28:21.081127+08:00 [error] failed_to_check_schema: emqx_conf_schema
2025-04-25T19:28:21.086458+08:00 [error] #{reason => integrity_validation_failure,result => {error,<<“cluster discovery strategy must be ‘singleton’ when durable storage backend is ‘builtin_local’”>>},kind => validation_error,validation_name => validate_durable_sessions_strategy}
ERROR: call_hocon_failed: -v -t 2025.04.25.19.28.20 -s emqx_conf_schema -c /etc/emqx/base.hocon -c /var/lib/emqx/configs/cluster.hocon -c /etc/emqx/emqx.conf -d /var/lib/emqx/configs generate

持久化的集群功能是企业版功能,你开不动。单个节点就行。你改一下cluster strategy 变成singleton

cluster {
name = emqxcl
discovery_strategy = singleton
}

是这样就可以吗?这样改完就开启会话持久化了吗?

已解决