Question
Connecting to Casandra from remote machine
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[] { "12.34.56.78" })
.WithPort(9168)
.Build();
var session = cluster.Connect();
var keyspace = "Test";
session.CreateKeyspaceIfNotExists(keyspace);
session.ChangeKeyspace(keyspace);
I’m getting-> Exception thrown: ‘Cassandra.NoHostAvailableException’ in Cassandra.dll
Additional information: None of the hosts tried for query are available (tried: 12.34.56.78:9168)
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.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×