ohadinho
ohadinho

Reputation: 7144

How to test connectivity to couchbase server using .NET sdk?

I'm trying to test connectivity to couchbase server using the .NET sdk.

I've tried to get a test key in order to do it, but I'm getting "null" (instead of getting an exception mention that couchbase server is done).

I've also read this: http://www.couchbase.com/docs//couchbase-manual-2.0/couchbase-getting-st...

But it doesn't say anything about testing connectivity from an application code.

Is there any way of testing connection to couchbase server via code ?

Upvotes: 1

Views: 1096

Answers (1)

scalabilitysolved
scalabilitysolved

Reputation: 2474

The couchbase client sdk manages the connections for you, whatever node urls you pass to it during construction it attempts to authenticate to, if the client can't authenticate to one of the nodes then it throws ConnectException (I'm using the JAVA sdk but I imagine .NET is very similar).

So really you don't have to test the connectivity, the smart client handles that. After construction you can ask the client to list all the available servers

client.getAvailableServers();

Or for a more detailed status of your nodes and statistics do:

client.getStats();

Upvotes: 1

Related Questions