主题可能会重复,但我还没有找到关于如何解决问题的正确或一致的答案。厨师服务器工作了一段时间,但现在它正在给出这个Nginx网关错误。
刀具命令和厨师服务器UI都不起作用。
root@ubuntu:/opt/chef-server/embedded/sbin# knife role list
[fog][WARNING] Unable to load the 'unf' gem. Your AWS strings may not be properly encoded.
ERROR: bad gateway
Response: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.2.3</center>
</body>
</html>
主持文件:
root@ubuntu:/opt/chef-server/embedded/sbin# vi /etc/hosts
root@ubuntu:/opt/chef-server/embedded/sbin# cat /etc/hosts
127.0.0.1 localhost
10.44.189.9 ubuntu.xxxx.co.in ubuntu
接口文件:
root@ubuntu:/opt/chef-server/embedded/sbin# cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.44.189.9
netmask 255.255.254.0
gateway 10.44.188.1
输出chef-server-ctl状态:
root@ubuntu:/opt/chef-server/embedded/sbin# chef-server-ctl status
run: bookshelf: (pid 1287) 91369s; run: log: (pid 1279) 91369s
run: chef-expander: (pid 1293) 91369s; run: log: (pid 1281) 91369s
run: chef-server-webui: (pid 1283) 91369s; run: log: (pid 1278) 91369s
run: chef-solr: (pid 1294) 91369s; run: log: (pid 1290) 91369s
run: erchef: (pid 6950) 0s; run: log: (pid 1282) 91369s
run: nginx: (pid 27070) 1912s; run: log: (pid 1857) 2542s
run: postgresql: (pid 28153) 34153s; run: log: (pid 1289) 91369s
down: rabbitmq: 1s, normally up, want up; run: log: (pid 1288) 91369s
root@ubuntu:/opt/chef-server/embedded/sbin#`
chef-server-ctl测试的输出:
root@ubuntu:/opt/chef-server/embedded/sbin# chef-server-ctl test
Configuring logging...
Creating client pedant_admin_client...
Encountered an error attempting to create client pedant_admin_client
Response Code was: 502
Response Body was: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.2.3</center>
</body>
</html>
..
Exception during Pedant credentials setup
RuntimeError
..
Finished in 0.05734 seconds
0 examples, 0 failures
答案 0 :(得分:0)
试试这个:sudo chef-server-ctl hup
答案 1 :(得分:0)
阅读崩溃日志。
/var/log/opscode/opscode-erchef/
肯定会有502的原因。