我有一个虚拟专用服务器运行 a Java server
、 aredis server
和 a PostgreSQL server
。
一切运行良好,但昨晚我的服务器“崩溃”于凌晨 3:15:50.至少我是这么认为的。
我查看了我的服务器日志,发现了几个由数据库引起的异常,然后就没有其他了。
我在看redis日志:
[733 | signal handler] (1429751751) Received SIGTERM scheduling shutdown...
[733] 23 Apr 03:15:51.977 # User requested shutdown...
[733] 23 Apr 03:15:51.977 * Calling fsync() on the AOF file.
[733] 23 Apr 03:15:51.977 * Saving the final RDB snapshot before exiting.
[733] 23 Apr 03:15:51.996 * DB saved on disk
[733] 23 Apr 03:15:51.996 * Removing the pid file.
[733] 23 Apr 03:15:51.996 # Redis is now ready to exit, bye bye...
好的,一个SIGTERM
。
我也看了PostgreSQL 的日志:
2015-04-23 03:15:50 CEST LOG: received fast shutdown request
2015-04-23 03:15:50 CEST LOG: aborting any active transactions
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST FATAL: terminating connection due to administrator command
2015-04-23 03:15:50 CEST LOG: autovacuum launcher shutting down
2015-04-23 03:15:50 CEST LOG: shutting down
2015-04-23 03:15:50 CEST LOG: database system is shut down
嗯。关机请求?SIGTERM
换句话说,就是信号,对吧?
我还查看了几个系统日志,例如daemon.log 和 syslog:
Apr 23 03:15:47 vps89164 xinetd[12314]: Exiting...
Apr 23 03:15:48 vps89164 named[604]: received control channel command 'stop -p'
Apr 23 03:15:48 vps89164 named[604]: shutting down: flushing changes
Apr 23 03:15:48 vps89164 named[604]: stopping command channel on 127.0.0.1#953
Apr 23 03:15:48 vps89164 named[604]: stopping command channel on ::1#953
Apr 23 03:15:48 vps89164 named[604]: no longer listening on ::#53
Apr 23 03:15:48 vps89164 named[604]: no longer listening on 127.0.0.1#53
Apr 23 03:15:48 vps89164 named[604]: no longer listening on 127.0.0.2#53
Apr 23 03:15:48 vps89164 named[604]: no longer listening on 37.59.110.223#53
Apr 23 03:15:48 vps89164 named[604]: exiting
我看着认证日志:
sshd[435]: Received signal 15; terminating.
saslauthd[758]: server_exit : master exited: 758
信号 15。SIGTERM
换句话说。
所以,如果我错了,请告诉我,但看起来凌晨 3:15:50 没有发生崩溃,而只是虚拟专用服务器重新啟動可以嗎?
但为什么?为什么会出现重启?我什么都没做(我在睡觉)。我怎么知道发生了什么?
我查看了我的 RAM 使用情况(这通常是一个问题),但使用率甚至没有达到 100%(并且 CPU 使用率仅为 3%)。
以下是过去 24 小时我的 RAM 使用情况:
当我查看 auth.log 时,我还可以看到很多连接尝试:
Apr 23 03:15:43 vps89164 sshd[23481]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=mail.setac.com.py user=root
Apr 23 03:15:44 vps89164 sshd[23479]: Failed password for root from 58.218.199.195 port 49241 ssh2
Apr 23 03:15:44 vps89164 sshd[23481]: Failed password for root from 181.40.125.54 port 46047 ssh2
Apr 23 03:15:45 vps89164 sshd[23481]: Received disconnect from 181.40.125.54: 11: Bye Bye [preauth]
Apr 23 03:15:45 vps89164 sshd[23484]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Apr 23 03:15:46 vps89164 sshd[23479]: Failed password for root from 58.218.199.195 port 49241 ssh2
Apr 23 03:15:46 vps89164 sshd[23479]: Received disconnect from 58.218.199.195: 11: [preauth]
Apr 23 03:15:46 vps89164 sshd[23479]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=58.218.199.195 user=root
这只是一个示例,有成千上万行这样的代码 但是似乎没有尝试成功,所以我不认为有人访问了服务器并重新启动了它(为什么只有当您具有 root 访问权限并可以执行任何您想做的事情时才重新启动服务器?)
现在我很困惑,这不是第一次发生这种情况。这很烦人,我不知道为什么会发生这种情况以及如何发生。我不知道如何搜索,我请求你的帮助 :(
顺便说一下,我用的是Ubuntu服务器