Cassandra cluster on AWS when ran with Java client

56 views
Skip to first unread message

Kant Kodali

unread,
Jul 10, 2016, 8:00:48 PM7/10/16
to java-dri...@lists.datastax.com
Hi Guys,

I installed a 3 node Cassandra cluster on AWS and my replication factor is 3. I am trying to insert some data into a table. I set the consistency level of QUORUM at a Cassandra Session level. It only inserts into one node and unable to talk to other nodes because it is trying to contact other nodes through private IP and obviously that is failing so I am not sure how to change settings in say cassandra.yaml or somewhere such that rpc_address in system.peers table is updated to public IP's? I tried changing the seeds to all public IP's that didn't work as it looks like ec2 instances cannot talk to each other using public IP's. any help would be appreciated!

Thanks,
kant

Andrew Tolbert

unread,
Jul 10, 2016, 8:10:22 PM7/10/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Kant,

If you are using C* 2.1 or greater, you can configure broadcast_rpc_address.   If you configure broadcast_rpc_address to be public IP, and rpc_address to private ip, the system.peers table will contain the public ip (broadcast_rpc_address) for the rpc_address column.

Cassandra uses the broadcast_address/listen_address for internode connectivity and broadcast_rpc_address/rpc_address for the rpc interface (client -> coordinator (C* node) requests).  In your case it sounds like you will probably want to use listen_address (and also your seeds) as private ip , rpc_address as private ip, and broadcast_rpc_address as public ip.  You don't need to worry about broadcast_address unless you are setting up a cluster across regions. If you are indeed setting up a multi DC-region ring, you might want to consider using EC2MultiRegionAddressTranslator which will translate public ips into private ones if your driver client is in the same region as the C* node it's trying to talk to.

Thanks,
Andy

Kant Kodali

unread,
Jul 10, 2016, 8:12:04 PM7/10/16
to java-dri...@lists.datastax.com
got it! Thanks Andy!

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages