Installing Cassandra on Windows
Downloads
Important! Cassandra is not supported on Windows!
We do not provide support for Cassandra installations on Windows as those installations are not natively supported by Apache. We strongly recommend using Linux deployments. The information below is provided as a courtesy only.
One option for running Cassandra 5.0 on Windows is Docker. See Install Docker Desktop on Windows for official installation instructions.
Additional resources:
- https://hub.docker.com/_/cassandra/ – official Cassandra Docker image
- https://docs.docker.com/ – Docker documentation
Docker Cassandra basics
This section provides the basics for starting a Docker Cassandra 5.0 container, for testing purposes only. For production deployment, we recommend generating a custom Docker image as described in the section Custom Docker Cassandra image.
Start an instance of the official Cassandra 5.0.5 Docker image by executing this command:
docker run --name cassandra5_test –p 9042:9042 –v e:\cassandra\data:/var/lib/cassandra -d cassandra:5.0.5
Parameter | Value | Description |
--name | cassandra5_test | User-defined container instance name. This is an optional parameter. The name must be unique and cannot be the same as the official Docker image name. |
-v | e:/cassandra/data/:/var/lib/cassandra | Mount an external drive to a path in the Docker container instance. /var/lib/cassandra is the default Cassandra path for data and commit log storage. An external drive must be mounted for permanent data storage. |
-d | Detach and run in the background. | |
-p | 9042:9042 | Publish port 9042 to Windows host. 9042 is the native client port. |
[image name]:version | cassandra:5.0.5 | Pull the official Apache Cassandra 5 Docker image for this running instance. |
If this is a new Docker installation, the first docker run execution downloads the Cassandra image to the local system.
To access logs:
docker logs <container name or ID>
To access nodetool (or other tools):
docker exec -it <container name or ID> nodetool status
Newer Java versions require the -Dcom.sun.jndi.rmiURLParsing=legacy option. If the “Malformed IPv6 address” error occurs, use:
docker exec -it <container name or ID> nodetool -Dcom.sun.jndi.rmiURLParsing=legacy status
Custom Docker Cassandra image
Production deployment of Cassandra 5.0 on Windows requires modifying system configurations. Therefore, a custom Docker image must be created with the configuration changes. This section covers setting up and running a custom Docker image. Details of the configuration changes are discussed in section Cassandra configuration.
- Download and extract the CustomTWC_Cassandra5_DockerImg.zip package into an empty working directory.
Execute the following command to build the custom Docker image named cassandra5_twc:
docker build –t cassandra5_twc:latest .BASHStart an instance of the custom Docker Cassandra 5.0 image you just built:
docker run –p 9042:9042 –v d:\data:/data –v e:\log\commitlog:/logs/commitlog -d cassandra5_twc:latestBASHThe data and commit log directories are mounted separately, to different paths.
With the custom Docker Cassandra instance running and mounted to permanent storage, the database is ready to connect to your Teamwork Cloud installation.
If more configuration changes are needed, the running instance has to be terminated and a new Docker image needs to be built. Edit the configuration file from the working directory in Step 1. Proceed with steps 2-3 to redeploy the Cassandra node on Windows.
Cassandra configuration
This section is a summary of the configuration changes to optimize Docker Cassandra deployment for Teamwork Cloud. If additional configuration changes are needed, the Docker Cassandra image has to be rebuilt.
Please see the settings to optimize Cassandra for better performance.