- 1 year ago
How to run Apache Cassandra 3.x on Windows
Comment
1 / 1
Running Apache Cassandra 3.x on Windows involves a few steps. Here's a basic guide to get you started:
Download Apache Cassandra:
- Go to the Apache Cassandra download page: https://cassandra.apache.org/download/
- Choose the latest stable release of Cassandra and download the binary distribution for Windows.
Extract the Cassandra Archive:
- Extract the downloaded Cassandra archive (e.g.,
apache-cassandra-x.x.x-bin.tar.gz
) to a directory of your choice. For simplicity, let's assume you extracted it toC:\cassandra
.
- Extract the downloaded Cassandra archive (e.g.,
Configure Cassandra:
- Navigate to the
C:\cassandra\conf
directory. - Open the
cassandra.yaml
file in a text editor. - Look for the
data_file_directories
setting and set the data directory where Cassandra will store its data. For example:data_file_directories: [C:\cassandra\data]
. - Look for the
commitlog_directory
setting and set the directory where the commit log will be stored. For example:commitlog_directory: C:\cassandra\commitlog
. - Save the changes to the
cassandra.yaml
file.
- Navigate to the
Set Environment Variables:
- Add the
C:\cassandra\bin
directory to your system'sPATH
environment variable. This will allow you to run Cassandra commands from any command prompt.
- Add the
Start Cassandra:
- Open a command prompt and navigate to the Cassandra installation directory (e.g.,
C:\cassandra
). - Run the following command to start Cassandra:
cassandra
- Open a command prompt and navigate to the Cassandra installation directory (e.g.,
Verify Cassandra is Running:
- Once Cassandra has started, you should see some log messages indicating that the server is up and running.
- To interact with Cassandra, open a new command prompt and navigate to the Cassandra installation directory.
- Run the following command to launch the Cassandra command-line shell (cqlsh):
cqlsh
Congratulations! You have successfully installed and started Apache Cassandra on Windows. Now you can use cqlsh to interact with Cassandra and start building your database applications.
Note: Make sure you have Java installed on your Windows system, as Cassandra requires Java to run. Also, consider customizing other settings in the cassandra.yaml
file, such as the replication factor, listen address, and more, based on your specific requirements.