我有一个简单的cloud-init用户数据,我传递给ec2。 我通过右键单击实例并在其中设置用户数据,将此数据设置在我的ec2实例上。
以下是我的云初始用户数据
#cloud-config runcmd: - [ ls,-l,/ ] - [ sh,-xc,"echo $(date) ': Hello World!'" ] - [ sh,-c,echo "=========hello world'=========" ] - [ touch,/home/ec2-user/hello.txt ] final_message: "The system is finally up,after 10 seconds"
我从这里得到了这个例子,我添加了触摸命令
我的期望是看到/var/log/cloud-init.log上的数据。 但是我没有看到它。 此外,我没有看到任何错误,也没有看到hello.txt文件创build
如何使用EC2在多个服务器上分发应用程序?
ES不听外部请求
Django能单独运行在Gunicorn上(没有Apache或者Nginx)吗?
尝试使用RSA密钥SSH进入EC2,获取:不正确的RSA1标识符…权限被拒绝(公钥)
利用Nginx的浏览器caching问题
有什么我失踪了吗?
我正在运行一个亚马逊Linux实例,而不是一个Ubuntu实例
EBS卷resize后EC2实例非常慢
Amazon EC2实例之间进行通信的最佳实践是什么?
Nginx的:我怎样才能提供Nginxconfiguration的pathvariables?
没有名为“virtualenvwrapper”的模块
Node.js + Socket.IO使用redis + cluster进行缩放
这是你的第三个命令的语法错误:
- [ sh,echo "=========hello world'=========" ]
#cloud-config runcmd: - [ ls,'echo $(date) ": Hello World!"' ] - [ sh,'echo "=========hello world========="' ] - [ touch,/home/ec2-user/hello.txt ] final_message: "The system is finally up" output : { all : '| tee -a /var/log/cloud-init-output.log' }
请注意,它仅在/var/log/cloud-init.log显示了cloud-init执行日志。 指定output指令后,您应该在/var/log/cloud-init-output.log看到输出。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。