cloud-init 的日志输出存储在哪里?

Mar*_*ler 17 cloud-computing amazon-ec2

cloud-init 的输出(在云中启动虚拟机时自动运行脚本,例如在 Amazon EC2 中)去哪里了?我想知道我的初始化脚本是否成功执行。

有一个 /var/log/cloud-init.log 文件,但它似乎只包含部分输出(即来自 SSH 密钥初始化)。

小智 18

cloud-init0.7.5(2014 年 4 月 1 日发布)开始,所有来自 cloud-init 的输出默认都被捕获到/var/log/cloud-init-output.log. 此默认日志记录配置是在2014 年 1 月 14 日的提交中添加的:

# this tells cloud-init to redirect its stdout and stderr to
# 'tee -a /var/log/cloud-init-output.log' so the user can see output
# there without needing to look on the console.
output: {all: '| tee -a /var/log/cloud-init-output.log'}
Run Code Online (Sandbox Code Playgroud)

要添加对以前版本的支持cloud-init,您可以手动将此配置手动添加到您的云配置数据


小智 6

日志存储在systemd中:

journalctl -u cloud-final
Run Code Online (Sandbox Code Playgroud)