.Net client with views, plus a load balancing question

I have a two-part question and am hoping someone can steer me in the right direction.

  1. We’re using the latest .Net client and are having an issue querying views. It seems the app is trying to authenticate to the REST endpoint with the bucket credentials instead of the web console user and password. For the moment we’re just building the REST endpoint dynamically and manually parsing the JSON response. Any idea what’s going on?

  2. To make our config simple we would like to put the CouchBase nodes behind Network Load Balancing (Windows Server 2012) and just put the cluster virtual IP address in the web.config file. They’re set up in a cluster, with replication (two nodes), using CouchBase buckets. Would that scenario work, or is there a “gotcha” in there somewhere?

Hello,

  1. I am not sure to understand
  • are you building the REST URL to call the view in your code?

this is not best approach. When working with Client SDK, in you case .Net SDK, you should simply use the View APIs from the SDD.
the SDK is then responsible to call the View (using REST) and will manage security and load balancing.

You can find some information about .Net SDK and Views in the documentation:

  1. So if you are using the Couchbase .Net client library and the Views API you should not need to put a load balancer between your application code and your Couchbase nodes. The SDK itself will manage the load balancing between the nodes.

Do not hesitate to ask for more information/comments if needed.

Regards
Tug

It looks like we figured it out. All we have to do is add the web user’s username and password to the “servers” element of the configuration section (“username” and “password” are the attribute keys) and our calls to GetView work now.

Is there a schema for that config section anywhere?

When we use the .Net client it appears to try and authenticate to the REST API on port 8092 using the bucket name as the username and the bucket password as the password, instead of the Administrator user account and password. When we manually make our call to the REST API with the Administrator credentials the call works and we get JSON.

Do the credentials set up for the buckets allow for authentication against the REST API exposed by CouchBase Server? I would much rather use the config section and the GetView code as it is intended to be used, but this particular issue is a problem for us. We can see on the object there are properties for both a bucket user/pass and another user/pass, and were going to use the connection object as a base class and set those values ourselves in code.

Also, I’m not sure it matters, but we have deleted the default bucket. Don’t know if that makes a difference.

Hi,

You are correct, we have documented all this in the “Configuring the .Net Client Library” Chapter:

http://www.couchbase.com/docs/couchbase-sdk-net-1.2/couchbase-sdk-net-co

regards
Tug