我在openhift上有一个正在进行中的django应用程序,在过去的几天里它已经停止在浏览器中完全响应。
我仍然可以使用它,我可以部署到它,并且openshift.redhat.com界面不会报告应用程序的任何错误,但是通过浏览器请求任何页面都不会给出任何响应。浏览器只是一直说“等待appname-user.rhcloud.com”。
日志可能会提供一些见解。
rhc tail appname
==> app-root/logs/python.log <==
Unable to open logs
(98)Address already in use: make_sock: could not bind to address 127.8.172.129:8080
no listening sockets available, shutting down
Unable to open logs
(98)Address already in use: make_sock: could not bind to address 127.8.172.129:8080
no listening sockets available, shutting down
Unable to open logs
... (ad infinitum)
我不认为它在部署之后停止响应,它正在工作,然后它不是。不知道发生了什么。
对于可能导致此问题或如何调试/解决问题的任何想法表示感谢。
根据胖幻想的建议,我尝试了一个强制停止/启动循环,这就是记录的内容:
$ rhc app force-stop -a notebook
$ rhc app start -a notebook
$ rhc tail notebook
==> app-root/logs/python.log <==
(98)Address already in use: make_sock: could not bind to address 127.8.172.129:8080
no listening sockets available, shutting down
Unable to open logs
(98)Address already in use: make_sock: could not bind to address 127.8.172.129:8080
no listening sockets available, shutting down
Unable to open logs
[Sun Nov 16 01:26:13 2014] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:openshift_t:s0:c4,c359
[Sun Nov 16 01:26:13 2014] [notice] Digest: generating secret for digest authentication ...
[Sun Nov 16 01:26:13 2014] [notice] Digest: done
[Sun Nov 16 01:26:13 2014] [notice] Apache/2.2.15 (Unix) mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
==> app-root/logs/postgresql.log <==
2014-11-16 06:26:05 GMT LOG: trying another address for the statistics collector
2014-11-16 06:26:05 GMT LOG: could not bind socket for statistics collector: Cannot assign requested address
2014-11-16 06:26:05 GMT LOG: disabling statistics collector for lack of working socket
2014-11-16 06:26:05 GMT WARNING: autovacuum not started because of misconfiguration
2014-11-16 06:26:05 GMT HINT: Enable the "track_counts" option.
2014-11-16 06:26:06 GMT LOG: database system was interrupted; last known up at 2014-11-15 07:33:35 GMT
2014-11-16 06:26:06 GMT LOG: database system was not properly shut down; automatic recovery in progress
2014-11-16 06:26:06 GMT LOG: record with zero length at 0/1D48850
2014-11-16 06:26:06 GMT LOG: redo is not required
2014-11-16 06:26:06 GMT LOG: database system is ready to accept connections
我可能是错的,但我仍然有这种感觉应用程序很好,它可能是DNS相关的东西。我尝试了我的应用网址(http://notebook-davur.rhcloud.com)的DNS跟踪,跟踪以此块结束:
Sending request to "ns3.p23.dynect.net" (208.78.71.23)
Received authoritative (AA) response:
-> Header: Non-Existent Domain
答案 0 :(得分:0)
以&#39; rhc app-force-stop&#39;开头。然后重新启动它。然后再次崩溃时查看日志。
答案 1 :(得分:0)
我很确定这不是代码问题,因为问题在部署任何更改后都没有立即启动。为了验证问题是否与代码无关,我创建了一个新应用并将相同的代码推送到它。
$ rhc app create newappname python-2.7
$ rhc cartridge add postgresql-9.2 -a newappname
记下app create
命令后返回的Git URL。
$ git remote add newapptest GIT_URL
$ git push newapptest --force
$ open http://newapptest-mydomain.rhcloud.com
瞧瞧!它奏效了。
因为这只是一个没有重要数据的爱好项目
数据库,我继续通过Web界面将其删除,并且
重新运行上述命令,将newappname
替换为originalappname
而不是将其添加为新的git remote
我更新的远程指向
到现在的原始/现在删除的应用程序。
$ git remote set-url openshift GIT_URL
(注意:数据库中的所有数据都会随应用程序删除,所以如果 数据以pg_dump开头,以pg_restore开头
我的原始网址再次响应。我很确定这与Openshift自己的设置有关,可能是DNS等。