1

I have deployed a 3-node Cassandra cluster on AWS (EC2). I'm trying to connect to the cluster from a .NET console application running on my computer. The Datastax website provides the following code sample for connecting to a local instance:

Cluster cluster = Cluster.Builder().AddContactPoint("127.0.0.1").Build();

I've set cassandra.yaml such that nodetool status displays the node's address as the EC2 instance's private IP address. However, if I use the private address in the AddContactPoint() function, the .NET driver returns an error saying that none of the hosts tried for query are available.

enter image description here

Which IP address do you use (instead of 127.0.0.1) in the AddContactPoint() function for connecting to the Cassandra cluster in AWS? The EC2 instance's public or private IP address? Or something else?

My settings in cassandra.yaml are:

rpc_address: 0.0.0.0
broadcast_rpc_address: *EC2's public IP address*
listen_address: *EC2's private IP address*

Thanks in advance.

2 Answers 2

2

Check out the rpc_address and more specifically for your environment the broadcast_rpc_adddress. The broadcast_rpc_address should be your public ip. Additionally look at the listen_address docs which discuss appropriate values to set in an EC2 e

0
1

For the broadcast_rpc_address you would use the EC2's Public IP address as that's the address at which all your clients be connecting. listen_address is used for internode communication between nodes in the cluster.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.