0

I have a couchbase-server in docker on a GCE instance.

tried using this package https://godoc.org/github.com/couchbase/go-couchbase#GetBucket and followed the example, but I get a timeout error.

2015/04/06 17:32:34  Trying with selected node 0
2015/04/06 17:33:49  HTTP request returned error Get     http://172.17.0.2:8092/default/_design/someKey: dial tcp 172.17.0.2:8092: operation timed out
2015/04/06 17:33:49 error Get http://172.17.0.2:8092/default/_design/someKey: dial tcp 172.17.0.2:8092: operation timed out
exit status 1

I tried executing my golang script on the same host as my docker and it works fine. but from other machine, or local, it won't work

Hokutosei
  • 2,114
  • 5
  • 24
  • 42

2 Answers2

1

There is a fairly aggressive timeout in most of the Couchbase SDKs, as they expect to be close to the cluster.

I expect that's why you're seeing the timeout in the example above but not when the client and server are co-located.

0

Adding SO_TIMEOUT=8000 and CONNECTION_TIMEOUT=12000 to the environment variables worked for me. Granted. I am using node.js, but this solution doesn't seem language specific so it would be a good starting point.

Brett
  • 11,637
  • 34
  • 127
  • 213