In this post we will install Cassandra 2.1 as a standalone, single node cluster. A single node cluster is an easy way to get started learning Cassandra on your laptop.
These installation steps show how to install a local copy of Cassandra. The benefits of a local copy are that you do not need root or sudo to install Cassandra, updating versions is quick and easy, and you can control how/when to install updates.
Please follow the instructions to Install the Oracle JDK 7 update 75 on Ubuntu Linux 14.04.
mkdir -p ~/opt/packages && cd $_ wget http://mirrors.koehn.com/apache/cassandra/2.1.2/apache-cassandra-2.1.2-bin.tar.gz gzip -dc apache-cassandra-2.1.2-bin.tar.gz | tar xf - ln -s ~/opt/packages/apache-cassandra-2.1.2 ~/opt/cassandra
In this step we need to create several directories that are used by Cassandra.
Each directory is used by the following configuration variable in
logs directory is used by logback which is configured via the
mkdir -p ~/opt/cassandra/data/data mkdir -p ~/opt/cassandra/data/commitlog mkdir -p ~/opt/cassandra/data/saved_caches mkdir -p ~/opt/cassandra/logs
We’re going to run Cassandra in the foreground during development. Cassandra will output a lot of information to the terminal when we start the server. However, this information can be useful during development in case there is a problem with the server.
Ctrl + C when you are ready to stop the server.
Login to Cassandra with the CQL shell
If everything is working then you should see the following message:
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3] Use HELP for help. cqlsh>
Congratulations. Cassandra 2.1 is now installed on Ubuntu Linux. In a future post we will write some basic CQL commands to insert, update, delete and select data from Cassandra. Subscribe to our newsletter if you would like a weekly update our the latest posts.
We specialize in helping professional developers, like you, expand your skill set. Our courses are focused on enabling you to learn everything necessary to use a new technology in a live, production application.
All courses are made with love in
Palo Alto, CA.
Subscribe to our newsletter