I’m having trouble using Couchbase for my web app. This is slowly killing me and I really, really want to use this as my DataStore, I just can’t get my web app to connect to Couchbase.
My web app is one container and my Couchbase instance another, I’m not using Linux so I’m using Docker Machine on my Mac.
Mac OSX El Capitan
Docker 1.10.3
Couchbase (couchbase latest container is used)
Express (node v6, couchbase node module v2.2.5 on Ubuntu 16)
Node app.js code (sample express code)
const couchbase = require('couchbase');
(I have tried my docker machine IP the server node IP and no luck)
const cluster = new couchbase.Cluster('localhost:8091');
const bucket = cluster.openBucket('travel-sample', (error, response) => {
if (error) {
throw error;
}
console.log(response);
});
bucket.operationTimeout = 60 * 1000;
My application error: CouchbaseError: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout.
I’m set up accessing the Couchbase UI on http://192.168.99.100:8091 and using the travel-sample data.
Bash code example
docker run -d --name my-db -p 8091-8094:8091-8094 -p 11210:11210 couchbase
I’m not using the --link
arg to assign the Couchbase container to the web container (I have tried this but no luck).
I will really appreciate the help!
Thanks, Thomas.