Paste Python Couchbase into a remote server

I use this code to insert data into Couchbase

from couchbase import Couchbase

c = Couchbase.connect(host="remote-server.com", bucket="default")
c.set('first_key', 'first-_value')

But I got this error:

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

And I tried the following steps:

  • I typed c (Couchbase connection object) out

    Was the object created so that it connects to the Couchbase server successfully?

  • I tried telnet remote-server.com on port 8091, it is successfully connected.
  • Increase the connection timeout to 30 seconds.

But the problem is not resolved.

+4
source share
1 answer

To connect to couchbase, you need to make sure that your server is configured with the name dns remote-server.com, not IP, rather than localhost. And the couchbase server should also be able to get ip through this dns name.

.. AWS EC2, couchbase IP-, 10.X.X.X, ip clien, . REST API dns.

( 8091), couchbase. doc , .

+2

All Articles