Timeout when using remote couchbase an AWS ec2

For development purposes, I want to connect my local machine to couchbase installed on remote ec2. I success in making the connection, but I get timeout when I try to access the data.

I've search for the problem and found here, that the problem is probably related to the fact that couchbase returned the internal IP, which cannot be used outside of AWS.

However, I did not find any solution to this. Any idea?

Thanks.

This is my output:

In [19]: c = couchbase.Couchbase().connect(host='107.20.181.77',bucket='amit')

In [20]: c
Out[20]: <couchbase.connection.Connection bucket=amit, nodes=['10.185.248.101:8091'] at 0x2f20870>

In [21]: c.set("12345",{'a':100})
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
<ipython-input-21-4df1cb7c8c9a> in <module>()
----> 1 c.set("12345",{'a':100})

/usr/local/lib/python2.7/dist-packages/couchbase/connection.pyc in set(self, key, value, cas, ttl, format, persist_to, replicate_to)
    318         """
    319         return _Base.set(self, key, value, cas, ttl, format,
--> 320                          replicate_to, persist_to)
    321 
    322     def add(self, key, value, ttl=0, format=None, persist_to=0, replicate_to=0):

TimeoutError: <Key=u'12345', RC=0x17[Operation timed out], Operational Error, Results=1, C Source=(src/multiresult.c,286)>

Answers


Same issue exists in pretty much all cloud platforms. The nodes names or IP addressed is what the client will use to connect to the nodes of the cluster. For apps connecting over the internet the private IPs don't work. The workaround is to use public names or IP addresses for the nodes. If you'd like some additional efficiency, You can still use DNS trickery to ensure local communication still goes over the private IPs but ensuring the names resolve to private IPs between nodes. Don't have a AWS specific post but this one on Azure may help: http://blog.couchbase.com/step-step-production-deployment-couchbase-windows-azure-virtual-machines Hope this helps.


Been having the same issue. Like Cihan B it seems to be a problem with Couchbase resolving private IPs.

I have attempted to follow this tutorial Steps 1-7 https://blog.couchbase.com/cross-data-center-replication-step-step-guide-amazon-aws

A working fix alternatively is stop the server, delete the config file and restart the server. You can now configure the IP address inside the web app.


I encountered the same issue, and the reason for that is once you connect to it, it will return its own internal topology, so if you create the cluster using private ip address, it will return you private ip which means you can not connect to it outside of AWS

the way to solve it is: 1) remove the node out from cluster

2) rebalance

3) add it back by using its public dns name (public ip address won't work as you can see from: https://issues.couchbase.com/browse/MB-8985)

4) rebalance it again

repeat above for all nodes, hope you don't have too many nodes in you cluster...


Need Your Help

How to redirect referrer page to test.html via htaccess?

php wordpress .htaccess redirect

I want to redirect anyone who is coming from domain.com to test.html using htaccess.

Recreate localDiskDb.db in Sails.js

javascript node.js model-view-controller sails.js

So I deleted the file .tmp/localDiskDb.db manually and now when Sails generates it on start its empty, Is there a way to make Sails to recreate it based on my models?