Cassandra.ToolsAboutKnowledge Base

Docker Library

Docker (455860) docker-library/cassandra (219)
Languages:Dockerfile
Templates:Cassandra
License:Apache 2.0

If you're reading this on github.com, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the documentation for latest version through Docker Docs or via the ReadMe, e.g. 4.0.1.

The official Docker Cassandra image maintained by the Docker Community

Apache Cassandra® Docker

Getting the Image

The image is maintained and published by the Docker Community, you can access it using docker pull or download it.

How to use this image

Starting a Cassandra instance is simple:

docker run --name some-cassandra --network some-network -d cassandra:tag

where "some-cassandra" is the name you want to assign to your container and "tag" is the tag specifying the Cassandra version you want. See the list above for relevant tags.

Make Cluster

Using the environment variables documented below, there are two cluster scenarios: instances on the same machine and instances on separate machines. For the same machine, start the instance as described above. To start other instances, just tell each new node where the first is.

$ docker run --name some-cassandra2 -d --network some-network -e CASSANDRA_SEEDS=some-cassandra cassandra:tag

For separate machines (ie, two VMs on a cloud provider), you need to tell Cassandra what IP address to advertise to the other nodes (since the address of the container is behind the docker bridge).

Assuming the first machine's IP address is 10.42.42.42 and the second's is 10.43.43.43, start the first with exposed gossip port:

$ docker run --name some-cassandra -d -e CASSANDRA_BROADCAST_ADDRESS=10.42.42.42 -p 7000:7000 cassandra:tag

Then start a Cassandra container on the second machine, with the exposed gossip port and seed pointing to the first machine:

$ docker run --name some-cassandra -d -e CASSANDRA_BROADCAST_ADDRESS=10.43.43.43 -p 7000:7000 -e CASSANDRA_SEEDS=10.42.42.42 cassandra:tag

Connect to Cassandra from cqlsh

The following command starts another Cassandra container instance and runs cqlsh (Cassandra Query Language Shell) against your original Cassandra container, allowing you to execute CQL statements against your database instance:

$ docker run -it --network some-network --rm cassandra cqlsh some-cassandra

More information about the CQL can be found in the Cassandra documentation.

Useful links

Published image artifact details: repo-info repo's repos/cassandra/ directory (image metadata, transfer size, etc)

Image updates: official-images repo's library/cassandra label

Where to file issues Get Support Here Catalog of existing issues

Supported Architectures

amd64, arm32v7, arm64v8, ppc64le

License

View license information for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Cassandra are trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

© 2022 Anant Corporation, All Rights Reserved. All logos, trademarks and registered trademarks are the property of their respective owners.