Create multi node Elassandra Cluster

Pramod Shehan
2 min readSep 13, 2019

--

Elassandra integrates Elasticsearch within Cassandra as a secondary index.

Elassandra = Cassandra + Elasticsearch

Elassandra need more memory than Cassandra because Elassandra is using Elasticsearch.

In here, you need several machines to setup multi node Elassandra cluster.

In my sample, I have used three machines to setup Elassandra cluster.

  • node 1 - 10.10.10.1
  • node 2 - 10.10.10.2
  • node 3 - 10.10.10.3
  1. First we must need to install Java Runtime 1.8.
sudo apt-get install openjdk-8-jre-headless

2. You may need to install apt-transport-https. apt-transport-https allows the use of repositories accessed via the HTTP secure protocol.

sudo apt-get install software-properties-common apt-transport-https gnupg2

3. Add Elassandra repository.

sudo add-apt-repository 'deb [arch=all] https://nexus.repo.strapdata.com/repository/apt-releases/ stretch main'

4. Add gpg key as well.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B335A4DD

5. Install Elassandra.

sudo apt-get update && sudo apt-get install elassandra

6. Finally you must start cassandra using systemd.

sudo systemctl start cassandra

You must install above steps in the every machines.

By default, listen_address and rpc_address is localhost.

listen_address - The IP address that Cassandra binds to connect this node to other nodes.(gossip)

rpc_address - The listen address for client connection.

seeds - Used to bootstrap the gossip process for new nodes joining a cluster. It is identified topology of the ring from the seeds list.

After installing Elassandra, you must change listen_address and rpc_address as IP address or host name of machine.

Example -

node 1 (10.10.10.1)

  • rpc_address = 10.10.10.1
  • listen_address = 10.10.10.1

node 2 (10.10.10.2)

  • rpc_address = 10.10.10.2
  • listen_address = 10.10.10.2

node 3 (10.10.10.3)

  • rpc_address = 10.10.10.3
  • listen_address = 10.10.10.3
To prevent problems in gossip communications, be sure to use the same list of seed nodes for all nodes in a cluster.

Making every node a seed node is not recommended because of increased maintenance and reduced gossip performance. Gossip optimization is not critical, but it is recommended to use a small seed list.

How to setting seed nodes

  1. For node1 and node2, configure node1 as a seed node.

node 1

seeds - 10.10.10.1

node 2

seeds - 10.10.10.1

2. Start Elassandra of node1 and node2.

3. Change node1 and node2 seeds list as below,

node 1

seeds - 10.10.10.1,10.10.10.2

node 2

seeds - 10.10.10.1,10.10.10.2

4. Change the node3 cassandra.yaml and start the Elassandra.

node 3

seeds - 10.10.10.1,10.10.10.2

After starting all the nodes successfully, we can check cluster status.

nodetool status

If you need to change cluster name, you should configure it in cassandra.yaml.

cluster_name : Test Cluster

Reference

  1. https://docs.datastax.com/en/dse/6.0/dse-admin/datastax_enterprise/production/seedNodesForSingleDC.html#Preventingproblemsingossipcommunications
  2. https://elassandra.readthedocs.io/en/latest/installation.html

--

--

No responses yet