im集群,服务端日志报错MQTT连接失败

ayuan 6月前 301

2023-11-13 15:07:20,558 INFO  [n-epoll-worker4] (NettyMQTTHandler.java:106) - Notifying connection lost event. MqttClientId = 1B03AA5F-4851-4DB1DD.
2023-11-13 15:07:20,558 INFO  [n-epoll-worker4] (ProtocolProcessor.java:853) - Processing connection lost event. CId=1B03AA5F-4851-4DB1DD
2023-11-13 15:07:20,559 INFO  [n-epoll-worker4] (MessageMetricsHandler.java:72) - channel<9806> closing after read 4 messages and wrote 4 messages
2023-11-13 15:07:20,559 INFO  [n-epoll-worker4] (MessageMetricsHandler.java:72) - channel<9806> closing after read 4 messages and wrote 4 messages
2023-11-13 15:07:20,559 WARN  [ls-worker1] (DefaultChannelPipeline.java:1152) - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.net.SocketException: Connection reset
        at sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394) ~[?:?]
        at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426) ~[?:?]
        at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253) ~[netty-buffer-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132) ~[netty-buffer-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350) ~[netty-transport-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151) ~[netty-transport-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) ~[netty-transport-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) ~[netty-transport-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) ~[netty-transport-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[netty-transport-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.68.Final.jar:4.1.68.Final]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
2023-11-13 15:07:20,559 WARN  [ls-worker1] (ActionHandler.java:73) - Connection reset
2023-11-13 15:07:24,238 ERROR [n-epoll-worker3] (NettyMQTTHandler.java:114) - An unexpected exception was caught while processing MQTT message. Closing Netty channel. CId=5c2d694a-0e5b-472c-b2db-b187900a90b11697248882805, cause=null, errorMessage=readAddress(..) failed: Connection reset by peer
2023-11-13 15:07:24,239 INFO  [n-epoll-worker3] (MessageMetricsHandler.java:72) - channel<2987> closing after read 4 messages and wrote 4 messages

nginx配置如下

upstream imserver_cluster  {
    server 127.0.0.1;
    server 127.0.0.2;
}

server {
    listen 80;
    server_name  my domian;

    root   html;
    index  index.html index.htm index.php;

    proxy_connect_timeout 10s;

    location /route {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }

    location /api {
        proxy_pass  http://imserver_cluster;
    }

    location /im {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }

    location /fs {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }

    location /robot {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }

    location /channel {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }
}

server {
    listen 443 ssl;
    server_name mydomain;

    proxy_connect_timeout 10s;
    root html;
    index index.html index.htm;
    ssl_certificate   cert/mypem.pem;
    ssl_certificate_key  cert/mykey.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

        location /route {
                proxy_set_header  Host  $host;
                proxy_set_header  X-real-ip $remote_addr;
                proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass  http://imserver_cluster;
        }
        location / {
                proxy_set_header  Host  $host;
                proxy_set_header  X-real-ip $remote_addr;
                proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass  http://imserver_cluster;
        }

        location /api {
                proxy_pass  http://imserver_cluster;
        }

    location /im {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }
        location /admin {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }

        location /fs {
                proxy_set_header  Host  $host;
                proxy_set_header  X-real-ip $remote_addr;
                proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass  http://imserver_cluster;
        }

    location /robot {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }

    location /channel {
        proxy_set_header  Host  $host;
        proxy_set_header  X-real-ip $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://imserver_cluster;
    }
}
最新回复 (1)
  • x86 6月前
    引用 2
    你好,客户端被杀进程等,也会触发上面的那报错。

    IM 连接等,有什么具体的问题吗?业务是否正常?
返回