I have a Cassandra Service running on my Ubuntu Server with a single node now. I want to make it into a ring cluster with 3 nodes to get a feel of multinode cluster all bein
It is very easy to run multiple Cassandra instances on the same Ubuntu machine as long as they have different IP addresses that all resolve to the local host. The entire 127.0.0.0/8 address block is reserved for loopback purposes so any packet sent to addresses (127.0.0.1 through 127.255.255.254) will be looped back.
ping to check if the addresses resolve properly.Edit cassandra.yaml and replace
localhost to the IP address we give to that instance (like 127.0.0.2).SimpleSeedProvider and put addresses of all other Cassandra instances to the seed list to make a cluster (like - seeds: "127.0.0.2","127.0.0.3"Edit cassandra-env.sh, find where the JMX_PORT property is set and give it a different value (different port) for every instance of Cassandra. Otherwise instances cannot run together because of the conflicts on this port.
./cassandra startup script (you can write simple bash script for this later).Verify your topology with ./nodetool status . For the two nodes, for instance, the output must look like
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens  Owns (effective)  Host ID                               Rack
UN  127.0.0.1  61.97 KB   256     100.0%            6c04e202-8f24-4f17-b430-0154c1512316  rack1
UN  127.0.0.2  105.68 KB  256     100.0%            ca3073ee-451c-4cef-97ee-d312784648bb  rack1