3

我是 couchdb 的新手。我在服务器中运行 python 代码。此代码将数据存储在 couchdb 数据库中。我希望它将数据库存储在我的计算机中。我的代码很简单,如下:

server = Server('http://125.151.58.68:5984/')
db = server['dnsrecords']

当我运行此代码时,我收到以下错误消息:

File "dblookup.py", line 12, in main
    db = server['dnsrecords']
  File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", line 137, in __getitem__
  File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 377, in head
  File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 419, in _request
  File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 239, in request
  File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 205, in _try_request_with_retries

socket.error: [Errno 111] Connection refused
4

2 回答 2

4

运行couchdb -c以查看您的配置文件在哪里,然后编辑local.ini配置文件并取消注释并将bind_address值更改为0.0.0.0,使其绑定到您的所有 IP。

于 2012-07-12T03:23:48.113 回答
0

就我而言,使用 3.1.1 版本,修改 local.ini 文件和 default.ini 没有任何区别。我在文件夹/opt/couchdb/etc/default.d中找到了一个名为10-bind-address.ini的文件,将 127.0.0.1 更改为 0.0.0.0 并且它有效。

于 2021-01-19T04:31:38.167 回答