Install Cassandra on Windows 10 in 4 Easy Steps

data, database, cassandra, mysql

The Windows Subsystem for Linux (WSL) is a compatibility layer designed to run Linux binary executables natively on Windows 10 and Windows Server 2019. It provides a Linux-compatible kernel interface developed by Microsoft, allowing users to choose a GNU environment for the user-mode binary. With WSL, you can run Linux distributions, manage files, and execute commands and applications, all from a Windows interface. It effectively bridges the gap between Windows and Linux, offering developers and system administrators the flexibility and convenience of using Linux tools in a Windows environment.

Step 1: Install the Windows Subsystem for Linux

  1. Open PowerShell as Administrator and run the following command to enable WSL: wsl --install
  2. Restart your machine if prompted.
  3. Once your system reboots, open the Microsoft Store and search for “Ubuntu”. Install the Ubuntu app. You will now have a full Linux terminal environment.

Step 2: Install Java

Apache Cassandra requires Java to run. Here’s how to install OpenJDK 8, which Cassandra supports:

  1. Open your Ubuntu terminal from the start menu.
  2. Update your package repository: sudo apt-get update
  3. Install OpenJDK 8: sudo apt-get install openjdk-8-jdk
  4. Verify the installation by checking the Java version: java -version

Step 3: Install Apache Cassandra

  1. Add the Apache repository of Cassandra: echo "deb https://downloads.apache.org/cassandra/debian 311x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
  2. Add the Apache Cassandra repository keys: curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
  3. Update the repositories: sudo apt-get update
  4. Install Cassandra: sudo apt-get install cassandra

Step 4: Running Cassandra

  1. Start the service: sudo service cassandra start
  2. Check the status of the service: sudo service cassandra status

You should now have Cassandra running on your Windows machine via WSL. You can interact with Cassandra through the Cassandra Query Language shell (cqlsh). To start cqlsh, simply type cqlsh in your terminal.

See also  Explained: Cassandra Compaction Strategies

Please note that this guide was based on the state of Apache Cassandra and Windows as of September 2021, and the steps might vary slightly if things have changed since then.

Leave a Comment