【发布时间】:2015-02-15 03:05:24
【问题描述】:
在谈到厨师术语时,我似乎很麻烦。大多数教程都假设用户已经熟悉这些术语。在其中一个之后,我得到了 chef-client 和 chefdk。我想做的就是能够设置工作站并引导一个节点。
这是我的设置:
- 工作站:ubuntu 14.04 笔记本电脑(无意成为客户端)一个
- 托管厨师帐户:我订阅了 5 个节点帐户 3 个虚拟机上的一个
- 我想要控制和使用的主机来查看厨师的实际操作
在这里和那里阅读,我认为我需要以下内容:
- client.rb : 到目前为止还不知道如何获取它以及它的作用
- knife.rb:从启动 kip 复制到 /etc/chef/(它只在那里查找)
- username.pem :我猜想在工作站和主厨之间进行身份验证:服务器左右
- organization-validation.pem : 我猜是节点和服务器之间的身份验证。
所以我把 knife.rb ,username.pem 和 validation.pem(renamed organization-validation.pem) 放在 /etc/chef 下。我还在我的~/.bash_profile 中添加了以下内容:
PATH=$PATH:$HOME/.local/bin:$HOME/bin
PATH=$PATH:/opt/chefdk/bin
export PATH
所以当运行我的引导命令时:
knife bootstrap server1.domain.com -x user -P pass -N server1
##knife bootstrap output
WARNING: No knife configuration file found
Connecting to server1.domain.com
server1.domain.com Starting first Chef Client run...
server1.domain.com [2014-12-16T16:55:02+00:00] WARN:
server1.domain.com SSL validation of HTTPS requests is disabled. HTTPS connections are still
server1.domain.com encrypted, but chef is not able to detect forged replies or man in the middle
server1.domain.com attacks.
server1.domain.com To fix this issue add an entry like this to your configuration file:
server1.domain.com # Verify all HTTPS connections (recommended)
server1.domain.com ssl_verify_mode :verify_peer
server1.domain.com # OR, Verify only connections to chef-server
server1.domain.com verify_api_cert true
server1.domain.com To check your SSL configuration, or troubleshoot errors, you can use the
server1.domain.com `knife ssl check` command like so:
server1.domain.com knife ssl check -c /etc/chef/client.rb
server1.domain.com Starting Chef Client, version 11.16.4
server1.domain.com Creating a new client identity for logsmanager using the validator key.
server1.domain.com [2014-12-16T16:55:04+00:00] ERROR: Connection refused connecting to https://localhost/clients, retry 1/5
server1.domain.com [2014-12-16T16:55:09+00:00] ERROR: Connection refused connecting to https://localhost/clients, retry 2/5
server1.domain.com [2014-12-16T16:55:14+00:00] ERROR: Connection refused connecting to https://localhost/clients, retry 3/5
server1.domain.com [2014-12-16T16:55:19+00:00] ERROR: Connection refused connecting to https://localhost/clients, retry 4/5
server1.domain.com [2014-12-16T16:55:24+00:00] ERROR: Connection refused connecting to https://localhost/clients, retry 5/5
server1.domain.com Network Error:
server1.domain.com There was a network error connecting to the Chef Server:
server1.domain.com Connection refused - Connection refused connecting to https://localhost/clients, giving up
server1.domain.com Relevant Config Settings:
server1.domain.com chef_server_url "https://localhost:443"
server1.domain.com If your chef_server_url is correct, your network could be down.
server1.domain.com [2014-12-16T16:55:29+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
server1.domain.com Chef Client failed. 0 resources updated in 27.268943154 seconds
server1.domain.com [2014-12-16T16:55:29+00:00] ERROR: Connection refused - Connection refused connecting to https://localhost/clients, giving up
server1.domain.com [2014-12-16T16:55:29+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
很明显我迷路了,谁能让我走上正确的道路。请 。谢谢
编辑 1
下面是knife.rb文件
# See https://docs.chef.io/config_rb_knife.html for more information on knife configuration options
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "username"
client_key "#{current_dir}/username.pem"
validation_client_name "organization-validator"
validation_key "#{current_dir}/organizationname-validator.pem"
chef_server_url "https://api.opscode.com/organizations/organizationname"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path ["#{current_dir}/../cookbooks"]
【问题讨论】:
-
请张贴您的knife.rb文件的内容。
-
你好@TejayCardon 我更新了帖子
-
knife 期望找到此文件的默认位置是
~/.chef/knife.rb- 您是否尝试过解决“未找到刀配置文件”?它还尝试使用https://localhost/clients的服务器网址,但您的刀文件显示https://api.opscode.com。您的配置似乎不止一个问题,所以很难弄清楚从哪里开始