I’ve installed the couchbase-server 2.0.1 (community edition) on an EC2 instance, everything starts ok, I can get into the web interface, I can connect from a local client, etc.
My next step is to make it so I can access the server from another computer. However, when I follow the instructions on http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-getting-started-hostnames-pre2.0.html (creating an ip_start file), the server can’t start anymore:
sudo /etc/init.d/couchbase-server start
- Failed to start couchbase-server: timed out
The logs show messages like:
… Configured address
[my hostname or public IP] seems to be invalid. Will refuse to to start for safety reasons.
The wrinkle in my setup is this: in order to develop and test against this box, I’ve given it a public IP (through EC2’s elastic IP feature) - basically they assign you a public IP address from their pool and then you map it to your instance. The instance, however, is never aware of this IP address - it still has the loopback interface as well as some internal Amazon IP address - and this seems to be what is causing me problems.
Prior to doing any changes, I just tried connecting with a remote couchbase client (I’ve already opened the necessary firewall ports), and it was able to connect just fine (because at the network layer, everything is working fine). However, operations on the connection object would time out. On closer inspection, I noticed that the connection object had the EC2 instance’s internal IP address as the node identifier (this is with the Python SDK, although I don’t think that really matters):
<couchbase.connection.Connection bucket=uplynk, nodes=[’[my ec2 internal IP]:8091’] at 0x10c878b90>
The connection happened ok because couchbase by default listens on all the interfaces, and traffic via that public IP is properly routed through EC2’s network to my machine. But when couchbase sends back a list of nodes, my node is identified via the internal EC2 IP address, which is not publicly routable. This is what sent me down the path of setting up a static, public IP address for this box. I’ve done that, but now I can’t quite get couchbase to be ok with it.
The IP address is valid, the firewall is open, etc., but since couchbase can’t seem to find that IP in the list of IPs for this box, it doesn’t seem to want to let me use it. i.e. if I do ‘ifconfig’, it’ll list my loopback interface’s 127.0.0.1 address and the other interface it finds will have the internal-to-EC2 IP address.
I’ve also set up a hostname for this box, that maps to the public IP address, and used the above doc link to try and configure couchbase to identify this node via the hostname. But again, same problem occurs, perhaps because couchbase is trying to resolve that hostname, it’s getting back the public IP, and seeing that it doesn’t appear to apply to this box, and refusing to go further.
Sorry for the length of the post, just trying to provide as much detail as possible. In short, I’m looking for some way to make it so that couchbase can be known by an IP address or hostname, but listen on a different IP address.
Even simpler would be if there’s some way for me to override what IP/hostname it uses when it identifies itself in the list of nodes, because the way it is setting up the listen socket is working fine, and I just need it to allow me to override the name/IP that shows up in the list of nodes.
Thanks in advance for any help!