Skip to content

Install cassandra | Debian 12 (bookworm)

Cassandra Database

Install | Debian (12) Bookworm

Bash
sudo apt update && sudo apt upgrade -y
Bash
sudo apt install -y zip unzip
install java 11 (openjdk11)

https://sdkman.io/

Bash
curl -s "https://get.sdkman.io" | bash
  • list java
Bash
sdk list java
  • install example temurin
Bash
sdk install java 11.0.24-tem
install cassandra
Bash
sudo curl -o /etc/apt/keyrings/apache-cassandra.asc https://downloads.apache.org/cassandra/KEYS
Bash
echo "deb [signed-by=/etc/apt/keyrings/apache-cassandra.asc] https://debian.cassandra.apache.org 41x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
Bash
sudo apt update
Bash
sudo apt install cassandra
  • crush default java path with new java installed from sdk
Bash
sudo rm -rf /usr/bin/java
Bash
sudo ln -s $HOME/.sdkman/candidates/java/11.0.21-tem/bin/java /usr/bin/java
configure cassandra
  • tweak heap size here
Bash
sudo nano /etc/cassandra/cassandra-env.sh
  • just fling everything in the terminal
Bash
sudo systemctl stop cassandra
sudo rm -rf /var/lib/cassandra/data
sudo install -g cassandra -o cassandra -d /var/lib/cassandra/data
sudo sed -i [email protected]@$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')@g /etc/cassandra/cassandra.yaml
sudo sed -i s@localhost@$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')@g /etc/cassandra/cassandra.yaml
# - suggested setup for big cassandra db
sudo sed -i s@"read_request_timeout: 5000ms"@"read_request_timeout: 15000ms"@g /etc/cassandra/cassandra.yaml
sudo sed -i s@"range_request_timeout: 10000ms"@"range_request_timeout: 200000ms"@g /etc/cassandra/cassandra.yaml
sudo sed -i s@"write_request_timeout: 2000ms"@"write_request_timeout: 20000ms"@g /etc/cassandra/cassandra.yaml
sudo systemctl start cassandra