Server为所有刀和Chef

Server为所有刀和Chef

本文介绍了Chef Server为所有刀和Chef-Client请求返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置Chef-server和Chef-client,以在Openstack上运行的虚拟机上自动部署软件包。

I am trying to setup chef-server and chef-client for automatic deployment of packages on virtual machines run on Openstack.

我正在按照。软件包的版本是ubuntu 14.04服务器上的Chef-server 12.0.8(chef-server-core_12.0.8-1_amd64.deb)。已经进行了多次尝试,始终使用干净的机器,并且始终使用相同的结果,即使使用稍旧的厨师服务器版本(我相信是12.0.3)也是如此。创建用户,创建组织。我还通过提供的install.sh脚本(12.3.some)从厨师站点直接拉了厨师客户。

I am following the instructions on https://docs.chef.io/install_server.html. The version of the package is chef-server 12.0.8, on ubuntu 14.04 server (chef-server-core_12.0.8-1_amd64.deb). Several attempts have been made, always with a clean machine, and always with the same result, even with a slightly older chef-server version (12.0.3, I believe). User gets created, organization gets created. I've also pulled chef client directly from chef site, via the install.sh script provided (12.3.something).

症状:

刀ssl检查返回成功,但是:

刀客户端列表返回HTTP错误404:

knife client list returns HTTP error 404:

错误:找不到您要查找的对象
...

ERROR: The object you are looking for could not be found...

对不起,我找不到您想要的东西。

Sorry, I can't find what you are looking for.

是直接从服务器运行还是从另一台计算机运行都无关紧要(刀引导程序也失败,因此我手动安装)。服务器(FQDN:chef.cluster.internal)可以在所有计算机上解析,这就是用于client.rb / knife.rb的server_url。

Doesn't matter if I run it from server directly, or from another machine (knife bootstrap also fails, so I install manually). The server (FQDN: chef.cluster.internal) is resolvable from all machines, and that is the server_url used for client.rb/knife.rb. Self-signed certificate is pulled everywhere where needed.

厨师服务器上的Nginx访问日志:

Nginx access logs from chef-server machine:

192.168.10.85 - - [15/May/2015:12:16:56 +0000]  "GET /clients HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T12:16:56Z" "2jmj7l5rSw0yVb/vlWAYkK/YBwk=" 995
192.168.10.85 - - [15/May/2015:11:38:50 +0000]  "POST /nodes HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T11:38:50Z" "5FBeTmym0Tm05estESshBGJrumI=" 1047
192.168.10.86 - - [15/May/2015:11:37:36 +0000]  "POST /nodes HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T11:37:36Z" "5FBeTmym0Tm05estESshBGJrumI=" 1047
192.168.10.85 - - [15/May/2015:11:38:50 +0000]  "PUT /nodes/dns-server HTTP/1.1" 404 "0.001" 617 "-" "Chef Knife/12.3.0 (ruby-2.1.4-p265; ohai-8.3.0; x86_64-linux; +http://opscode.com)" "-" "-" "-" "12.3.0" "algorithm=sha1;version=1.0;" "ubuntu" "2015-05-15T11:38:50Z" "5FBeTmym0Tm05estESshBGJrumI=" 1057

。 。 等等。因此,服务器确实收到了请求,而厨师客户的建议我的Chef_server_url可能无效。

... and so on. So, the server does get the request, and the suggestion from chef-client that my chef_server_url might be invalid is not true.

所有其他设置均保留为默认设置。奇怪的是,我有一个比较老的厨师设置,从两个或三个月前开始,就可以正常工作。

All other settings have been left as default. The strange thing is that I have an older chef setup, from two or three months ago, that works without problems.

我没主意了。任何帮助都将受到欢迎和高度赞赏。

I'm out of ideas. Any help would be most welcome and highly appreciated.

编辑1:
我刚刚导入了创建的用户证书,并且厨师nginx证书到提到的较旧的刀安装,并且我能够成功运行刀客户端列表。因此,似乎本地版本将/ organizations / orgname / nodes包含在请求中。为什么在空白客户端上缺少该链接?

Edit 1:I've just imported the created user certificate, and the chef nginx certificate to the mentioned knife older installation, and I am successfully able to run knife client list. So, it seems that the local version includes /organizations/orgname/nodes into request. Why is that missing on the blank client?

推荐答案

好,所以我能够通过重新配置刀和厨师客户端来取得进展在服务器上具有旧计算机上生成的完整Chef_server_url。

Ok, so I was able to make progress by reconfiguring knife and chef-client on server with the full chef_server_url as generated on the older machine.

这篇关于Chef Server为所有刀和Chef-Client请求返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:53