Setup a multinode Cassandra using Ubuntu 12.04 and Virtualbox
1. Setup virtual machines (3 for exmaple)
You should first setup one machine using virtualbox, setup JAVA environment, download the Cassandra source code
Use Virtualbox’s virtualmanager function to copy another two ubuntu machines. Make sure to modify the hostname.
Modify the
/etc/hostsfile.Machine summary
- 192.168.56.101 sjhadoop0
- 192.168.56.103 sjhadoop1
- 192.168.56.104 sjhadoop2
2. Config Cassandra
Modify
/conf/cassandra-env.shfile.MAX_HEAP_SIZE="512M" HEAP_NEWSIZE="128M"Modify
/conf/cassandra.yamlfile. For each virtual machine, changelisten_addressandrpc_addressaccordingly.listen_address: 192.168.1.1 rpc_address: 192.168.1.1Choose one first machine as seed. Then change
seedsto its ip address, make the rest VM pointing to the same seed.seeds: - 192.168.1.1Assign initial_token, using the this python code to generate initial token and modify the
initial_tokenin .yaml file.
3. Start Cassandra
sudo ./bin/cassandra -f
That’s it!!