看日志是你的 HTTP Server 返回了 502
5.0.11 跟5.0.19的配置是一样的吧,感觉升级之后就不行了
emqx:
container_name: emqx
image: emqx/emqx:5.0.11
restart: always
network_mode: “host”
environment:
- “EMQX_NODE__NAME=emqx@127.0.0.1”
- “EMQX_CLUSTER__DISCOVERY=manual”
- “EMQX_DASHBOARD__DEFAULT_PASSWORD=sss”
- “EMQX_MQTT__SESSION_EXPIRY_INTERVAL=5m”
- “EMQX_NODE__PROCESS_LIMIT=2097152”
- “EMQX_NODE__MAX_PORTS=1048576”
方便发一下完整日志吗?
2023-03-03 16:47:05,405 ERROR - MQTT重连报错:Error while connecting with host ‘127.0.0.1:1883’.
MQTTnet.Exceptions.MqttCommunicationException: Error while connecting with host ‘127.0.0.1:1883’.
—> System.Net.Sockets.SocketException (111): Connection refused
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
— End of stack trace from previous location —
at MQTTnet.Implementations.CrossPlatformSocket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
— End of inner exception stack trace —
at MQTTnet.Implementations.CrossPlatformSocket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at MQTTnet.Implementations.MqttTcpChannel.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Internal.MqttTaskTimeout.WaitAsync(Func`2 action, TimeSpan timeout, CancellationToken cancellationToken)
at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(TimeSpan timeout, CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(IMqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(IMqttClientOptions options, CancellationToken cancellationToken)
at VCS.RoomServer.MqttServer.OnDisconnectedAsync(MqttClientDisconnectedEventArgs args) in MqttServer.cs:line 133
2023-03-03 16:47:05,405 ERROR - Mqtt disconnected.
2023-03-03 16:47:08,409 INFO - MQTT重连成功
mqtt启动成功,感觉之前代码就不行了,是不是你们改了什么
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: NOTE: Use the same cookie for all nodes in the cluster.
EMQX_DASHBOARD__DEFAULT_PASSWORD [dashboard.default_password]:
EMQX_RPC__PORT_DISCOVERY [rpc.port_discovery]: manual
EMQX_LOG__FILE_HANDLERS__DEFAULT__ENABLE [log.file_handlers.default.enable]: false
EMQX_LOG__CONSOLE_HANDLER__ENABLE [log.console_handler.enable]: true
EMQX_CLUSTER__DISCOVERY_STRATEGY [cluster.discovery_strategy]: manual
EMQX_node__max_ports [node.max_ports]: 1048576
EMQX_node__process_limit [node.process_limit]: 2097152
EMQX_NODE__NAME [node.name]: emqx@127.0.0.1
EMQX_MQTT__SESSION_EXPIRY_INTERVAL [mqtt.session_expiry_interval]: 5m
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.19 is running now!
5.0.11升级到5.0.19,之前升级都docker-compose up -d emqx 就行,这次不行了,服务mqtt连接出错,应该是你们有什么不兼容
你好,问一下服务端之前监听$queue/aa/#(5.0.11) 升级新的版本是不是改成$share/aa/#监听(5.0.19),之前应该是这个功能改了造成的另外我们改了之后,这种服务端$share监听的,授权HTTPS是调用一次还是不同的topic会调用一次,否则授权接口性能很难保证
您好,在 v5.0.12 中移除了 $queue
作为 MQTT 3.1.1 中的共享订阅非标准实现。
在之后的版本中,请使用 MQTT 5.0 客户端连接,并订阅 $share/{group_name}/{topic_filter}
以使用共享订阅功能。
此外,向共享订阅主题的发布仍然遵从普通的 PUBLISH AuthZ 逻辑,也就是在开启 AuthZ 缓存的情况下,并不会每次发布都进行发布授权检查。
升级到5.0.20版本,授权开启http请求之后,我们服务端还是请求量大还是会报错,帮忙看一下,错误日志如下:
e: <<“conn_congestion/9c00b9c500e247199ed05eda96c6a3de/XX”>>
2023-03-20T14:36:30.145234+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 1.193.37.50:49975, clientid: .ss.CSzqaLZnz8jRjyjm2kdAbK7S_RNv4Urhcyb0bqWRFCg, reason: einval
2023-03-20T14:40:33.448894+00:00 [error] msg: unexpected_sock_close, mfa: emqx_channel:handle_info/2, line: 1266, peername: 192.168.4.188:41832, clientid: .ss.lr0ilVRqWmooMfl9O7Xa6XQLsv_6ThSWDiIDXg0VgA8, reason: tcp_closed
2023-03-20T14:40:39.395690+00:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 416, message: <<“connection congested: #{buffer => 4096,clientid => <<"9c00b9c500e247199ed05eda96c6a3de">>,conn_state => connected,connected_at => 1679323237506,high_msgq_watermark => 8192,high_watermark => 1048576,memory => 627152,message_queue_len => 237,peername => <<"192.168.4.192:45054">>,pid => <<"<0.28703.8>">>,proto_name => <<"MQTT">>,proto_ver => 5,recbuf => 442232,recv_cnt => 100,recv_oct => 97700,re”…>>, name: <<“conn_congestion/9c00b9c500e247199ed05eda96c6a3de/ss”>>
2023-03-20T14:40:43.838837+00:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 422, name: <<“conn_congestion/9c00b9c500e247199ed05eda96c6a3de/bb”>>
2023-03-20T14:40:48.626268+00:00 [warning] msg: alarm_is_activated, mfa: emqx_alarm:do_actions/3, line: 416, message: <<“connection congested: #{buffer => 4096,clientid => <<"9c00b9c500e247199ed05eda96c6a3de">>,conn_state => connected,connected_at => 1679323246848,high_msgq_watermark => 8192,high_watermark => 1048576,memory => 1023792,message_queue_len => 524,peername => <<"192.168.4.192:45922">>,pid => <<"<0.30778.8>">>,proto_name => <<"MQTT">>,proto_ver => 5,recbuf => 374400,recv_cnt => 100,recv_oct => 90035,r”…>>, name: <<“conn_congestion/9c00b9c500e247199ed05eda96c6a3de/ss”>>
2023-03-20T14:40:53.611909+00:00 [warning] msg: alarm_is_deactivated, mfa: emqx_alarm:do_actions/3, line: 422, name: <<“conn_congestion/9c00b9c500e247199ed05eda96c6a3de/bb”>>