我一直在试图在我的webfusion虚拟服务器上安装CouchDB。 我遵循webfusion论坛的最新指示(见: http : //forum.webfaction.com/viewtopic.php? id=2355),它运行(只)蒲团是非常缓慢,我得到502错误。 无论如何,当我运行testing套件时,它会在多个testing中失败。 Webfaction支持非常好,但没有erlang的经验来解释错误日志。 任何人都可以帮助我知道什么可能是错的?
testing套件结果:基础,all_docs,附件,attachments_multipart,attachment_names,compact,config,conflict,delayed_commits,design_docs,design_options
所有的错误是:
引发exception:{“error”:“unknown”,“reason”:“\ u000d \ u000a502 Bad Gateway \ u000d \ u000a \ u000d \ u000a502 Bad Gateway \ u000d \ u000a
nginx的\ u000d \ u000a \ u000d \ u000a \ u000d \ u000a“}
除了“紧凑” 其中还有:
断言失败:xhr.responseText ==“这是一个base64编码文本”断言失败:xhr.getResponseHeader(“Content-Type”)==“text / plain”
我很难过
有人知道这些是什么意思?
AL
我也有这个问题。 似乎这是一个nginx-CouchDB通信问题。 在“基本”testing的中间,有一个命令来重新启动CouchDB。 之后,nginx日志看起来像这样:
2010/12/02 03:21:09 [error] 708#0: *132 upstream prematurely closed connection while reading response header from upstream, client: 70.205.249.118, server: localhost, request: "POST /_restart HTTP/1.1", upstream: "http://127.0.0.1:5984/_restart", host: "79.125.20.163", referrer: "http://79.125.20.163/_utils/couch_tests.html?script/couch_tests.js" 2010/12/02 03:21:10 [error] 708#0: *132 connect() failed (111: Connection refused) while connecting to upstream, client: 70.205.249.118, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5984/", host: "79.125.20.163", referrer: "http://79.125.20.163/_utils/couch_tests.html?script/couch_tests.js" 2010/12/02 03:21:10 [error] 708#0: *132 connect() failed (111: Connection refused) while connecting to upstream, client: 70.205.249.118, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:5984/", host: "79.125.20.163", referrer: "http://79.125.20.163/_utils/couch_tests.html?script/couch_tests.js"
这意味着在重置之后,CouchDB主动拒绝连接,我们只需要提出另外一个或两个请求。
解决的方法是在nginxconfiguration中添加这样的内容,以便在向用户显示错误之前创build5个请求(请注意max_fails部分):
upstream couchdb { server 127.0.0.1:5984 max_fails=5 fail_timeout=30s; } server { ... location / { proxy_pass http://couchdb; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
希望这可以帮助。
更新:经过一些testing,这种方法也没有帮助。 nginx使得请求太快。 也许有人有足够的知识来阐述?