I've installed Couchbase server on Amazon EC2 and trying to build a client with VisualStudio C#.
Couchbase is accessible from my computer via web interface. I can add and modify data. But from C# it doesn't work: getting "Unable to locate node" error. At the same time Fiddler shows that some "handshaking" is taking place: my test program is getting some metadata while establishing a connection with Couchbase. But any attempt to read or write data fails.
Following ports are open: 11211,8091,8092,22,11210,21100 - 21299,11209,4369 (but turning firewall off doesn't seem to help)
Below is my testing program. Any help is very much appreciated.
App.config:
<configuration>
<configSections>
<section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<couchbase>
<servers bucket="mybucket" username="Administrator" password="xxxxxxxxx">
<add uri="http://XXX.XXX.XXX.XXX:8091/pools"/>
</servers>
</couchbase>
</configuration>
code:
public static void Run()
{
System.Configuration.Configuration cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ICouchbaseClientConfiguration section = cfg.GetSection("couchbase") as ICouchbaseClientConfiguration;
using (CouchbaseClient client = new CouchbaseClient(section))
{
MyData mydata= new MyData();
mydata.MyName= "bla-bla";
IStoreOperationResult res = client.ExecuteStore(StoreMode.Set, "1", mydata);
System.Diagnostics.Debug.WriteLine("*************************************************************");
if (!res.Success)
System.Diagnostics.Debug.WriteLine(res.Message); // writes "Unable to locate node"
}
}
Found this - it affected me exactly the same.
http://www.couchbase.com/communities/q-and-a/unable-locate-node-error-net-sdk
Edit: The above link is busted. Here's where it is now. https://forums.couchbase.com/t/unable-to-locate-node-error-net-sdk/258