1

I recently started an EC2 instance to test some couchdb projects, but for some reason I cannot seem to access the database.

Port 5984 is open on both RHEL and in the security group, but I get cannot connect issues both remotely and locally

Netstat also shows nothing listening on port 5984, even though couchdb is running and configured to listen on port 5984. The service is running, but it is like it isn't doing anything.

Any thoughts?

Andrew Guenther
  • 447
  • 1
  • 4
  • 8
  • Can you please confirm that 5984 is allowed in the EC2 security policy? – jhs Jul 04 '11 at 03:30
  • Sorry! Obviously you already answered this question. I read it wrong. Check my answer below about the listen address. – jhs Jul 04 '11 at 03:33

2 Answers2

2

Check your local.ini file, for the bind address. Perhaps the port is correct but the address is wrong. (By default, CouchDB only listens for local connections.)

[httpd]
    # ... snip other stuff ...
    bind_address = 127.0.0.1

Change to:

[httpd]
    bind_address = 0.0.0.0

And restart couch. Did that help?

jhs
  • 989
  • 1
  • 8
  • 13
  • If this answer is incorrect (I am nervous because you say local connections are also down), then would you mind updating your question indicating whether or not the logs show any information at all. The logs may have errors or not, but either way, that is a clue. – jhs Jul 04 '11 at 03:36
  • I have tried changing the bind_address in the local.ini, I will check the logs in the morning – Andrew Guenther Jul 05 '11 at 07:51
  • So I just booted up a new instance and the first thing I did was install couch and change the local.ini file, no idea what the issue was on the other instance, but it works now. Thank you so much! (So much for going to bed an hour ago) – Andrew Guenther Jul 05 '11 at 08:47
1

I had the same problem: service "running" but not logging anything and no port opened. The cause is the following: I tried running couchdb as root directly after installing and before running it as a service. It created the log and db files with owner set to root, so when it was run as the proper service it couldn't access the files and couldn't even log about the problem. I deleted the /var/log/couchdb/couch.log and cleared /var/lib/couchdb and it seems to work now.

Maybe it was not the cause in your case, but the symptoms look pretty similar.

slm
  • 7,615
  • 16
  • 56
  • 76
fizmat
  • 11
  • 1