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/hosts file.

  • Machine summary

    • sjhadoop0
    • sjhadoop1
    • sjhadoop2

2. Config Cassandra

  • Modify /conf/cassandra-env.shfile.

  • Modify /conf/cassandra.yaml file. For each virtual machine, change listen_address and rpc_addressaccordingly.

  • Choose one first machine as seed. Then change seeds to its ip address, make the rest VM pointing to the same seed.

      seeds: -
  • Assign initial_token, using the this python code to generate initial token and modify the initial_token in .yaml file.

3. Start Cassandra

    sudo ./bin/cassandra -f

That’s it!!