Cassandra

Installing Cassandra on Raspberry Pi

  1. Run sudo wget http://apache.mirrors.spacedump.net/cassandra/3.7/apache-cassandra-3.7-bin.tar.gz
  2. Run sudo tar -zxvf apache-cassandra-3.7-bin.tar.gz
  3. Run sudo mv apache-cassandra-3.7 /opt/apache-cassandra-3.7
  4. Change user from root to pi
    • Run cd /opt
    • Run sudo chown -R pi apache-cassandra-3.7
    • Run sudo chgrp -R pi apache-cassandra-3.7
  5. Run sudo ln -s /opt/apache-cassandra-3.7 /opt/apache-cassandra
  6. Change user from root to pi
    • Run cd /opt
    • Run sudo chown -R pi apache-cassandra
    • Run sudo chgrp -R pi apache-cassandra
  7. Run cd /opt/apache-cassandra
  8. Change the listen address to the ip address of the machine
    1. Run sudo vi conf/cassandra.yaml
    2. Edit listen_address to have the ip address instead of localhost (e.g. listen_address: 192.168.1.32)
    3. Edit seeds value so that it matches the ip address specified in listen_address
    4. Edit rpc_address value to be 0.0.0.0
    5. Edit broadcast_rpc_address to have the same value as listen_address
    6. Edit start_rpc to set the value to true
  9. Change the JVM options
    • Run sudo vi conf/jvm.options
    • Add the following to the “HEAP SETTINGS”
      • -Xms256M
      • -Xmx256M
  10. Run ./bin/cassandra
  11. Test that it works
    1. Run ./bin/nodetool status
    2. Run ./bin/cqlsh (also run ./bin/cqlsh 192.168.1.32)

Run Cassandra as a service

  1. Create a startup script in /etc/init.d called cassandra (see this link for an example)
  2. Run sudo chmod 755 cassandra
  3. Run sudo update-rc.d cassandra defaults
  4. Run sudo service cassandra start

Add full text search capabilities

For full text search capabilities one can use Cassandra Lucene Index

This requires building a jar compatible with the version of Cassandra being used and then dropping said jar in the lib folder of Cassandra.

Instructions are provided in the Github repository.

Advertisements