Introduction
I got an existing cassandra cluster and I got a spare pi so why not. The existing cluster all runs on x86 nodes. Take note I have the 64 bit kernel running on my Pi4.
Installing cassandra
Adopted from: https://cassandra.apache.org/_/download.html
sudo apt update
sudo apt install default-jdk
echo "deb [ arch=arm64 ] https://downloads.apache.org/cassandra/debian 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
sudo apt update
sudo apt install cassandra
For some reason, raspbian tries to get the armhf package by default and it results in an error. Specifying the arm64 arch in the source fixes it.
Installation and config
Adopted from: https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/initialize/initSingleDS.html
Stop service + Clear existing data:
sudo systemctl stop cassandra
sudo rm -rf /var/lib/cassandra/*
Configure /etc/cassandra/cassandra.yaml
like normal (here is a sample. edit all IP addresses and names to match your config):
cluster_name: 'TEST'
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "10.50.6.1:7000,10.50.6.2:7000,10.50.6.3:7000"
endpoint_snitch: SimpleSnitch
listen_address: 10.50.6.3
rpc_address: 10.50.6.3
auto_bootstrap: false
If you run cassandra on commodity hardware, you may want to relax the write request timeout:
write_request_timeout_in_ms: 21000
Firewall
Also, make sure you adjust your firewall to allow access from other cassandra nodes and DB clients. In my case, it was port 7000, 9200 and 9042.
Finishing up
Run this command on any node to check status:
nodetool status