刀ec2服务器创建返回403禁止

时间:2014-04-06 20:18:58

标签: amazon-ec2 knife cookbook

我尝试在AWS实例上安装tomcat cookbook,但遇到如下错误:

角色tomcat.rb:

name 'tomcat'
description 'A single tomcat server'
run_list(
  'recipe[tomcat]'
)

运行:

knife ec2 server create --availability-zone us-east-1d --node-name tomcat.demo --flavor t1.micro --image ami-fd20ad94 --identity-file .ssh/tiagov.pem --run-list 'role[tomcat]' --ssh-user ubuntu

返回:

...
...
ec2-54-237-233-176.compute-1.amazonaws.com   xorg-sgml-doctools xtrans-dev
ec2-54-237-233-176.compute-1.amazonaws.com 0 upgraded, 85 newly installed, 0 to remove and 0 not upgraded.
ec2-54-237-233-176.compute-1.amazonaws.com Need to get 63.2 MB of archives.
ec2-54-237-233-176.compute-1.amazonaws.com After this operation, 184 MB of additional disk space will be used.
ec2-54-237-233-176.compute-1.amazonaws.com Err http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main libasound2 amd64 1.0.25-1ubuntu10.1
ec2-54-237-233-176.compute-1.amazonaws.com   403  Forbidden

我做错了什么?

1 个答案:

答案 0 :(得分:0)

在您引导实例时,我看起来您的update端点可能已经过时了。我会检查你的[tomcat]食谱是否有以下命令(如sudo):

apt-get update

我还要确保您的AMI中的ubuntu用户具有sudo无密码访问权限(这是Amazon ubuntu AMI的默认设置)