Skip to content

Instantly share code, notes, and snippets.

@dhkaneda
Last active July 10, 2020 00:37
Show Gist options
  • Save dhkaneda/20c5bce94c91fa7a0f28fb5a8ac8b73d to your computer and use it in GitHub Desktop.
Save dhkaneda/20c5bce94c91fa7a0f28fb5a8ac8b73d to your computer and use it in GitHub Desktop.
Cassandra Mac OS X + Ubuntu 18.40 Installation (04-04-2020)
------------------------------------------------------------------------
Contents
1. Install Cassandra on Mac OS X (tested with Mojave) - line 6
2. Install Cassandra on Ubuntu (18.04, tested on 19.10) - line 31
----- Installing Cassandra on Mac OS X (mojave) (est time. 15 min) -----
Have homebrew installed:
> ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
[ be sure to check post install messages to add paths and such if necessary ]
Install Java8 (1.8)
> brew tap homebrew/cask-versions
> brew cask install adoptopenjdk8
> brew cleanup
Instal python and cql:
> brew install python
> python3 -m pip install cql
Install Cassandra
> brew install cassandra
> brew info cassandra < to check
> brew services start cassandra
> [ brew services stop cassandra ]
> brew services
Profit
Enter shell
> cqlsh
---- Install Cassandra on Ubuntu 18.04 > tested on 19.10 (est time. 15 min) ----
Install Java8
> sudo apt update
> sudo apt install openjdk-8-jdk openjdk-8-jre
> java -version
Set env
- (if below command doesn’t work, open env file and paste/save)
> cat >> /etc/environment <<EOL
JAVA_HOME= /usr/lib/jvm/java-8-openjdk-amd64
JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
EOL
Install python3 & pip3 & cql
Check version
> python3 --version
> sudo apt install python3-pip
> python3 -m pip install cql
Install Cassandra >> https://linuxize.com/post/how-to-install-apache-cassandra-on-ubuntu-18-04/
> sudo apt install apt-transport-https
> wget -q -O - https://www.apache.org/dist/cassandra/KEYS | sudo apt-key add -
- should return OK after a new moments
> sudo sh -c 'echo "deb http://www.apache.org/dist/cassandra/debian 311x main" > /etc/apt/sources.list.d/cassandra.list'
> sudo apt update
> sudo apt install cassandra
> nodetool status
- (give it a few seconds or try again on error)
> service --status-all
- output: “[ + ] cassandra”
Profit
Enter shell
> cqlsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment