How can access the couchbase server by the trial cluster url: cb.0vdvh7f0u4aily78.cloud.couchbase.com

how can i access the couchbase cloud Capella server by the trial cluser url: cb.0vdvh7f0u4aily78.cloud.couchbase.com

when i ping the host url, the result is:
ping: cannot resolve cb.0vdvh7f0u4aily78.cloud.couchbase.com: Unknown host

and when i use the sdk to access the couchbase cloud, the result is timeout

so how can i access the couchbase cloud trial cluster. by the curl tools, like : curl -i http://ip:port
anyone can help me to figure it out, than you

Hello @zepeng_chen.

Welcome to the Couchbase forums!

The connection string given in the Capella UI is a SRV record, so you can’t ping it directly. You first need to resolve it using a command like this:

nslookup -type=SRV _couchbases._tcp.cb.xxxxxxxxxxxxxxx.cloud.couchbase.com

The above command will resolve the SRV record to individual hosts in the cluster. The hosts can be then be used to connect to the cluster through curl for example.

When using the most recent version of all our SDKs you can use the SRV record in the connection string and the SDK will resolve the SRV record to a host in the cluster, this is outlined in our documentation, for example here for the go sdk: Install and Start Using the Go SDK with Couchbase Server | Couchbase Docs.

Please also note that before you can connect to your Capella cluster (using curl or an SDK) you must allow your IP as outlined here : Configure Allowed IP Addresses | Couchbase Docs.

Please feel free to update here if anything is unclear.

Regards,

Adam

yes, i can get the cluster host by nslookup,
but when i use the SRV record in go lastest sdk to connect the cluster server,
i had add my ip to allowed ip list, it always timeout err

like this:
unambiguous timeout | {“InnerError”:{“InnerError”:{“InnerError”:{},“Message”:“unambiguous timeout”}},“OperationID”:“WaitUntilReady”,“Opaque”:"",“TimeObserved”:5000264187,“RetryReasons”:[“NOT_READY”,“CONNECTION_ERROR”],“RetryAttempts”:12,“LastDispatchedTo”:"",“LastDispatchedFrom”:"",“LastConnectionID”:""}

sdk version: “github.com/couchbase/gocb/v2
the endpoint is:

endpoint := “_couchbases._tcp.cb.xxxxxxxxxxxx.cloud.couchbase.com”
endpoint := “cb.xxxxxxxxxxxx.cloud.couchbase.com
both are timeout err

Hi @zepeng_chen,

Thanks for sharing the timeout error. However it will be helpful if you could provide actual SDK logs for us to debug it further.

Have you tried validating the connectivity using the SDK Doctor? This will at least help us see whether the connectivity to Capella works in the general case.

You can also try reading this about managing connections and use CA certificate to connect to the cluster.

Please feel free to reply if you need further help on this.

Regards,
Kervi

thank you very much! i use the couchbase doctor connect success and use the go-sdk/v2 is success too.
but when i use the curl command in the linux shell to connect the cluster host,it sitll can not access

i get the cluster host : pz76ru7zloixqchn.xxxxxxx.cloud.couchbase.com and port: 11207 by nslookup -type=SRV

when i use curl tool just like below:
curl -u $username:$password
http://pz76ru7zloixqchn.0vdvh7f0u4aily78.cloud.couchbase.com:11207/pools
it occur error: curl: “(56) Recv failure: Connection reset by peer”

i don’t know why, and when i use the go-sdk/v1 it still have the error: timeout

so can you give a example of curl to access the couchbase capella?

Hi @zepeng_chen,

My suggestion is to use port 18091 instead of 11207 because 11207 is for data traffic by the SDKs and does not respond to http requests. You also need to use https since all Capella traffic is encrypted.

So, you should be able to use the following:

curl -u $username:$password https://pz76ru7zloixqchn.0vdvh7f0u4aily78.cloud.couchbase.com:18091/pools

Please take note that you may also need to apply -k to the curl command to disable SSL checking if you haven’t added the root certificate to your local machine.

You may also find this article helpful which shows all the compatible SDK versions supported by Capella. For Go, it specifically mentioned the following:

With Go 1.6, which does not have the Alternate Address feature, you need to use ?network=default in the connection string.

Thanks,
Kervi