Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

1/12/2023

Reading time:3 min

Simple Way to Install Cassandra In Windows 10

by Sushant Gautam

Sushant GautamJul 25, 2019·4 min readFigure out simple way to get installed and configure to run cassandra NoSQL database in Windows 10 PC in just 4 steps:Cassandra NoSQL DatabaseI 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 sizeNeed 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-bitProgra~2 = ‘Program Files(x86)’ for 32-bit in Environment path.Environment variable set in JAVA_HOME2. Go to Apache Cassandra Download Page. And Download the latest version. The latest version at that time is cassandra-3.11.4Unzip 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 errorIf 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 files4. 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 testcqlsh> 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:Apache Spark in Google Collaboratory In 3 steps.Apache Spark is the leading platform for large-scale SQL, batch processing, stream processing, and machine learning.medium.comArduino Introduction for BeginnersWhat is Arduino? Let’s take a look from Arduino Website :medium.com

Illustration Image

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

cassandra
artificial.intelligence
machine.learning

Architect’s Guide to Using NoSQL for Real-time AI: Part 1

John Doe

6/9/2023

cassandra
nosql

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra