The cassandra container
  • Shell 87.8%
  • Roff 9.2%
  • Dockerfile 3%
Find a file
2017-05-30 07:38:26 +02:00
root/usr Initial import (#1444729). 2017-05-30 07:38:26 +02:00
.gitignore Initial setup of the repo 2017-05-29 19:24:58 +00:00
Dockerfile Initial import (#1444729). 2017-05-30 07:38:26 +02:00
README.md Initial import (#1444729). 2017-05-30 07:38:26 +02:00
sources Initial setup of the repo 2017-05-29 19:24:58 +00:00

Cassandra container

This repository contains Dockerfiles for Cassandra images for general usage and OpenShift.

Description

This container image provides a containerized packaging of the Cassandra daemon and client application. The cassandra server daemon accepts connections from clients and provides access to content from Cassandra databases on behalf of the clients. You can find more information on the Cassandra project from the project Web site (https://cassandra.apache.org/).

Volumes

You can also set the following mount points by passing the -v /host:/container flag to Docker.

Volume mount point Description
/var/lib/cassandra/data Cassandra data directory

Notice: When mouting a directory from the host into the container, ensure that the mounted directory has the appropriate permissions and that the owner and group of the directory matches the user UID or name which is running inside the container.

Usage

For this, we will assume that you are using the fedora/cassandra-39 image. If you want to set only the mandatory environment variables and store the database in the /home/user/database directory on the host filesystem, execute the following command:

$ docker run -d -v /home/user/database:/var/lib/cassandra/data fedora/cassandra-39

Ports

By default, Cassandra uses 7000 for cluster communication (7001 if SSL is enabled), 9042 for native protocol clients, and 7199 for JMX. The internode communication and native protocol ports are configurable in the Cassandra Configuration File (cassandra.yaml). The JMX port is configurable in cassandra-env.sh (through JVM options). All ports are TCP.

Documentation

See http://cassandra.apache.org/doc/latest/

Requirements

  • Memory: For production 32 GB to 512 GB; the minimum is 8 GB for Cassandra nodes. For development in non-loading testing environments: no less than 4 GB.
  • CPU: For production 16-core CPU processors are the current price-performance sweet spot. For development in non-loading testing environments: 2-core CPU processors are sufficient.
  • Disk space: SSDs are recommended for Cassandra nodes. The size depends on the compaction strategy used. With SSDs, you can use a maximum of 3 to 5 TB per node of disk space for uncompressed data.
  • Network: Recommended bandwidth is 1000 Mb/s (gigabit) or greater.

More on hardware requirements on https://docs.datastax.com/en/landing_page/doc/landing_page/planning/planningHardware.html

Custom configuration file

It is allowed to use custom configuration files for cassandra server.

To use custom configuration file in container it has to be mounted into /etc/cassandra/cassandra.yaml. For example to use configuration file stored in /home/user directory use this option for docker run command: -v /home/user/cassandra.yaml:/etc/cassandra/cassandra.yaml:Z.

To configure multiple JVM options a jvm.options file needs to be mounted into the container. For example to use configuration file stored in /home/user directory use this option for docker run command: -v /home/user/jvm.options:/etc/cassandra/jvm.options:Z.

Troubleshooting

The cassandra deamon in the container logs to the standard output, so the log is available in the container log. The log can be examined by running:

docker logs

See also

The Dockerfile is using a cassandra rpm package from Fedora. More information is found at: https://admin.fedoraproject.org/pkgdb/package/rpms/cassandra/