如何检查传递给EC2实例的用户数据是否正常? [英] How to check whether my user data passing to EC2 instance working or not?
本文介绍了如何检查传递给EC2实例的用户数据是否正常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用EC2命令行API创建新的AWS EC2实例时,我正在将一些用户数据传递给新实例。
现在我如何知道该用户数据是否执行?
我应如何检查?
解决方案
您可以按照以下步骤进行验证
- 启动EC2实例时使用SSH
- 检查用户数据日志
-
/var/log/cloud-init.log
和 $ b中的脚本$ b -
/var/log/cloud-init-output.log
-
您可以看到用户数据脚本的所有日志,它还将创建 / etc / cloud
文件夹。 / p>
While creating new AWS EC2 instance using EC2 command line API, i am passing some user data to new instance.
Now how i came to know whether that user data executed or not ?
How should i check it ?
解决方案
You can verify using following steps
- SSH on launch EC2 instance
- Check log of your user data script in
/var/log/cloud-init.log
and/var/log/cloud-init-output.log
You can see all log's of your user data script and it will also create /etc/cloud
folder.
这篇关于如何检查传递给EC2实例的用户数据是否正常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文