Shnkc
Shnkc

Reputation: 2158

How to connect to remote couchdb database

I am new in couchdb. I am running a python code in a server. This code stores data in a couchdb database. I want it to store the database in my computer. My code is very simple and the following one:

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

When I run this code , I get the following error messages:

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

Upvotes: 4

Views: 6070

Answers (2)

Philippe Delteil
Philippe Delteil

Reputation: 1265

In my case, using version 3.1.1, modifying the local.ini file and default.ini didn't make any difference. I found a file called 10-bind-address.ini inside folder /opt/couchdb/etc/default.d changed 127.0.0.1 to 0.0.0.0 and it worked.

Upvotes: 0

smathy
smathy

Reputation: 27961

Run couchdb -c to see where your config files are, and then edit the local.ini config file and uncomment and change the bind_address value to 0.0.0.0 so it's bound to all your IPs.

Upvotes: 5

Related Questions