我的 DigitalOcean 环境莫名其妙地崩溃了。不幸的是,我无法启动我的puma
服务,所以我的 Rails 应用程序完全失败了。
我用来启动服务的命令是:
systemctl start puma
有一个我不熟悉的神秘错误:
Job for puma.service failed because a configured resource limit was exceeded. See "systemctl status puma.service" and "journalctl -xe" for details.
systemctl status puma.service
产量:
● puma.service - Puma HTTP Server
Loaded: loaded (/etc/systemd/system/puma.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: resources) since Wed 2018-04-11 17:45:20 EDT; 6min ago
sudo journalctl -xe
:
Subject: Unit puma.service has failed
Defined-By: systemd
Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Unit puma.service has failed.
Apr 11 17:56:30 app-master sshd[1124]: Invalid user wp from <some ip>
Apr 11 17:56:30 app-master sshd[1124]: input_userauth_request: invalid user wp [preauth]
Apr 11 17:56:30 app-master sshd[1124]: pam_unix(sshd:auth): check pass; user unknown
Apr 11 17:56:30 app-master sshd[1124]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<some ip>
Apr 11 17:56:32 app-master sshd[1124]: Failed password for invalid user wp from 114.32.120.181 port 39504 ssh2
Apr 11 17:56:33 app-master sshd[1124]: Received disconnect from <some ip> port 39504:11: Normal Shutdown, Thank you for playing [preauth]
Apr 11 17:56:33 app-master sshd[1124]: Disconnected from <some ip> port 39504 [preauth]
Apr 11 17:56:37 app-master sshd[1126]: Connection closed by <some ip> port 49964 [preauth]
Apr 11 17:56:41 app-master sshd[1128]: Did not receive identification string from 103.89.91.78
Apr 11 17:56:48 app-master sshd[1129]: fatal: Unable to negotiate with 103.89.91.78 port 51781: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 [preauth]
Apr 11 17:56:49 app-master sshd[1131]: Did not receive identification string from 103.89.91.78
Apr 11 17:56:50 app-master sshd[1132]: fatal: Unable to negotiate with 103.89.91.78 port 55251: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 [preauth]
Apr 11 17:56:53 app-master sshd[1134]: fatal: Unable to negotiate with 103.89.91.78 port 60600: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 [preauth]
Apr 11 17:56:54 app-master sshd[1136]: Did not receive identification string from 103.89.91.78
Apr 11 17:57:06 app-master sshd[1137]: Invalid user wp from <some ip>
Apr 11 17:57:06 app-master sshd[1137]: input_userauth_request: invalid user wp [preauth]
Apr 11 17:57:06 app-master sshd[1137]: pam_unix(sshd:auth): check pass; user unknown
Apr 11 17:57:06 app-master sshd[1137]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<some ip>
Apr 11 17:57:08 app-master sshd[1137]: Failed password for invalid user wp from 114.32.120.181 port 41202 ssh2
Apr 11 17:57:08 app-master sshd[1137]: Received disconnect from <some ip>port 41202:11: Normal Shutdown, Thank you for playing [preauth]
Apr 11 17:57:08 app-master sshd[1137]: Disconnected from <some ip> port 41202 [preauth]
Apr 11 17:57:10 app-master sshd[1139]: Connection closed by <some ip> port 34578 [preauth]
Apr 11 17:57:15 app-master sshd[1141]: Did not receive identification string from 103.89.91.78
Apr 11 17:57:42 app-master sshd[1142]: Invalid user wp from <some ip>
Apr 11 17:57:42 app-master sshd[1142]: input_userauth_request: invalid user wp [preauth]
Apr 11 17:57:42 app-master sshd[1142]: pam_unix(sshd:auth): check pass; user unknown
Apr 11 17:57:42 app-master sshd[1142]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<some ip>
Apr 11 17:57:44 app-master sshd[1142]: Failed password for invalid user wp from 114.32.120.181 port 42864 ssh2
Apr 11 17:57:44 app-master sshd[1142]: Received disconnect from <some ip> port 42864:11: Normal Shutdown, Thank you for playing [preauth]
Apr 11 17:57:44 app-master sshd[1142]: Disconnected from <some ip> port 42864 [preauth]
Apr 11 17:58:11 app-master sshd[1144]: Did not receive identification string from <some ip>
Apr 11 17:58:17 app-master sudo[1147]: <hidden> : TTY=pts/0 ; PWD=/home/<hidden> ; USER=root ; COMMAND=/bin/journalctl -xe
Apr 11 17:58:17 app-master sudo[1147]: pam_unix(sudo:session): session opened for user root by <hidden>(uid=0)
我对这里的问题是什么一无所知。我一生中从未见过wp
用户,所以我什至不知道那是什么。我不明白为什么我突然无法再在 DigitalOcean Droplet 上运行 puma。
答案1
您耗尽的资源很可能与内存相关或与 CPU 相关。
您的 DigitalOcean 帐户包括仪表板上对 Droplet 的 CPU 和内存监控。你应该检查一下。在崩溃之前,Droplet 是否耗尽了我们的 CPU 内存?
您还可以检查适用于 Puma 的与 systemd 相关的所有资源限制:
systemctl show puma
与输出交叉引用systemd 资源控制指令的文档。
最后,搜索期刊中所有提及 puma 的内容:
journalctl -x | grep puma
您可能会在那里找到一些关于哪些资源已耗尽的线索。