使用IPV4:18083可以访问EMQX,但使用IPV6:18083却无法访问,我 又建了个WEB服务,无论是IPV或IPV6都可正常访问(APACHE2.4.39)所以我认为是不是EMQX不支持IPV6,或是我没有配置好?我用的是WINDOWS版本的EMQX,那么该如何配置呢?
查了一下LOG是这样子,
2024-08-02 08:53:00,036 INFO — BrokerConnectorController : onAdHocConnect
2024-08-02 08:53:00,036 INFO — BrokerConnectorController : connecting to 2409:8a55:56bc:f140:8f0:711e:33ff:22f port 1883
2024-08-02 08:53:00,037 INFO — ScriptsController : Clear console.
2024-08-02 08:53:00,039 INFO — MqttFX ClientModel : MqttClient with ID 1a619ba0e2094fce8d8c2a9ec8ab8eba assigned.
2024-08-02 08:53:00,045 ERROR — MqttFX ClientModel : Error when connecting
org.eclipse.paho.client.mqttv3.MqttException: MqttException
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_181]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Caused by: java.lang.IllegalArgumentException: hostname can’t be null
at java.net.InetSocketAddress.checkHost(Unknown Source) ~[?:1.8.0_181]
at java.net.InetSocketAddress.(Unknown Source) ~[?:1.8.0_181]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:76) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
… 7 more
2024-08-02 08:53:00,047 ERROR — MqttFX ClientModel : Please verify your Settings (e.g. Broker Address, Broker Port & Client ID) and the user credentials!
org.eclipse.paho.client.mqttv3.MqttException: MqttException
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:38) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:715) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_181]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Caused by: java.lang.IllegalArgumentException: hostname can’t be null
at java.net.InetSocketAddress.checkHost(Unknown Source) ~[?:1.8.0_181]
at java.net.InetSocketAddress.(Unknown Source) ~[?:1.8.0_181]
at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:76) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:701) ~[org.eclipse.paho.client.mqttv3-1.2.0.jar:?]
… 7 more
2024-08-02 08:53:00,049 INFO — ScriptsController : Clear console.
2024-08-02 08:53:00,049 ERROR — BrokerConnectService : MqttException
需要手动的开启 Dashboard 监听器对 IPv6 的支持
dashboard {
## JWT token expiration time
token_expired_time = 60m
## Support Cross-Origin Resource Sharing (CORS)
cors = false
listeners.http {
## Port or Address to listen on, 0 means disable
bind = "0.0.0.0:18083" ## or just a port number, e.g. 18083
## Socket acceptor pool size for TCP protocols
num_acceptors = 8
## Maximum number of simultaneous connections
max_connections = 512
## Defines the maximum length that the queue of pending connections can grow to
backlog = 1024
## Send timeout for the socket
send_timeout = 10s
## !!!重点在这个配置,需要设置为 true!!
## Enable IPv6 support, default is false, which means IPv4 only
inet6 = true
## Disable IPv4-to-IPv6 mapping for the listener
ipv6_v6only = false
## Enable support for `HAProxy` header
proxy_header = false
}
}