Illustration Image

1/12/2023

Reading time:3

Simple Way to Install Cassandra In Windows 10

Placeholder

This resource is based on an article originally published here.

Figure out simple way to get installed and configure to run cassandra NoSQL database in Windows 10 PC in just 4 steps:

I am writing this tutorial since i face challenge to install cassandra in windows on self and i want to share what i figure out for the solution to other geeks.

What is cassandra and why to use it?

Apache Cassandra is a highly scalable, high-performance distributed database designed to handle large amounts of data across many commodity (cheap) servers, providing high availability with no single point of failure. It is a type of NoSQL database that is considered a key-value store. It’s query much similar to SQL.

  • Outgrown your regular relational database i.e petabytes, zettabytes size
  • Need of fast insert/update/selection of data that is scalable and fault-tolerant.

Steps to setup Cassandra on Window Machine locally.

1. Cassandra need JDK to run. First need to install JDK on the PC.

  • Go To Oracle (SignUp required) or Filehippo to download JDK 1.8 from which you find suitable.
  • Run the Install as it is.
  • Configure JDK path As:
  • Copy the JDK where is installed it’s bin directory. Mine is 64-bit found inside “C:\Program Files\Java\jdk1.8.0_181\bin” and place on Environment Variable as new Env_name : “JAVA_HOME” later we use for cassandra.
  • Note: Progra~1 = ‘Program Files’ for 64-bit
    Progra~2 = ‘Program Files(x86)’ for 32-bit in Environment path.
Environment variable set in JAVA_HOME

2. Go to Apache Cassandra Download Page. And Download the latest version. The latest version at that time is cassandra-3.11.4

  • Unzip it and place all files inside sub folder into ……………….. “C:\Program Files\apache-cassandra-3.11.4”
  • Open CMD inside “C:\Program Files\apache-cassandra-3.11.4\bin” and type cassandra then the output as shown below.
JAVA_HOME should set error
  • If you got above error then Edit “cassandra.bat” Add JAVA_HOME as:
set JAVA_HOME=”C:\Progra~1\Java\jdk1.8.0_181"
  • Save the cassandra.bat then run “cassandra.bat -f” with CMD Run as Administrator. This time, error should resolve if your edit successful.

3. Need Python2.7 to run Cassandra Query shell cqlsh .

  • Download Python2.7 latest version and extract inside the “C:\Program Files\apache-cassandra-3.11.4\bin” during installing. Or simply copy after installing python2.7 all files inside “bin” directory of cassandra-3.11.4. This is a easy way to go.
Directory of cassandra-3.11.4\bin with python all files

4. Finally run the Cassandra Server as “cassandra.bat -f” with CMD Run as Administrator from the bin directory. Following screen should see on successful start.

  • Don’t close it, keep running.
  • Then, open other CMD go over the bin directory of cassandra installed. To run cqlsh by type cqlsh . Following output should get.

Let’s try to create the table in it:

First create the namespace where data holds.

cqlsh> create keyspace test

cqlsh> Use test;

cqlsh:test>CREATE TABLE emp(
emp_id int PRIMARY KEY,
emp_name text,
emp_city text,
emp_sal varint,
emp_phone varint
);
For Verification: cqlsh:test> select * from emp;

Output as:

Congratulations! You have your Cassandra installed. Now you can explore it.

If you find helpful this tutorial please click on green icon, share to others.

Find out my other tutorial as:

Related Articles

logo
cassandra
artificial.intelligence
machine.learning

Explore Further

cassandra

nosql

spark

Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?