专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

cassandra Docker 镜像 - 轩辕镜像

cassandra
library/cassandra
Apache Cassandra是一款开源的分布式存储系统。
1594 收藏0 次下载
🚀专业版镜像服务,面向生产环境设计
版本下载
🚀专业版镜像服务,面向生产环境设计

Quick reference

  • Maintained by:
    the Docker Community

  • Where to get help:
    the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow

Supported tags and respective Dockerfile links

  • 5.0.6, 5.0, 5, latest, 5.0.6-bookworm, 5.0-bookworm, 5-bookworm, bookworm

  • 4.1.10, 4.1, 4, 4.1.10-bookworm, 4.1-bookworm, 4-bookworm

  • 4.0.19, 4.0, 4.0.19-bookworm, 4.0-bookworm

Quick reference (cont.)

  • Where to file issues:
    [***]

  • Supported architectures: (more info)
    amd64, arm32v7, arm64v8, ppc64le, s390x

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

  • Image updates:
    official-images repo's library/cassandra label
    official-images repo's library/cassandra file (history)

  • Source of this description:
    docs repo's cassandra/ directory (history)

What is Cassandra?

Apache Cassandra is an open source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients.

***.org/wiki/Apache_Cassandra

!logo

How to use this image

Start a cassandra server instance

Starting a Cassandra instance is simple:

console
$ 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 a 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.

console
$ 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:

console
$ 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:

console
$ 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:

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

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

Container shell access and viewing Cassandra logs

The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your cassandra container:

console
$ docker exec -it some-cassandra bash

The Cassandra Server log is available through Docker's container log:

console
$ docker logs some-cassandra

Configuring Cassandra

The best way to provide configuration to the cassandra image is to provide a custom /etc/cassandra/cassandra.yaml file. There are many ways to provide this file to the container (via short Dockerfile with FROM + COPY, via Docker Configs, via runtime bind-mount, etc), the details of which are left as an exercise for the reader.

To use a different file name (for example, to avoid all image-provided configuration behavior), use -Dcassandra.config=/path/to/cassandra.yaml as an argument to the image (as in, docker run ... cassandra -Dcassandra.config=/path/to/cassandra.yaml).

There are a small number of environment variables supported by the image which will modify /etc/cassandra/cassandra.yaml in some way (but the script is modifying YAML, so is naturally fragile):

  • CASSANDRA_LISTEN_ADDRESS: This variable is for controlling which IP address to listen for incoming connections on. The default value is auto, which will set the listen_address option in cassandra.yaml to the IP address of the container as it starts. This default should work in most use cases.

  • CASSANDRA_BROADCAST_ADDRESS: This variable is for controlling which IP address to advertise to other nodes. The default value is the value of CASSANDRA_LISTEN_ADDRESS. It will set the broadcast_address and broadcast_rpc_address options in cassandra.yaml.

  • CASSANDRA_RPC_ADDRESS: This variable is for controlling which address to bind the thrift rpc server to. If you do not specify an address, the wildcard address (0.0.0.0) will be used. It will set the rpc_address option in cassandra.yaml.

  • CASSANDRA_START_RPC: This variable is for controlling if the thrift rpc server is started. It will set the start_rpc option in cassandra.yaml.

  • CASSANDRA_SEEDS: This variable is the comma-separated list of IP addresses used by gossip for bootstrapping new nodes joining a cluster. It will set the seeds value of the seed_provider option in cassandra.yaml. The CASSANDRA_BROADCAST_ADDRESS will be added the seeds passed in so that the server will talk to itself as well.

  • CASSANDRA_CLUSTER_NAME: This variable sets the name of the cluster and must be the same for all nodes in the cluster. It will set the cluster_name option of cassandra.yaml.

  • CASSANDRA_NUM_TOKENS: This variable sets number of tokens for this node. It will set the num_tokens option of cassandra.yaml.

  • CASSANDRA_DC: This variable sets the datacenter name of this node. It will set the dc option of cassandra-rackdc.properties. You must set CASSANDRA_ENDPOINT_SNITCH to use the "GossipingPropertyFileSnitch" in order for Cassandra to apply cassandra-rackdc.properties, otherwise this variable will have no effect.

  • CASSANDRA_RACK: This variable sets the rack name of this node. It will set the rack option of cassandra-rackdc.properties. You must set CASSANDRA_ENDPOINT_SNITCH to use the "GossipingPropertyFileSnitch" in order for Cassandra to apply cassandra-rackdc.properties, otherwise this variable will have no effect.

  • CASSANDRA_ENDPOINT_SNITCH: This variable sets the snitch implementation this node will use. It will set the endpoint_snitch option of cassandra.yml.

Caveats

Where to Store Data

Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the cassandra images to familiarize themselves with the options available, including:

  • Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
  • Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.

The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above:

  1. Create a data directory on a suitable volume on your host system, e.g. /my/own/datadir.

  2. Start your cassandra container like this:

    console
    $ docker run --name some-cassandra -v /my/own/datadir:/var/lib/cassandra -d cassandra:tag
    

The -v /my/own/datadir:/var/lib/cassandra part of the command mounts the /my/own/datadir directory from the underlying host system as /var/lib/cassandra inside the container, where Cassandra by default will write its data files.

No connections until Cassandra init completes

If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as Docker Compose, which start several containers simultaneously.

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).

Some additional license information which was able to be auto-detected might be found in the repo-info repository's cassandra/ directory.

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.

查看更多 cassandra 相关镜像 →
bitnami/cassandra logo
bitnami/cassandra
Bitnami安全镜像,用于部署和运行Cassandra分布式NoSQL数据库,提供安全加固的运行环境。
5250M+ pulls
上次更新:未知
bitnamicharts/cassandra logo
bitnamicharts/cassandra
Bitnami提供的Apache Cassandra Helm Chart,用于在Kubernetes集群上部署开源分布式数据库Apache Cassandra,支持高可用性、无单点故障,适用于处理跨多服务器的大量数据。
11M+ pulls
上次更新:未知
rook/cassandra logo
rook/cassandra
Apache Cassandra是一款开源、分布式的宽列存储NoSQL数据库管理系统,旨在高效处理大规模结构化数据,提供高可用性、线性可扩展性和分布式架构支持。
1M+ pulls
上次更新:未知
ubuntu/cassandra logo
ubuntu/cassandra
Apache Cassandra是开源NoSQL分布式数据库,由Canonical维护长期版本,提供可扩展性和高可用性,适合关键任务数据存储,该镜像基于Ubuntu,已停止维护但现有标签仍可能接收安全更新。
350K+ pulls
上次更新:未知
amd64/cassandra logo
amd64/cassandra
Apache Cassandra 是一款开源分布式数据库管理系统,旨在跨多台普通服务器处理大量数据,提供高可用性且无单点故障,支持多数据中心集群和异步无主复制。
1100K+ pulls
上次更新:未知
arm64v8/cassandra logo
arm64v8/cassandra
Apache Cassandra 是一个开源的分布式存储系统。
9100K+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
library/cassandra
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
提交工单
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.