有几个基于springboot的服务今天发现突然停掉了,也不知道什么原因,所以只能看一下日志了
主要日志如下:
2023-06-17 14:26:21.775 DEBUG o.s.b.f.s.DefaultListableBeanFactory- Retrieved dependent beans for bean 'dataSource': [mybatisConfig, org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$DataSourceTransactionManagerConfiguration, org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration]
2023-06-17 14:26:21.775 DEBUG o.s.b.f.s.DisposableBeanAdapter- Invoking destroy method 'close' on bean with name 'dataSource'
2023-06-17 14:26:21.788 DEBUG druid.sql.Connection- {conn-10001} closed
2023-06-17 14:26:21.789 DEBUG druid.sql.Connection- {conn-10002} closed
2023-06-17 14:26:21.789 DEBUG druid.sql.Connection- {conn-10003} closed
2023-06-17 14:26:21.789 DEBUG druid.sql.Connection- {conn-10004} closed
2023-06-17 14:26:21.790 DEBUG c.a.druid.pool.PreparedStatementPool- {conn-10005, pstmt-20000} exit cache
2023-06-17 14:26:21.790 DEBUG druid.sql.Statement- {conn-10005, pstmt-20000} closed
2023-06-17 14:26:21.790 DEBUG c.a.druid.pool.PreparedStatementPool- {conn-10005, pstmt-20001} exit cache
2023-06-17 14:26:21.790 DEBUG druid.sql.Statement- {conn-10005, pstmt-20001} closed
2023-06-17 14:26:21.796 DEBUG druid.sql.Connection- {conn-10005} closed
2023-06-17 14:26:21.806 INFO c.alibaba.druid.pool.DruidDataSource- {dataSource-1} closed
2023-06-17 14:26:21.807 DEBUG o.s.b.f.s.DisposableBeanAdapter- Invoking destroy() on bean with name 'characterEncodingFilter'
2023-06-17 14:26:21.807 DEBUG o.s.b.f.s.DisposableBeanAdapter- Invoking destroy() on bean with name 'httpPutFormContentFilter'
2023-06-17 14:26:21.807 DEBUG o.s.b.f.s.DisposableBeanAdapter- Invoking destroy() on bean with name 'hiddenHttpMethodFilter'
2023-06-17 14:26:21.807 DEBUG o.s.b.f.s.DisposableBeanAdapter- Invoking destroy() on bean with name 'requestContextFilter'
2023-06-17 14:26:21.807 DEBUG o.s.b.f.s.DisposableBeanAdapter- Invoking destroy() on bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor'
2023-06-17 14:26:21.807 DEBUG o.s.b.f.s.DefaultListableBeanFactory- Retrieved dependent beans for bean 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory': [org.springframework.context.annotation.internalConfigurationAnnotationProcessor]
同时搜索日志是否存在exception,OutOfMemory,heap 等错误,看了一下都没有什么问题。
说明不是内存溢出等问题引起的。
后来也找了网上的一些资料,应该是SSH远程启动服务后,退出SSH后,服务也退出来了。
后来用history看看历史命令
确实上面的命令前面忘记打nohup了,导致上面的问题
正常后几个运行服务如下:
项目启动后看起来似乎脱离终端了,其实还是受终端影响。大家引以为戒。
只要终端关了 服务就会停止。