8
votes

I would like to run Cassandra Datastax Enterprise on Amazon EC2 instances using not the node private IP address but Elastic Public IPs

My current configuration looks as follows:

/etc/dse/cassandra/cassandra.yaml

seed_provider:
  - class_name: org.apache.cassandra.locator.SimpleSeedProvider
    parameters:
        seeds: "publicIP"

listen_address:  "publicIP"
endpoint_snitch:Ec2Snitch
rpc_address: "publicIP"

The "dse" service is not starting properly.

/var/log/cassandra/system.log is showing the following error:

org.apache.cassandra.exceptions.ConfigurationException: Unable to bind to address /<publicIP>:7000. Set listen_address in cassandra.yaml to an interface you can bind to, e.g., your private IP address on EC2

I have also tried to change the broadcast_address to point to the public IP address but it doesn't work.

Is there any way of running dse service (Cassandra) in a way it uses the elastic IP addresses and not the private IPs of EC2 boxes?

2
doubt you can, since the public ip doesn't appear anywhere in the network config of your instance. unless cassandra allows binding to an interface, e.g. eth0, and not just an ip, you can't bind to anything but the IPs that are available on your configured interfaces.Marc B
I know this was a while ago but it is possible to bind to the eth0 interfacesyncdk

2 Answers

9
votes

Not a new question here, but looking at your config, make these changes.

listen_address: private_ip
broadcast_address: public_ip
rpc_address: 0.0.0.0

Seeds should be public_ip so you're ok there.

8
votes

Three addresses avaliable in Cassandra.yaml

  1. Listen Address - This is the ip address other Cassandra nodes will use to talk to this node. You want this to be your internal AWS IP Address for performance.

  2. RPC Address - This is the address your client connects to, probably the one you want to configure to match your external AWS address if your client is not sitting in AWS or in the same AWS region.

  3. Broadcast Address - If you are using multiple data centers or AWS Regions, where not all the nodes have access to each other via internal IP. You can specify the external IP address for the nodes in different data centers can still talk to each other. In many cases you don't need this setting at all, it will default to your Listen Address.

I think the answer to your question is use the RPC address to connect to C* from your client using the external/elastic AWS IP. You can probably leave the Broadcast Address un-configured.

Does this help?