Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra Datastax Enterprise using Amazon Elastic IP

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?

like image 218
BData Avatar asked Nov 12 '14 16:11

BData


People also ask

Can you use Cassandra in AWS?

With Amazon Keyspaces, you can run your Cassandra workloads on AWS using the same Cassandra application code and developer tools that you use today. You don't have to provision, patch, or manage servers, and you don't have to install, maintain, or operate software.

What is the difference between DataStax and Cassandra?

Datastax provides some advanced features in the Enterprise version that Apache Cassandra lacks. For instance, security & advanced tools such as OpsCenter are missing in Cassandra. These can be a welcome addition to the open-source Apache Cassandra.


2 Answers

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.

like image 192
LHWizard Avatar answered Sep 22 '22 14:09

LHWizard


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?

like image 40
phact Avatar answered Sep 21 '22 14:09

phact