Apache Cassandra – Part 2

From a previous post we talked about the basics of Cassandra. From this post I’m going to talk about the installation and the basic setup of a project in JAVA. When talking about the Cassandra installation it’s a very simple thing, not hard as MySQL installation. Let’s see installation in step wise.

  • Step 01 : For the latest release it requires jdk 8 and python 2.7 to be installed. You can verify it by following commands.

1.png

  • Step 02 : Download tar.gz file from the following location. According to the Cassandra official document Even-numbered releases (e.g. 3.2) contain new features and odd-numbered releases (e.g. 3.3) contain bug fixes only.

http://cassandra.apache.org/download/

2.png

  • Step 03 : Next we can untar the files.

tar -zxvf file-name.tar.gz

4.png

  • Step 04 : Next go to the ./bin directory and execute following command to start the Cassandra server.

5.png

  • Step 05 : We can verify whether Cassandra started or not using following command.

6.png

  • Or else we can use the ps command as well.

7.png

If we check we can see the /data directory and the /logs directory which have being created at the installation automatically at the default location.

8.png

Now the installation is successful and we can use the cqlsh command line tool for execute Cassandra queries.

9

Also we can log in using a specific user as well. Here the usercassandra‘ is the default user which created at the installation. Default password will be ‘cassandra‘ as well.

16.png

I’ll talk more about cqlsh and CQL query in the next post. Here I will list only few commands. Using the HELP command on the cqlsh we can get the list of help documentations in Cassandra.

10.png

CQL queries are most like SQL queries. For an example,

11.png

Now let’s see how to setup a MVN project to work with Cassandra. For that we need following dependencies to be added to the pom.xml.

12

After syncing the project we can see the dependencies will be added under the External Libraries.

13

Hope now you have a clear idea in how to install Cassandra and how to setup the initial maven project. Let’s talk more about CQL, cqlsh in next posts. Keep in touch for the next post. Thank You!

Advertisements

2 thoughts on “Apache Cassandra – Part 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s