Catalin
Catalin

Reputation: 11721

Couchbase not working in Asp.net

I installed Cachebase Server on Windows Server 2008 R2 with Service Pack 1 installed, with default setup.

Now, i am trying to test the server, and is not working. This is what i have:

class Program
{
    static void Main(string[] args)
    {
        var config = new CouchbaseClientConfiguration();
        config.Urls.Add(new Uri("http://192.168.1.4:8091/pools/default"));
        config.Bucket = "default";
        var client = new CouchbaseClient(config);

        // this line of code takes about 10-15 seconds to execute, and always returns false
        bool result = client.Store(StoreMode.Set, "key_10", "value to save", TimeSpan.FromMinutes(5));

        // this line of code always returns null
        var savedValue = client.Get("key_10");
    }
}

What i am doing wrong? I don't think it has anything to do with firewall, because when i access the url in a browser, it returns me a Json object.

Upvotes: 0

Views: 248

Answers (2)

Daniel
Daniel

Reputation: 8388

Are you running the app on the server or another machine? You are mentioning the Firewall so I guess you have ensured the correct ports are opened as described here

The reason why I'm asking is because I do think there's a handshake being done using HTTP and then it changes protocol. If that is the case, you might need the other ports to be opened if you access it from another computer.

Upvotes: 0

Mark Meyer
Mark Meyer

Reputation: 3723

I believe you want to remove the /default from the url.

Try config.Urls.Add(new Uri("http://192.168.1.4:8091/pools"));

Upvotes: 1

Related Questions