Connecting to Casandra from remote machine

May 27, 2016 4.3k views
DigitalOcean Articles One-Click Install Apps DigitalOcean NoSQL

Hi All,

I want to ask for your help on how i can connect to my cassandra DB on my droplet from remote machine. I did everything that is written in this article: Install Cassandra but when I try to connect from my C# code:

            cluster = Cassandra.Cluster.Builder().WithCredentials("abc", "abc")
             .AddContactPoints(new[] { "" })

            var session = cluster.Connect();
            var keyspace = "Test";

I'm getting-> Exception thrown: 'Cassandra.NoHostAvailableException' in Cassandra.dll

Additional information: None of the hosts tried for query are available (tried:

I also tried from other Cassandra GUI Clients like DBeaver but I;m getting the same error.

My Droplet is Ubuntu 14.04. From localhost I have no problem with Casandra my only problem is from remote.

Thank you in advance.

1 Answer

Hi @fstafai,

It sounds like either your local droplet firewall rules, or your cassandra configuration are blocking this. The easiest way to check is to look in your cassandra configuration for the listenaddress, or listeninterface directives (as described in : https://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html) and confirm that it's listening on the right interface, and the right address.

Have another answer? Share your knowledge.