无法解析主机“metadata.google.internal”

无法解析主机“metadata.google.internal”

我的虚拟机已经正常运行了 2 年甚至更长时间,没有出现任何问题。几天前,我可以访问它托管的网站。我尝试使用 ssh,但连接失败,因此我重新启动了虚拟机,但无法启动。从串行控制台附加日志。我看到解析元数据服务器时出现问题。可能出了什么问题?

谢谢!

Nov 27 13:21:54 (none) /etc/mysql/debian-start[2326]: Upgrading MySQL tables if necessary.
[[36minfo[39;49m] Checking for tables which need an upgrade, are corrupt or were 
not closed cleanly..
curl: (6) Couldn't resolve host 'metadata.google.internal'
Nov 27 13:21:54 (none) google: 
Nov 27 13:21:54 (none) google: No startup script found in metadata.
Nov 27 13:21:54 (none) /etc/mysql/debian-start[2330]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Nov 27 13:21:54 (none) /etc/mysql/debian-start[2330]: Looking for 'mysql' as: /usr/bin/mysql
Nov 27 13:21:54 (none) /etc/mysql/debian-start[2330]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Nov 27 13:21:54 (none) /etc/mysql/debian-start[2330]: This installation of MySQL is already upgraded to 5.5.52, use --force if you still need to run mysql_upgrade
Nov 27 13:21:54 (none) /etc/mysql/debian-start[2377]: Checking for insecure root accounts.
Nov 27 13:21:54 (none) /etc/mysql/debian-start[2382]: Triggering myisam-recover for all MyISAM tables
Nov 27 13:21:56 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:01 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:06 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:11 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:16 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:21 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:26 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:31 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:37 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:42 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>
Nov 27 13:22:47 (none) accounts-from-metadata: WARNING error while trying to update accounts: <urlopen error [Errno 101] Network is unreachable>

我查看了一些日志,发现可能是由于以下原因造成的:

Operation type

compute.instances.migrateOnHostMaintenance

Status message

Instance migrated during Compute Engine maintenance.

答案1

您可以启用对串行控制台的交互式访问,以便更轻松地排除无法正常启动或无法访问的实例的故障。请参阅与串行控制台交互了解更多信息。

答案2

由于我们收到错误消息 [1],通常元数据服务会响应 http、DNS 和 ICMP echo。因此我们建议检查防火墙,链接 [2] 可能对您有帮助。

另一方面,关于错误消息 [3],似乎还应该有错误消息“hosterror”。主机错误意味着托管虚拟机的物理机器上存在硬件或软件问题,导致虚拟机崩溃。当 Compute Engine 检测到此类事件时,我们会在操作日志中看到 compute.instances.hostError [4] 消息。

为了“防止”应用程序和服务受到此类潜在破坏性系统事件的影响,请查看文档 [5] 中的“了解故障类型”,如下所示:

了解故障类型:

在某些时候,您的一个或多个 VM 实例可能会因系统或硬件故障而丢失。其中一些故障包括但不限于:

意外的单实例故障

意外的单实例故障可能是由于硬件或系统故障造成的。为了缓解这些事件,请使用持久磁盘和启动脚本来保存数据,并在重新启动实例后重新启用软件。

意外的单实例重启

在某个时间点,您会遇到意外的单实例故障并重新启动。与意外的单实例故障不同,您的实例会失败并由 Compute Engine 服务自动重新启动。为了帮助缓解这些事件,请备份数据、使用永久性磁盘并使用启动脚本快速重新配置软件。

区域或地区故障

区域和地区故障是罕见的故障,可能会导致给定区域或地区中的所有实例无法访问或发生故障。为了缓解这些故障,请在地区和区域之间创建多样性并实施负载平衡。您还应该备份数据或跨多个区域复制永久性磁盘。

确保您设计的系统健壮,有关健壮系统的更多信息,请参阅文档[5]。

[1] 无法解析主机“metadata.google.internal”

[2]为什么我无法访问 GCP 实例的元数据服务器?

[3] 计算.实例.migrateOnHostMaintenance

[4]https://cloud.google.com/compute/docs/faq#hosterror

[5]https://cloud.google.com/compute/docs/tutorials/robustsystems

相关内容