与厨师和刀一起部署到EC2

时间:2014-06-26 17:19:27

标签: deployment amazon-ec2 chef knife

我正在尝试使用ec2 knife命令行工具将实例部署到chef。正在运行

knife --version

给出Chef: 11.14.0.alpha.1

我已正确配置knife.rb文件

knife[:aws_access_key_id] = 'ABSDGYRB7KXSFHGSF'
knife[:aws_secret_access_key] = 'SDHGsdbstsdsdgdfhdfAGSDGC5IOfqsdgdfhAS'
knife[:flavor] = 't1.micro'
knife[:aws_ssh_key_id] = 'myawskey'
knife[:identity_file] = "/Users/place/pem/myawskey.pem" 

然而,当我跑

knife ec2 server list

我得到了

FATAL: Cannot find sub command for: 'ec2 server list'
The ec2 commands were moved to plugins in Chef 0.10
You can install the plugin with `(sudo) gem install knife-ec2

但是我已经多次安装了包,每次都有相同的结果。

Successfully installed knife-ec2-0.8.0
Parsing documentation for knife-ec2-0.8.0
Done installing documentation for knife-ec2 after 0 seconds
1 gem installed

可能导致此问题的原因,我该怎么做才能修复它?

我觉得它可能与我正在运行的主厨的alpha版本有关,但那是chef developer kit安装的版本所以我想它会稳定。任何建议表示赞赏。谢谢。

1 个答案:

答案 0 :(得分:0)

关注this后出现了解决问题的方法。

第一步:

sudo xcode-select --switch /Library/Developer/CommandLineTools/

接下来是:

sudo chef gem install knife-ec2