Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chef infra 节点连接到chef服务器,工作站连接到chef服务器,但引导同一节点失败_Chef Infra_Knife - Fatal编程技术网

Chef infra 节点连接到chef服务器,工作站连接到chef服务器,但引导同一节点失败

Chef infra 节点连接到chef服务器,工作站连接到chef服务器,但引导同一节点失败,chef-infra,knife,Chef Infra,Knife,我有3个组件:节点、服务器和工作站。我没有设置这些。我可以从工作站运行刀状态,它返回当前结果(我相信这确认了从工作站到服务器的连接)。我可以从节点本身成功地运行chef client(我相信这会确认节点到服务器的连接+很明显它已经启动) 但再次尝试引导失败。我发现一件奇怪的事情是,我注意到工作站上的/etc/chef/client.rb文件的node_name行被替换为我试图引导的节点的名称。也许这很正常 我无法解决的一件事是,这个错误使它看起来像/someone/无法连接到chef服务器;但是

我有3个组件:节点、服务器和工作站。我没有设置这些。我可以从工作站运行刀状态,它返回当前结果(我相信这确认了从工作站到服务器的连接)。我可以从节点本身成功地运行chef client(我相信这会确认节点到服务器的连接+很明显它已经启动)

但再次尝试引导失败。我发现一件奇怪的事情是,我注意到工作站上的/etc/chef/client.rb文件的node_name行被替换为我试图引导的节点的名称。也许这很正常

我无法解决的一件事是,这个错误使它看起来像/someone/无法连接到chef服务器;但是,如上所述,我确认工作站和节点都可以身份验证并连接到chef服务器

我一直在看文档,但一个巨大的问题是模棱两可。它会说“某些东西位于/etc/chef/client.rb中”-好的,但是在节点、服务器或工作站上?他们都有这个文件

我想这可能是我的钥匙,它在工作站上的~/.chef/knife.rb中由“client_key”行指示——但我不想更改它,以免我失去与服务器的连接。但很明显,似乎在某个地方出现了身份验证故障——除了在引导过程中,我在任何地方都找不到它

[root@workstation chef]# cat client.rb
log_location     STDOUT
chef_server_url  "https://chefserver/organizations/domain"
validation_client_name "domain-validator"
node_name "workstation"
ssl_verify_mode :verify_none
trusted_certs_dir "/etc/chef/trusted_certs"

[root@workstation chef]# knife bootstrap node.domain.goes.here -N node -x user -i /home/user/.ssh/id_rsa --sudo --use-sudo-password --node-ssl-verify-mode none -r recipe[chef-client]
Doing old-style registration with the validation key at ~/.keys/domain-validator.pem...
Delete your validation key in order to use your user credentials instead

Connecting to node.domain.goes.here
node.domain.goes.here -----> Existing Chef installation detected
node.domain.goes.here Starting the first Chef Client run...
node.domain.goes.here Starting Chef Client, version 12.10.24
node.domain.goes.here
node.domain.goes.here ================================================================================
node.domain.goes.here Chef encountered an error attempting to load the node data for "node"
node.domain.goes.here ================================================================================
node.domain.goes.here
node.domain.goes.here Authentication Error:
node.domain.goes.here ---------------------
node.domain.goes.here Failed to authenticate to the chef server (http 401).
node.domain.goes.here
node.domain.goes.here Server Response:
node.domain.goes.here ----------------
node.domain.goes.here Invalid signature for user or client 'node'
node.domain.goes.here
node.domain.goes.here Relevant Config Settings:
node.domain.goes.here -------------------------
node.domain.goes.here chef_server_url   "https://chefserver/organizations/domain"
node.domain.goes.here node_name         "node"
node.domain.goes.here client_key        "/etc/chef/client.pem"
node.domain.goes.here
node.domain.goes.here If these settings are correct, your client_key may be invalid, or
node.domain.goes.here you may have a chef user with the same client name as this node.
node.domain.goes.here
node.domain.goes.here Platform:
node.domain.goes.here ---------
node.domain.goes.here x86_64-linux
node.domain.goes.here
node.domain.goes.here
node.domain.goes.here Running handlers:
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: Running exception handlers
node.domain.goes.here Running handlers complete
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: Exception handlers complete
node.domain.goes.here Chef Client failed. 0 resources updated in 01 seconds
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
node.domain.goes.here [2016-12-13T13:51:26-05:00] ERROR: 401 "Unauthorized"
node.domain.goes.here [2016-12-13T13:51:26-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

[root@workstation chef]# cat client.rb
log_location     STDOUT
chef_server_url  "https:/chef/organizations/domain"
validation_client_name "domain-validator"
node_name "node"
ssl_verify_mode :verify_none
trusted_certs_dir "/etc/chef/trusted_certs"

您的组织中可能已经有一个与该名称匹配的客户。通过
knife client delete将其删除

您的组织中可能已经有一个与该名称匹配的客户。通过
knife client delete将其删除

据我所知,您正在尝试使用新名称再次引导,但这无法工作。 该节点已经启动,并且它已经有一个客户机的client.pem文件,该客户机的旧名称为
old name

Chef不会尝试注册名为
new\u name
node
)的新客户端,因为client.pem在这里。但它将使用
new\u name
,结果是客户端
new\u name
正在尝试使用其他人的密钥进行身份验证

对于chef服务器,
new\u name
不存在,因此无法对其进行身份验证

我不确定为什么要再次引导,因此有两种解决方案:

  • 如果要更改节点名称,请删除节点上的client.pem文件,然后再次运行引导命令
  • 您希望在节点上再次运行chef,在本例中,使用您想要的任何东西,测试模型可以使用ssh-x user-i/home/user/.ssh/id\u rsa'name:old\u name''sudo chef client-r'new\u runlist'
  • 要删除client.pem,还可以通过ssh来完成


    若要在命令行中传递密码,请参见,如果您没有在两个命令前都添加空格,请注意密码将显示在进程列表和shell历史记录中。

    据我所知,您正在尝试使用新名称重新引导,但这无法工作。 该节点已经启动,并且它已经有一个客户机的client.pem文件,该客户机的旧名称为
    old name

    Chef不会尝试注册名为
    new\u name
    node
    )的新客户端,因为client.pem在这里。但它将使用
    new\u name
    ,结果是客户端
    new\u name
    正在尝试使用其他人的密钥进行身份验证

    对于chef服务器,
    new\u name
    不存在,因此无法对其进行身份验证

    我不确定为什么要再次引导,因此有两种解决方案:

  • 如果要更改节点名称,请删除节点上的client.pem文件,然后再次运行引导命令
  • 您希望在节点上再次运行chef,在本例中,使用您想要的任何东西,测试模型可以使用ssh-x user-i/home/user/.ssh/id\u rsa'name:old\u name''sudo chef client-r'new\u runlist'
  • 要删除client.pem,还可以通过ssh来完成


    要在命令行中传递密码,请参见,如果您没有在两个命令前都使用空格,请注意密码将显示在进程列表和shell历史记录中。

    再次引导时,我遇到了类似的问题。调试之后,我发现当它(引导)第一次完成时,它在节点的etc文件夹中创建了一个chef文件。我删除了那个文件夹并再次启动。这对我很有效。

    我在再次引导时遇到了类似的问题。调试之后,我发现当它(引导)第一次完成时,它在节点的etc文件夹中创建了一个chef文件。我删除了那个文件夹并再次启动。这对我有用