1

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"
    }
}
4
  • You are running the sdk on your local computer to try and set data on ec2? What is the hostname of the node when you look in the web admin and is it different to the ip you have in your <add uri="" /> config? Commented Mar 18, 2014 at 11:26
  • I've just gotten more information thanks to driver's advanced logging feature. Commented Mar 18, 2014 at 11:33
  • So the actual problem is that EC2 has one public and one private IP. While during "handshaking" phase the .net driver is using server's public IP, it switches to private IP when trying to read or write data. SO it seems to be a configuration issue. Commented Mar 18, 2014 at 11:36
  • @scalabilitysolved yes, the host name is the private IP. Is it possible to change it? Commented Mar 18, 2014 at 11:41

3 Answers 3

3

You probably need to follow the documentation here which describes using hostnames in the cloud as opposed to ip addresses, see if that helps!

EDIT: Actually use the following article, specifically how to set up the couchbase node names using the public dns! http://blog.couchbase.com/cross-data-center-replication-step-step-guide-amazon-aws

I'll leave the following links that point to the higher level official documentation.

Couchbase in the cloud overview: http://docs.couchbase.com/couchbase-manual-2.2/#handling-changes-in-ip-addresses

Couchbase hostname configuration: http://docs.couchbase.com/couchbase-manual-2.2/#couchbase-getting-started-hostnames

Sign up to request clarification or add additional context in comments.

Comments

0

Another problem can lead to this error is blocked by firewall in development environment. You can resolve this by bypass couchbase ip server in IE: Tools/Internet Options/Connections/LAN Settings/Advanced/Exceptions.

Regards.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.