How to install Cassandra 3.3 on Ubuntu

Step 1: Install\Upgrade to Java 8

3.0 and later require Java 8u40 or later.

[root@ubuntu ~] sudo add-apt-repository ppa:webupd8team/java -y
[root@ubuntu ~] sudo apt-get update
[root@ubuntu ~] sudo apt-get install oracle-java8-set-default

Verify with the command:

[root@ubuntu ~] java -version

if you upgraded java make sure that

[root@ubuntu ~]  echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle

Step 2: Installing Cassandra 3.3

Copy\Paste the following commands:

[root@ubuntu ~] echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
[root@ubuntu ~] echo "deb http://www.apache.org/dist/cassandra/debian 33x  main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
[root@ubuntu ~] echo "deb-src http://www.apache.org/dist/cassandra/debian 33x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
[root@ubuntu ~] gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D
[root@ubuntu ~] gpg --export --armor F758CE318D77295D | sudo apt-key add -
[root@ubuntu ~] gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00
[root@ubuntu ~] gpg --export --armor 2B5C1B00 | sudo apt-key add -
[root@ubuntu ~] gpg --keyserver pgp.mit.edu --recv-keys 0353B12C
[root@ubuntu ~] gpg --export --armor 0353B12C | sudo apt-key add -
[root@ubuntu ~] sudo apt-get update
[root@ubuntu ~] sudo apt-get install cassandra

Verify with:

[root@ubuntu ~] cassandra -v
3.3
[root@ubuntu ~] cqlsh
Connected to Test cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.3 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cqlsh>

cassandra-mini-logo
Enjoy!

1 Comment

  1. Jhon   •  

    Why I’m getting this error:
    Connection error: (‘Unable to connect to any servers’, {‘127.0.0.1’: error(111, “Tried connecting to [(‘127.0.0.1’, 9042)]. Last error: Connection refused”)})

Leave a Reply

Your email address will not be published. Required fields are marked *