服务每隔一天就连接超时,好像服务自动关闭了,是什么原因?

zhangsan 2020-11-11 642

11/11/2020 13:19:00,080 [nioEventLoopGroup-5-2] INFO  Qos1PublishHandler 154  - imHandler fromUser=9D9696nn, topic=GETTOKEN  11/11/2020 13:19:00,080 [pool-2-thread-6] INFO  IMHandler 157  - imHandler fromUser=9D9696nn, clientId=3002f052-330d-4b6f-897a-a336ab7453a5, topic=GETTOKEN  11/11/2020 13:19:00,081 [pool-2-thread-6] INFO  DatabaseStore 1562  - Database create session 9D9696nn,3002f052-330d-4b6f-897a-a336ab7453a5  11/11/2020 13:19:00,082 [pool-2-thread-6] INFO  DatabaseStore 1588  - Update rows 1  11/11/2020 13:19:00,082 [pool-2-thread-6] INFO  DatabaseStore 1511  - clearMultiEndpoint 9D9696nn, 3002f052-330d-4b6f-897a-a336ab7453a5  11/11/2020 13:19:00,082 [pool-2-thread-6] INFO  DatabaseStore 1549  - Update rows 1  11/11/2020 13:26:42,789 [nioEventLoopGroup-5-4] INFO  Qos1PublishHandler 154  - imHandler fromUser=9D9696nn, topic=GETTOKEN  11/11/2020 13:26:42,789 [pool-2-thread-12] INFO  IMHandler 157  - imHandler fromUser=9D9696nn, clientId=e3257ff9-d484-42b9-b850-6ce987d86907, topic=GETTOKEN  11/11/2020 13:26:42,790 [pool-2-thread-12] INFO  DatabaseStore 1562  - Database create session 9D9696nn,e3257ff9-d484-42b9-b850-6ce987d86907  11/11/2020 13:26:42,790 [pool-2-thread-12] INFO  DatabaseStore 1588  - Update rows 1  11/11/2020 13:26:42,791 [pool-2-thread-12] INFO  DatabaseStore 1511  - clearMultiEndpoint 9D9696nn, e3257ff9-d484-42b9-b850-6ce987d86907  11/11/2020 13:26:42,791 [pool-2-thread-12] INFO  DatabaseStore 1549  - Update rows 1  11/11/2020 13:30:02,643 [nioEventLoopGroup-5-6] INFO  Qos1PublishHandler 154  - imHandler fromUser=9D9696nn, topic=GETTOKEN  11/11/2020 13:30:02,644 [pool-2-thread-2] INFO  IMHandler 157  - imHandler fromUser=9D9696nn, clientId=f21a1d05-8f6f-4475-9e8d-c6a4a203484a, topic=GETTOKEN  11/11/2020 13:30:02,644 [pool-2-thread-2] INFO  DatabaseStore 1562  - Database create session 9D9696nn,f21a1d05-8f6f-4475-9e8d-c6a4a203484a  11/11/2020 13:30:02,645 [pool-2-thread-2] INFO  DatabaseStore 1588  - Update rows 1  11/11/2020 13:30:02,645 [pool-2-thread-2] INFO  DatabaseStore 1511  - clearMultiEndpoint 9D9696nn, f21a1d05-8f6f-4475-9e8d-c6a4a203484a  11/11/2020 13:30:02,645 [pool-2-thread-2] INFO  DatabaseStore 1549  - Update rows 1  11/11/2020 13:30:56,949 [nioEventLoopGroup-5-8] INFO  Qos1PublishHandler 154  - imHandler fromUser=9D9696nn, topic=GETTOKEN  11/11/2020 13:30:56,949 [pool-2-thread-13] INFO  IMHandler 157  - imHandler fromUser=9D9696nn, clientId=81e865b1-b8c1-4b21-bb6c-256146a8bf69, topic=GETTOKEN  11/11/2020 13:30:56,950 [pool-2-thread-13] INFO  DatabaseStore 1562  - Database create session 9D9696nn,81e865b1-b8c1-4b21-bb6c-256146a8bf69  11/11/2020 13:30:56,951 [pool-2-thread-13] INFO  DatabaseStore 1588  - Update rows 1  11/11/2020 13:30:56,951 [pool-2-thread-13] INFO  DatabaseStore 1511  - clearMultiEndpoint 9D9696nn, 81e865b1-b8c1-4b21-bb6c-256146a8bf69  11/11/2020 13:30:56,951 [pool-2-thread-13] INFO  DatabaseStore 1549  - Update rows 1  11/11/2020 13:54:15,595 [nioEventLoopGroup-5-10] INFO  Qos1PublishHandler 154  - imHandler fromUser=9D9696nn, topic=GETTOKEN  11/11/2020 13:54:15,595 [pool-2-thread-7] INFO  IMHandler 157  - imHandler fromUser=9D9696nn, clientId=d73546b1-ab04-4b16-9785-012b555ef903, topic=GETTOKEN  11/11/2020 13:54:15,596 [pool-2-thread-7] INFO  DatabaseStore 1562  - Database create session 9D9696nn,d73546b1-ab04-4b16-9785-012b555ef903  11/11/2020 13:54:15,596 [pool-2-thread-7] INFO  DatabaseStore 1588  - Update rows 1  11/11/2020 13:54:15,596 [pool-2-thread-7] INFO  DatabaseStore 1511  - clearMultiEndpoint 9D9696nn, d73546b1-ab04-4b16-9785-012b555ef903  11/11/2020 13:54:15,597 [pool-2-thread-7] INFO  DatabaseStore 1549  - Update rows 1  11/11/2020 13:54:38,628 [Thread-5] INFO  Server 434  - Unbinding server from the configured ports  11/11/2020 13:54:38,629 [Thread-5] INFO  NettyAcceptor 304  - Closing Netty acceptor...  11/11/2020 13:54:38,632 [Thread-5] INFO  NettyAcceptor 316  - Waiting for worker and boss event loop groups to terminate...  11/11/2020 13:54:40,834 [Thread-5] INFO  NettyAcceptor 334  - Collecting message metrics...  11/11/2020 13:54:40,834 [Thread-5] INFO  NettyAcceptor 336  - Metrics have been collected. Read messages=10, written messages=10  11/11/2020 13:54:40,834 [Thread-5] INFO  NettyAcceptor 339  - Collecting bytes metrics...  11/11/2020 13:54:40,835 [Thread-5] INFO  NettyAcceptor 341  - Bytes metrics have been collected. Read bytes=230, written bytes=0  11/11/2020 13:54:41,564 [C3P0PooledConnectionPoolManager[identityToken->1braud3ad1cu56frk37oak|3c679bde, dataSourceName->mysql]-HelperThread-#0] WARN  BasicResourcePool 223  - com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@21674366 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (0). Last acquisition attempt exception:   com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.  at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)  at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)  at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)  at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456)  at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)  at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)  at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)  at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)  at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)  at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)  Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure 

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)  at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)  at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)  at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)  at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)  at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:91)  at com.mysql.cj.NativeSession.connect(NativeSession.java:144)  at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956)  at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)  ... 12 more  Caused by: java.net.ConnectException: Connection refused (Connection refused)  at java.net.PlainSocketImpl.socketConnect(Native Method)  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)  at java.net.Socket.connect(Socket.java:589)  at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)  at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)  ... 15 more  11/11/2020 13:54:41,564 [C3P0PooledConnectionPoolManager[identityToken->1braud3ad1cu56frk37oak|3c679bde, dataSourceName->mysql]-HelperThread-#0] WARN  BasicResourcePool 220  - Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@ca263c2 is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.  11/11/2020 13:54:41,836 [Thread-5] INFO  Server 454  - Moquette server has been stopped.

重启以后就好了,

最新回复 (6)
  • zhangsan 2020-11-11
    引用 2
    11/11/2020 12:23:09,933 [nioEventLoopGroup-5-9] WARN  DefaultChannelPipeline 151  - 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.io.IOException: Connection reset by peer
           at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
           at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
           at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
           at sun.nio.ch.IOUtil.read(IOUtil.java:192)
           at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
           at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
           at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
           at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
           at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
           at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
           at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
           at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
           at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
           at java.lang.Thread.run(Thread.java:748)
    11/11/2020 12:23:09,939 [nioEventLoopGroup-5-7] WARN  DefaultChannelPipeline 151  - 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.io.IOException: Connection reset by peer
           at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
           at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
           at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
           at sun.nio.ch.IOUtil.read(IOUtil.java:192)
           at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
           at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
           at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
           at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
           at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
           at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
           at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
           at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
           at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
           at java.lang.Thread.run(Thread.java:748)
    11/11/2020 12:23:09,940 [nioEventLoopGroup-5-11] WARN  DefaultChannelPipeline 151  - 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.io.IOException: Connection reset by peer
           at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
           at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
           at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
           at sun.nio.ch.IOUtil.read(IOUtil.java:192)
           at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
           at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
           at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
           at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
           at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
           at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
           at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
           at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
           at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
           at java.lang.Thread.run(Thread.java:748)
    11/11/2020 12:23:09,940 [nioEventLoopGroup-5-8] WARN  DefaultChannelPipeline 151  - 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.io.IOException: Connection reset by peer
           at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
           at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
           at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
           at sun.nio.ch.IOUtil.read(IOUtil.java:192)
           at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
           at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
           at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100)
           at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372)
           at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
           at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
           at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
           at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
           at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
           at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
           at java.lang.Thread.run(Thread.java:748)
  • HeavyRain 2020-11-11
    引用 3
    启动脚本里有个设置jvm最大内存的地方,打开,设置成服务器内存的一半或者3/4,再试试看
  • HeavyRain 2020-11-11
    引用 4
    https://mp.weixin.qq.com/s?__biz=Mzg4MDE3ODEwOA==&tempkey=MTA4N19zK0o2MkZSM244d0JlVmdOMHhybTQ1T0c5TjVGNmRXNkxiWUs0Ykpxb3hTdk1HM2ZqYlpjY2w5NFFYM1VZRDNRdWpsdVQyYllBNGZDN1YzRkJ1R0Z4OW9PQm5NV3ZZZ2hPS1d2TTRHSG5SWE10dFVHeVo3RFRCLWl5ckl2cnZWYi1Wd19QemEwdTZaMzg5VjFIZzNUU1BONHVpbGN4X1ZlTHFzOS1Rfn4%3D&chksm=4f7864dc780fedca0da602c8cf43bf96b0bc25e5d36bb5784983ceca5a883ccf692bacd9353d#rd   可以看看这个
  • zhangsan 2020-11-12
    引用 5

    [root]# java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'

    intx CompilerThreadStackSize = 0 {pd product} uintx ErgoHeapSizeLimit = 0 {product} uintx HeapSizePerGCThread = 87241520 {product} uintx InitialHeapSize := 517996544 {product} uintx LargePageHeapSizeThreshold = 134217728 {product} uintx MaxHeapSize := 8256487424 {product} intx ThreadStackSize = 1024 {pd product} intx VMThreadStackSize = 1024 {pd product}

  • zhangsan 2020-11-12
    引用 6
    启动sh已经设置成
    JAVA_OPTS="$JAVA_OPTS -Xmx20G"
    JAVA_OPTS="$JAVA_OPTS -Xms20G"

  • zhangsan 2020-11-12
    引用 7
    等后续
返回