Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Cassandra on ECS?

I'm trying to deploy Cassandra on AWS ECS as docker containers. Single nodes are easily done, but now I'm trying to make a cluster for it.

Cassandra needs fixed ip addresses, at least for the seed nodes, which needs to be passed to all nodes in a cluster. Cassandra cannot work with ELB addresses, because the ELB name resolves to a different ip as the docker host itself.

So basically I need to be able to force AWS to deploy an image to a specific instance/host/ip. In that way I can pass the correct configuration while running the docker image.

Could I use the RunTask api and pass it PlacementConstraint giving a constraint to limit the hosts to a single one, based on IP? Is PrivateIp an attribute of an EC2 instance in this interface?

Do you have any other good ideas how I can achieve that?

Thanks!

like image 944
Denn0 Avatar asked May 09 '17 17:05

Denn0


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 Cassandra in AWS?

Apache Cassandra is an open-source, NoSQL database designed to store data for applications that require fast read and write performance. For example, you can use Cassandra to store user profile information for online video games, device metadata for internet of things (IoT) applications, or records for events.


2 Answers

You can use hostnames in the seeds list. Just make sure that your seeds will use those names. Also, if a seed stops and resolves to another IP you'll need to replace it (but that's true for any node that changes its IP)

like image 118
Serban Teodorescu Avatar answered Sep 21 '22 14:09

Serban Teodorescu


If seed ecs containers are added using awsvpc network mode then each task get their own eni. After you launch seed nodes you can use 'aws describe-tasks' API to get their ip address and update your Cassandra.yml accordingly

like image 39
Aniket Chopade Avatar answered Sep 18 '22 14:09

Aniket Chopade