Google Cloud Linux 实例突然无法登录

Google Cloud Linux 实例突然无法登录

这是我们过去 3 周一直在使用的免费 3cx google linux 实例。突然间,我无法使用 Putty/SSH 或 Google 云控制台登录 VM,并且出现存储不足错误。我调整了磁盘大小,但仍然不断出现错误。以下是来自串行日志的几行 -

localhost google_accounts_daemon[760]: Activating Google Compute Engine OS Login.

Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/ssh/sed5ok0QR: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/ssh/sedsnBxDR: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/ssh/sedC8TiHR: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/sedwyzwwR: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/sedfzoX9P: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/pam.d/sedk4JABH: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/pam.d/sed0i1OtH: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/pam.d/sedyhvdhH: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: sed: couldn't open temporary file /etc/pam.d/sedTaGMlH: No space left on device
Aug 21 09:47:55 localhost google_accounts_daemon[760]: Restarting sshd.
Aug 21 09:47:55 localhost systemd[1]: Stopping OpenBSD Secure Shell server...
Aug 21 09:47:55 localhost systemd[1]: Stopped OpenBSD Secure Shell server.
Aug 21 09:47:55 localhost systemd[1]: Starting OpenBSD Secure Shell server...
Aug 21 09:47:55 localhost systemd[1]: Started OpenBSD Secure Shell server.
Aug 21 09:47:55 localhost google-accounts: ERROR Exception calling the response handler. [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'].#012Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/google_compute_engine/metadata_watcher.py", line 196, in WatchMetadata#012    handler(response)#012  File "/usr/lib/python2.7/dist-packages/google_compute_engine/accounts/accounts_daemon.py", line 263, in HandleAccounts#012    self.utils.SetConfiguredUsers(desired_users.keys())#012  File "/usr/lib/python2.7/dist-packages/google_compute_engine/accounts/accounts_utils.py", line 276, in SetConfiguredUsers#012    mode='w', prefix=prefix, delete=True) as updated_users:#012  File "/usr/lib/python2.7/tempfile.py", line 463, in NamedTemporaryFile#012    dir = gettempdir()#012  File "/usr/lib/python2.7/tempfile.py", line 275, in gettempdir#012    tempdir = _get_default_tempdir()#012  File "/usr/lib/python2.7/tempfile.py", line 217, in _get_default_tempdir#012    ("No usable temporary directory found in %s" % dirlist))#012IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/']

等效命令行

有人遇到过这个错误吗?如果有,可以帮忙解决吗?

答案1

这似乎表明您的启动磁盘已满,导致您无法通过 SSH 访问实例。您可以在计算引擎/实例菜单中从云控制台增加启动磁盘大小。
有关更多详细信息,请参阅 GCP 公共文档关联

进入实例设置,选择启动盘,编辑并增加大小。
不要将大小增加太多,因为之后您将无法减小它。

然后重新启动实例,以便操作系统考虑分区调整大小。
然后您应该能够通过 SSH 登录。

找到文件系统变满的原因后,您就可以进行一些清理了。

相关内容