EMQ使用阿里的SLB做负载均衡期,设备端经常断连

如果设备直接连接某台EMQ就不会断连,麻烦这是什么问题呢?
看链接日志经常在两台切换


[INFO ]24-10-16 01:26:46【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729013206512,“sockport”:1883,“reason”:“keepalive_timeout”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.35”,“disconnected_at”:1729013206512,“connected_at”:1729007806392,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 01:26:51【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729013211901,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.41”,“expiry_interval”:0,“connected_at”:1729013211901,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 01:29:11【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729013351900,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.41”,“disconnected_at”:1729013351900,“connected_at”:1729013211901,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 01:29:11【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729013351900,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.41”,“expiry_interval”:0,“connected_at”:1729013351900,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 01:31:31【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729013491908,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.41”,“disconnected_at”:1729013491908,“connected_at”:1729013351900,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 01:31:31【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729013491909,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.28”,“expiry_interval”:0,“connected_at”:1729013491909,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 01:35:03【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729013703430,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.28”,“disconnected_at”:1729013703430,“connected_at”:1729013491909,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 01:35:42【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729013742469,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.25”,“expiry_interval”:0,“connected_at”:1729013742469,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 01:39:13【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729013953991,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.25”,“disconnected_at”:1729013953991,“connected_at”:1729013742469,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 01:39:53【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729014013868,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.56”,“expiry_interval”:0,“connected_at”:1729014013868,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 01:42:13【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729014153890,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.56”,“disconnected_at”:1729014153890,“connected_at”:1729014013868,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 01:42:13【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729014133174,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.33”,“expiry_interval”:0,“connected_at”:1729014133174,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 02:02:26【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729015346173,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.33”,“disconnected_at”:1729015346173,“connected_at”:1729014133174,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 02:02:26【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729015346174,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.9”,“expiry_interval”:0,“connected_at”:1729015346174,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 02:13:58【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729016038896,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.9”,“disconnected_at”:1729016038896,“connected_at”:1729015346174,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 02:14:38【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729016078144,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.62”,“expiry_interval”:0,“connected_at”:1729016078144,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 02:26:49【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729016809992,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.62”,“disconnected_at”:1729016809992,“connected_at”:1729016078144,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 02:26:49【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729016830726,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.48”,“expiry_interval”:0,“connected_at”:1729016830726,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 02:52:21【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729018362126,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.48”,“disconnected_at”:1729018362126,“connected_at”:1729016830726,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 02:53:00【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729018380543,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.23”,“expiry_interval”:0,“connected_at”:1729018380543,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 03:56:33【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729022193930,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.23”,“disconnected_at”:1729022193930,“connected_at”:1729018380543,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 03:57:12【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729022253708,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.23”,“expiry_interval”:0,“connected_at”:1729022253708,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 04:22:44【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729023785596,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.23”,“disconnected_at”:1729023785596,“connected_at”:1729022253708,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 04:23:24【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729023804094,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.47”,“expiry_interval”:0,“connected_at”:1729023804094,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 04:25:44【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729023944113,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.47”,“disconnected_at”:1729023944113,“connected_at”:1729023804094,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 04:25:44【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729023944114,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.57”,“expiry_interval”:0,“connected_at”:1729023944113,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 04:28:03【接收消息主题 :$SYS/brokers/emqx@192.168.1.209/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729024083900,“sockport”:1883,“reason”:“discarded”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.57”,“disconnected_at”:1729024083900,“connected_at”:1729023944113,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 04:28:03【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729024104678,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.60”,“expiry_interval”:0,“connected_at”:1729024104678,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 04:53:35【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:““,“ts”:1729025636548,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.60”,“disconnected_at”:1729025636548,“connected_at”:1729024104678,“clientid”:“X1A1100700000007”}】
[INFO ]24-10-16 04:54:14【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/connected接收消息Qos:0接收消息内容: {“username”:”
”,“ts”:1729025675731,“sockport”:1883,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“keepalive”:60,“ipaddress”:“223.104.43.18”,“expiry_interval”:0,“connected_at”:1729025675731,“clientid”:“X1A1100700000007”,“clean_start”:true}】
[INFO ]24-10-16 05:13:48【接收消息主题 :$SYS/brokers/emqx@192.168.1.182/clients/X1A1100700000007/disconnected接收消息Qos:0接收消息内容: {“username”:“****”,“ts”:1729026849609,“sockport”:1883,“reason”:“tcp_closed”,“protocol”:“mqtt”,“proto_ver”:3,“proto_name”:“MQIsdp”,“ipaddress”:“223.104.43.18”,“disconnected_at”:1729026849609,“connected_at”:1729025675731,“clientid”:“X1A1100700000007”}】
[I

你需要关注一下这个 discarded 日志,表示两个 MQTT 连接使用同样的 clientid 重复登录,导致其中一个被强制下线。

但是我让设备直接连接其中一台不用负载均衡就不会出现情况,很邪门