0

我在安装了 Service Pack 1 的 Windows Server 2008 R2 上安装了 Cachebase Server,默认设置。

现在,我正在尝试测试服务器,但无法正常工作。这就是我所拥有的:

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");
    }
}

我做错了什么?我认为它与防火墙没有任何关系,因为当我在浏览器中访问 url 时,它会返回一个 Json 对象。

4

2 回答 2

1

我相信您想/default从网址中删除 。

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

于 2013-03-05T15:55:53.533 回答
0

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.

于 2013-03-11T21:17:07.713 回答