I have a python test where I’m seting up a docker container running Couchbase server and I cannot access that Couchbase server via Couchbase Python SDK (2.0). I’m on Mac OSX and running docker via boot2docker. I’ve read thet this configuration isn’t very good but maybe there is a way it can be done. I have a docker image based on the official Couchbase Server docker image with initialized first cluster and default bucket. Now from my host I’m running the python test where I’m trying to upsert a document into Couchbase:
bucket = Bucket('couchbase://' + HOST + '/default') bucket.upsert('foo', 'bar')
and I’m getting following Error in a line where I do upsert:
LCB_0x2C (generated, catch: CouchbaseNetworkError, CouchbaseTransientError): <Key=u'foo', RC=0x2C[The remote host refused the connection. Is the service up?], Operational Error, Results=1, C Source=(src/multiresult.c,309)>
HOST here is my boot2docker IP,
192.168.59.103, whereas the Couchbase server host IP is something like
172.17.0.1 and the host name is random docker ID
I am able to navigete to Couchbase Server in my browser on
boot2docker:8091 thanks to port forwarding, but I suppose I need to have a public IP on the docker container to be able to connecto to it with Couchbase python SDK.
I suppose I can do all I want with just using the Couchbase REST API via port forwarding, but I thought that the SDK would be a better approach.
So my questions are:
- Is it possible to connect to Couchbase server via python SKD in such scenario?
- What should be the boot2docker, docker and Couchbase settings?