首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么云init进程在服务器创建后很久才运行?

为什么云init进程在服务器创建后很久才运行?
EN

Unix & Linux用户
提问于 2021-11-13 13:49:16
回答 1查看 389关注 0票数 1

我正在编制一个新的Ubuntu18.04云服务器,并使用cloud-init安装码头。我可以看到,通过检查cloud-init文件,/var/log/cloud-init-output.log进程运行并显然完成得很好。但是我发现有几个cloud-init进程在此之后仍然运行很长时间,并且耗尽了CPU:

这些cloud-init进程每30秒左右出现在top列表上,然后放下,然后再返回。任何进一步诊断的方法..。为什么cloud-init在显然完成之后才运行,为什么有那么多进程?

我还看到一个CPU跟踪,它的规则峰值似乎遵循相同的模式:

查看/var/log/cloud-init.log,我发现它每30秒左右就会疯狂一次,输出以下内容,并一次又一次地重复少量行:

代码语言:javascript
复制
2021-11-13 19:21:25,927 - hotplug_hook.py[DEBUG]: hotplug-hook called with the following arguments: {hotplug_action: query, subsystem: net, udevaction: None, devpath: None}
2021-11-13 19:21:25,928 - handlers.py[DEBUG]: start: hotplug-hook: Handle reconfiguration on hotplug events
2021-11-13 19:21:25,928 - hotplug_hook.py[DEBUG]: Fetching datasource
2021-11-13 19:21:25,928 - handlers.py[DEBUG]: start: hotplug-hook/check-cache: attempting to read from cache [trust]
2021-11-13 19:21:25,928 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False)
2021-11-13 19:21:25,928 - util.py[DEBUG]: Read 18131 bytes from /var/lib/cloud/instance/obj.pkl
2021-11-13 19:21:25,931 - util.py[DEBUG]: Reading from /run/cloud-init/.instance-id (quiet=False)
2021-11-13 19:21:25,932 - util.py[DEBUG]: Read 9 bytes from /run/cloud-init/.instance-id
2021-11-13 19:21:25,932 - stages.py[DEBUG]: restored from cache with run check: DataSourceHetzner
2021-11-13 19:21:25,932 - handlers.py[DEBUG]: finish: hotplug-hook/check-cache: SUCCESS: restored from cache with run check: DataSourceHetzner
2021-11-13 19:21:25,932 - hotplug_hook.py[DEBUG]: hotplug not supported for event of type net
2021-11-13 19:21:25,932 - handlers.py[DEBUG]: finish: hotplug-hook: SUCCESS: Handle reconfiguration on hotplug events
2021-11-13 19:21:25,932 - hotplug_hook.py[DEBUG]: Exiting hotplug handler
2021-11-13 19:21:25,932 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-11-13 19:21:25,932 - util.py[DEBUG]: Read 17 bytes from /proc/uptime
2021-11-13 19:21:25,932 - util.py[DEBUG]: cloud-init mode 'hotplug-hook' took 0.058 seconds (0.06)
2021-11-13 19:21:26,035 - hotplug_hook.py[DEBUG]: hotplug-hook called with the following arguments: {hotplug_action: query, subsystem: net, udevaction: None, devpath: None}
2021-11-13 19:21:26,035 - handlers.py[DEBUG]: start: hotplug-hook: Handle reconfiguration on hotplug events
2021-11-13 19:21:26,035 - hotplug_hook.py[DEBUG]: Fetching datasource
2021-11-13 19:21:26,035 - handlers.py[DEBUG]: start: hotplug-hook/check-cache: attempting to read from cache [trust]
2021-11-13 19:21:26,036 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False)
2021-11-13 19:21:26,036 - util.py[DEBUG]: Read 18131 bytes from /var/lib/cloud/instance/obj.pkl
2021-11-13 19:21:26,039 - util.py[DEBUG]: Reading from /run/cloud-init/.instance-id (quiet=False)
2021-11-13 19:21:26,039 - util.py[DEBUG]: Read 9 bytes from /run/cloud-init/.instance-id
2021-11-13 19:21:26,039 - stages.py[DEBUG]: restored from cache with run check: DataSourceHetzner
2021-11-13 19:21:26,039 - handlers.py[DEBUG]: finish: hotplug-hook/check-cache: SUCCESS: restored from cache with run check: DataSourceHetzner
2021-11-13 19:21:26,039 - hotplug_hook.py[DEBUG]: hotplug not supported for event of type net
2021-11-13 19:21:26,040 - handlers.py[DEBUG]: finish: hotplug-hook: SUCCESS: Handle reconfiguration on hotplug events
2021-11-13 19:21:26,040 - hotplug_hook.py[DEBUG]: Exiting hotplug handler
2021-11-13 19:21:26,040 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-11-13 19:21:26,040 - util.py[DEBUG]: Read 17 bytes from /proc/uptime
2021-11-13 19:21:26,040 - util.py[DEBUG]: cloud-init mode 'hotplug-hook' took 0.054 seconds (0.06)
2021-11-13 19:21:26,054 - hotplug_hook.py[DEBUG]: hotplug-hook called with the following arguments: {hotplug_action: query, subsystem: net, udevaction: None, devpath: None}
2021-11-13 19:21:26,054 - handlers.py[DEBUG]: start: hotplug-hook: Handle reconfiguration on hotplug events
2021-11-13 19:21:26,054 - hotplug_hook.py[DEBUG]: Fetching datasource
2021-11-13 19:21:26,054 - handlers.py[DEBUG]: start: hotplug-hook/check-cache: attempting to read from cache [trust]
2021-11-13 19:21:26,055 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/obj.pkl (quiet=False)
2021-11-13 19:21:26,055 - util.py[DEBUG]: Read 18131 bytes from /var/lib/cloud/instance/obj.pkl
2021-11-13 19:21:26,058 - util.py[DEBUG]: Reading from /run/cloud-init/.instance-id (quiet=False)
2021-11-13 19:21:26,058 - util.py[DEBUG]: Read 9 bytes from /run/cloud-init/.instance-id
2021-11-13 19:21:26,058 - stages.py[DEBUG]: restored from cache with run check: DataSourceHetzner
2021-11-13 19:21:26,058 - handlers.py[DEBUG]: finish: hotplug-hook/check-cache: SUCCESS: restored from cache with run check: DataSourceHetzner
2021-11-13 19:21:26,058 - hotplug_hook.py[DEBUG]: hotplug not supported for event of type net
2021-11-13 19:21:26,058 - handlers.py[DEBUG]: finish: hotplug-hook: SUCCESS: Handle reconfiguration on hotplug events
2021-11-13 19:21:26,059 - hotplug_hook.py[DEBUG]: Exiting hotplug handler
2021-11-13 19:21:26,059 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-11-13 19:21:26,059 - util.py[DEBUG]: Read 17 bytes from /proc/uptime
2021-11-13 19:21:26,059 - util.py[DEBUG]: cloud-init mode 'hotplug-hook' took 0.057 seconds (0.05)
EN

回答 1

Unix & Linux用户

发布于 2021-11-13 23:01:23

从一个有用的聊天#云init IRC频道,显然这与21.4的云init版本21.3的问题有关,该版本将在几天后发布。

在此之前,一个解决办法是:

代码语言:javascript
复制
rm -f /lib/udev/rules.d/10-cloud-init-hook-hotplug.rules
sudo udevadm control --reload-rules
票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/677368

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档