Chef infra 如何设置chef workstation而不是chef客户端本身

Chef infra 如何设置chef workstation而不是chef客户端本身,chef-infra,bootstrapping,Chef Infra,Bootstrapping,当谈到厨师术语时,我似乎在争论。大多数教程假设用户已经熟悉这些术语。跟着其中一个,我得到了主厨客户和切夫德克。我想做的就是能够设置工作站并引导一个节点 以下是我的设置: 工作站:ubuntu 14.04笔记本电脑(无意将其作为客户端)a 托管厨师帐户:我订阅了5个节点帐户3个虚拟机 我想控制和使用的主机,以查看厨师长的行动 通过阅读这里和那里,我想我需要以下几点: PATH=$PATH:$HOME/.local/bin:$HOME/bin PATH=$PATH:/opt/chefdk/bin

当谈到厨师术语时,我似乎在争论。大多数教程假设用户已经熟悉这些术语。跟着其中一个,我得到了主厨客户和切夫德克。我想做的就是能够设置工作站并引导一个节点

以下是我的设置:

  • 工作站:ubuntu 14.04笔记本电脑(无意将其作为客户端)a
  • 托管厨师帐户:我订阅了5个节点帐户3个虚拟机
  • 我想控制和使用的主机,以查看厨师长的行动
通过阅读这里和那里,我想我需要以下几点:

PATH=$PATH:$HOME/.local/bin:$HOME/bin
PATH=$PATH:/opt/chefdk/bin
export PATH
  • client.rb:到目前为止,我还不知道如何获得它以及它的用途
  • knife.rb:从启动kip复制到/etc/chef/(它只在那里查找)
  • username.pem:我想在工作站和chef托管服务器之间的某个地方进行身份验证:服务器左右
  • organization-validation.pem:我想是节点和服务器之间的身份验证
所以我把knife.rb、username.pem和validation.pem(更名为organization validation.pem)放在
/etc/chef
下。我还向我的
~/.bash_档案
中添加了以下内容:

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"]
它找不到你的刀.rb文件。因此,它使用默认配置在localhost上查找chef服务器:

server1.domain.com chef_server_url  "https://localhost:443"

通常,knife.rb位于
~/.chef/knife.rb
中,但它也应该位于
/etc/chef/knife.rb
中。也许你有权限问题?无论如何,我会将其移动到标准的
~/.chef/knife.rb
在节点的
/etc/hosts
文件中添加一个chef服务器条目。

请发布knife.rb文件的内容。Hello@TejayCardon我更新了帖子knife希望找到此文件的默认位置是
~/.chef/knife.rb
-您尝试过吗是否要解决“未找到刀配置文件”?它还试图使用
https://localhost/clients
但是你的刀档案上写着
https://api.opscode.com
。您的配置似乎不止一个问题,因此很难确定从何处开始。您也可以设置一个环境变量:
export KNIFE\u HOME=/path/to/KNIFE\u conf\u directory
在同一工作站上使用多个chef服务器时非常有用。