首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Chef 502错误的网关

Chef 502错误的网关
EN

Stack Overflow用户
提问于 2014-07-30 20:06:25
回答 3查看 5.5K关注 0票数 1

这个主题可能看起来是重复的,但我还没有找到关于如何解决问题的正确或一致的答案。Chef服务器在一段时间前还在工作,但现在它给出了这个Nginx网关错误。

刀子命令和chef服务器UI都不起作用。

代码语言:javascript
复制
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>

主机文件:

代码语言:javascript
复制
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

接口文件:

代码语言:javascript
复制
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 status输出:

代码语言:javascript
复制
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测试输出:

代码语言:javascript
复制
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
EN

回答 3

Stack Overflow用户

发布于 2015-08-25 08:35:12

我也遇到过这种情况。

tl;dr

代码语言:javascript
复制
sudo chef-server-ctl upgrade

警告:我的组织和用户等已保留,但您的结果可能会有所不同。

我怀疑发生的事情是chef-server-core包被更新了。(一个粗心的apt-get升级可以做到这一点,我在崩溃和重启后注意到了它。)我不应该使用被动语态,但我肯定不记得我这样做过。

我为后人准备的故障排除步骤。

代码语言:javascript
复制
sudo chef-server-ctl stop
sudo chef-server-ctl start
sudo chef-server-ctl tail

我反复看到这一点。

代码语言:javascript
复制
==> /var/log/opscode/rabbitmq/current <==
2015-08-23_23:51:22 mkdir: cannot create directory '/opt/opscode/embedded/service/rabbitmq/sbin/../var': Permission denied

这很奇怪。那个"..“路径中是指向软件版本之间的配置更改的线索。也许chef deb包被错误地升级了,配置需要更新以匹配(recall chef server就像一打协同工作的服务)

代码语言:javascript
复制
sudo chef-server-ctl upgrade

现在我的测试通过了,我的客户可以连接了,我可以从

代码语言:javascript
复制
knife status 
票数 1
EN

Stack Overflow用户

发布于 2014-12-03 09:19:53

试试这个: sudo chef-server-ctl hup

票数 0
EN

Stack Overflow用户

发布于 2015-05-30 02:40:21

阅读崩溃日志。

代码语言:javascript
复制
/var/log/opscode/opscode-erchef/

它肯定会有502的原因。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25036414

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档