我是一个尝试bootstrap和ec2实例的新手,没有任何东西适用于厨师。
我试过这个命令。
ubuntu@ubuntu:~/.chef$ knife ec2 server create -x ubuntu -r "role[testredis]" --region ap-southeast-1 -Z ap-southeast-1a -i ami-ae1a5dfc -f t1.micro -S testpem -I ~/.ec2/testpem.pem -S knife --ssh-user ubuntu
我得到了以下输出
ERROR: You have not provided a valid image (AMI) value. Please note the short option for this value recently changed from '-i' to '-I'.
然后我尝试了下面的内容。
knife bootstrap ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com -r "role[testredis]" -x ubuntu -i ~/.ec2/sg_development.pem --sudo
我得到了以下输出
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com /usr/bin/knife
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com /usr/bin/shef
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com Successfully installed chef-0.10.8
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com 1 gem installed
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:02 +0000] INFO: *** Chef 0.10.8 ***
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:03 +0000] INFO: Client key /etc/chef/client.pem is not present - registering
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:03 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:03 +0000] FATAL: OpenSSL::PKey::RSAError: private key needed.: no start line
我注意到ec2实例上的 /etc/chef/client.pem 是我运行刀命令的开发计算机上的pem。
那么,我该怎么办?是节点名称冲突吗?
答案 0 :(得分:6)
看起来似乎缺少或格式错误的验证密钥。您需要使用 chef-server 或 Opscode Hosted Chef 帐户进行此操作,才能在服务器中注册新节点。检查 .chef / knife.rb 中的配置。您需要验证密钥(通常为“ORGNAME-validator.pem
”),它与client.pem不同。
http://wiki.opscode.com/display/chef/Authentication+and+Authorization