轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥7起我的订单
文档
工具
提交工单页面收录
zookeeper

library/zookeeper

Docker 官方镜像

Apache ZooKeeper 是一款开源服务器,专为分布式系统设计,致力于提供高可靠的协调服务,它通过简洁高效的接口支持配置管理、命名服务、分布式锁、集群节点同步等关键功能,帮助分布式应用实现数据一致性维护、节点状态监控及故障自动恢复,是构建稳定、可靠分布式架构不可或缺的基础设施,广泛应用于分布式计算、大数据处理等领域,为各类分布式系统的协调与协作提供坚实保障。

1.5千 次收藏下载次数: 0状态:Docker 官方镜像维护者:Docker 官方镜像仓库类型:镜像最近更新:1 个月前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

DockerHub 官方简介
轩辕镜像中文简介
下载命令
镜像标签列表与下载命令
轩辕镜像,加速的不只是镜像。
点击查看

Quick reference

  • Maintained by:
    https://github.com/31z4/zookeeper-docker

  • Where to get help:
    https://dockr.ly/comm-slack, Server Fault, https://unix.stackexchange.com/help/on-topic, or https://stackoverflow.com/help/on-topic

Supported tags and respective Dockerfile links

  • https://github.com/31z4/zookeeper-docker/blob/52a83649bc332b3324e0f0ecd96a1c88b2793022/3.8.6/Dockerfile

  • https://github.com/31z4/zookeeper-docker/blob/3f6430f695fceae0858824d716654c7e2b38bad3/3.9.5/Dockerfile

Quick reference (cont.)

  • Where to file issues:
    https://github.com/31z4/zookeeper-docker/issues?q=

  • Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
    https://hub.docker.com/r/amd64/zookeeper/, https://hub.docker.com/r/arm64v8/zookeeper/, https://hub.docker.com/r/ppc64le/zookeeper/, https://hub.docker.com/r/s390x/zookeeper/

  • Published image artifact details:
    https://github.com/docker-library/repo-info/blob/master/repos/zookeeper (https://github.com/docker-library/repo-info/commits/master/repos/zookeeper)
    (image metadata, transfer size, etc)

  • Image updates:
    https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fzookeeper
    https://github.com/docker-library/official-images/blob/master/library/zookeeper (https://github.com/docker-library/official-images/commits/master/library/zookeeper)

  • Source of this description:
    https://github.com/docker-library/docs/tree/master/zookeeper (https://github.com/docker-library/docs/commits/master/zookeeper)

What is Apache Zookeeper?

Apache ZooKeeper is a software project of the Apache Software Foundation, providing an open source distributed configuration service, synchronization service, and naming registry for large distributed systems. ZooKeeper was a sub-project of Hadoop but is now a top-level project in its own right.

***.org/wiki/Apache_ZooKeeper

!https://raw.githubusercontent.com/docker-library/docs/f906e95d1c27856aa79ea1bd8600da51466e7b0b/zookeeper/logo.png

How to use this image

Start a Zookeeper server instance

console
$ docker run --name some-zookeeper --restart always -d zookeeper

This image includes EXPOSE 2181 2888 3888 8080 (the zookeeper client port, follower port, election port, AdminServer port respectively), so standard container linking will make it automatically available to the linked containers. Since the Zookeeper "fails fast" it's better to always restart it.

Connect to Zookeeper from an application in another Docker container

console
$ docker run --name some-app --link some-zookeeper:zookeeper -d application-that-uses-zookeeper

Connect to Zookeeper from the Zookeeper command line client

console
$ docker run -it --rm --link some-zookeeper:zookeeper zookeeper zkCli.sh -server zookeeper

... via https://github.com/docker/compose

Example compose.yaml for zookeeper:

yaml
services:
  zoo1:
    image: zookeeper
    restart: always
    hostname: zoo1
    ports:
      - 2181:2181
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181

  zoo2:
    image: zookeeper
    restart: always
    hostname: zoo2
    ports:
      - 2182:2181
    environment:
      ZOO_MY_ID: 2
      ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181

  zoo3:
    image: zookeeper
    restart: always
    hostname: zoo3
    ports:
      - 2183:2181
    environment:
      ZOO_MY_ID: 3
      ZOO_SERVERS: server.1=zoo1:2888:3888;2181 server.2=zoo2:2888:3888;2181 server.3=zoo3:2888:3888;2181

This will start Zookeeper in https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_RunningReplicatedZooKeeper. Run docker compose up and wait for it to initialize completely. Ports 2181-2183 will be exposed.

Please be aware that setting up multiple servers on a single machine will not create any redundancy. If something were to happen which caused the machine to die, all of the zookeeper servers would be offline. Full redundancy requires that each server have its own machine. It must be a completely separate physical server. Multiple virtual machines on the same physical host are still vulnerable to the complete failure of that host.

*** using https://www.docker.com/products/docker-swarm when running Zookeeper in replicated mode.

Configuration

Zookeeper configuration is located in /conf. One way to change it is mounting your config file as a volume:

console
$ docker run --name some-zookeeper --restart always -d -v $(pwd)/zoo.cfg:/conf/zoo.cfg zookeeper

Environment variables

ZooKeeper recommended defaults are used if zoo.cfg file is not provided. They can be overridden using the following environment variables.

console
$ docker run -e "ZOO_INIT_LIMIT=10" --name some-zookeeper --restart always -d zookeeper

ZOO_TICK_TIME

Defaults to 2000. ZooKeeper's tickTime

The length of a single tick, which is the basic time unit used by ZooKeeper, as measured in milliseconds. It is used to regulate heartbeats, and timeouts. For example, the minimum session timeout will be two ticks

ZOO_INIT_LIMIT

Defaults to 5. ZooKeeper's initLimit

Amount of time, in ticks (see tickTime), to allow followers to connect and sync to a leader. Increased this value as needed, if the amount of data managed by ZooKeeper is large.

ZOO_SYNC_LIMIT

Defaults to 2. ZooKeeper's syncLimit

Amount of time, in ticks (see tickTime), to allow followers to sync with ZooKeeper. If followers fall too far behind a leader, they will be dropped.

ZOO_MAX_CLIENT_CNXNS

Defaults to 60. ZooKeeper's maxClientCnxns

Limits the number of concurrent connections (at the socket level) that a single client, identified by IP address, may make to a single member of the ZooKeeper ensemble.

ZOO_STANDALONE_ENABLED

Defaults to true. Zookeeper's https://zookeeper.apache.org/doc/r3.5.7/zookeeperReconfig.html#sc_reconfig_standaloneEnabled

Prior to 3.5.0, one could run ZooKeeper in Standalone mode or in a Distributed mode. These are separate implementation stacks, and switching between them during run time is not possible. By default (for backward compatibility) standaloneEnabled is set to true. The consequence of using this default is that if started with a single server the ensemble will not be allowed to grow, and if started with more than one server it will not be allowed to shrink to contain fewer than two participants.

ZOO_ADMINSERVER_ENABLED

Defaults to true. Zookeeper's http://zookeeper.apache.org/doc/r3.5.7/zookeeperAdmin.html#sc_adminserver_config

The AdminServer is an embedded Jetty server that provides an HTTP interface to the four letter word commands. By default, the server is started on port 8080, and commands are issued by going to the URL "/commands/[command name]", e.g., http://localhost:8080/commands/stat.

ZOO_AUTOPURGE_PURGEINTERVAL

Defaults to 0. Zookeeper's https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_advancedConfiguration

The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging. Defaults to 0.

ZOO_AUTOPURGE_SNAPRETAINCOUNT

Defaults to 3. Zookeeper's https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_advancedConfiguration

When enabled, ZooKeeper auto purge feature retains the autopurge.snapRetainCount most recent snapshots and the corresponding transaction logs in the dataDir and dataLogDir respectively and deletes the rest. Defaults to 3. Minimum value is 3.

ZOO_4LW_COMMANDS_WHITELIST

Defaults to srvr. Zookeeper's https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_clusterOptions

A list of comma separated Four Letter Words commands that user wants to use. A valid Four Letter Words command must be put in this list else ZooKeeper server will not enable the command. By default the whitelist only contains "srvr" command which zkServer.sh uses. The rest of four letter word commands are disabled by default.

Advanced configuration

ZOO_CFG_EXTRA

Not every Zookeeper configuration setting is exposed via the environment variables listed above. These variables are only meant to cover minimum configuration keywords and some often changing options. If mounting your custom config file as a volume doesn't work for you, *** using ZOO_CFG_EXTRA environment variable. You can add arbitrary configuration parameters to Zookeeper configuration file using this variable. The following example shows how to enable Prometheus metrics exporter on port 7070:

console
$ docker run --name some-zookeeper --restart always -e ZOO_CFG_EXTRA="metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider metricsProvider.httpPort=7070" zookeeper

JVMFLAGS

Many of the Zookeeper advanced configuration options can be set there using Java system properties in the form of -Dproperty=value. For example, you can use Netty instead of NIO (default option) as a server communication framework:

console
$ docker run --name some-zookeeper --restart always -e JVMFLAGS="-Dzookeeper.serverCnxnFactory=org.apache.zookeeper.server.NettyServerCnxnFactory" zookeeper

See https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_advancedConfiguration for the full list of supported Java system properties.

Another example use case for the JVMFLAGS is setting a maximum JWM heap size of 1 GB:

console
$ docker run --name some-zookeeper --restart always -e JVMFLAGS="-Xmx1024m" zookeeper

Replicated mode

Environment variables below are mandatory if you want to run Zookeeper in replicated mode.

ZOO_MY_ID

The id must be unique within the ensemble and should have a value between 1 and 255. Do note that this variable will not have any effect if you start the container with a /data directory that already contains the myid file.

ZOO_SERVERS

This variable allows you to specify a list of machines of the Zookeeper ensemble. Each entry should be specified as such: server.id=<address1>:<port1>:<port2>[:role];[<client port address>:]<client port> https://zookeeper.apache.org/doc/r3.5.7/zookeeperReconfig.html. Entries are separated with space. Do note that this variable will not have any effect if you start the container with a /conf directory that already contains the zoo.cfg file.

Where to store data

This image is configured with volumes at /data and /datalog to hold the Zookeeper in-memory database snapshots and the transaction log of updates to the database, respectively.

Be careful where you put the transaction log. A dedicated transaction log device is key to consistent good performance. Putting the log on a busy device will adversely affect performance.

How to configure logging

By default, ZooKeeper redirects stdout/stderr outputs to the console. Since 3.8 ZooKeeper is shipped with LOGBack as the logging backend. The ZooKeeper default logback.xml file resides in the /conf directory. To override default logging configuration mount your custom config as a volume:

console
$ docker run --name some-zookeeper --restart always -d -v $(pwd)/logback.xml:/conf/logback.xml zookeeper

Check https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_logging for more details.

Logging in 3.7

You can redirect to a file located in /logs by passing environment variable ZOO_LOG4J_PROP as follows:

console
$ docker run --name some-zookeeper --restart always -e ZOO_LOG4J_PROP="INFO,ROLLINGFILE" zookeeper

This will write logs to /logs/zookeeper.log. This image is configured with a volume at /logs for your convenience.

License

View https://github.com/apache/zookeeper/blob/master/LICENSE.txt 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 https://github.com/docker-library/repo-info/tree/master/repos/zookeeper.

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.

Deployment & Usage Documentation

Apache ZooKeeper Docker 容器化部署指南

Apache ZooKeeper是Apache软件基金会的一个开源项目,提供分布式配置服务、同步服务和命名注册功能,适用于大型分布式系统。作为曾经的Hadoop子项目,ZooKeeper现在已成为独立的顶级项目,为分布式应用提供高可靠性的协调服务。

Read More

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 zookeeper 镜像标签

docker pull docker.xuanyuan.run/zookeeper:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull zookeeper:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

iKuai 镜像加速

宝塔面板

一键配置镜像源

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

一键安装

一键安装 Docker

Linux Docker 一键安装

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

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

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

用户头像

oldzhang

运维工程师

Linux服务器

5

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

轩辕镜像
Docker 官方镜像
...
library/zookeeper
教程轩辕镜像功能与使用教程
定价查看流量套餐与价格
热门查看热门 Docker 镜像推荐
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥7/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
商务合作:点击复制邮箱
用户协议·隐私政策·©2024-2026 源码跳动
用户协议·隐私政策©2024-2026 杭州源码跳动科技有限公司商务合作:点击复制邮箱

更多 zookeeper 镜像推荐

bitnamicharts/zookeeper logo

bitnamicharts/zookeeper

bitnamicharts
Bitnami提供的Apache ZooKeeper Helm图表,用于在Kubernetes环境中简化分布式协调服务的部署与管理。
3 次收藏500万+ 次下载
10 个月前更新
ubuntu/zookeeper logo

ubuntu/zookeeper

Ubuntu 官方镜像
ZooKeeper提供集中式配置信息维护,由Canonical提供长期支持的跟踪版本。
14 次收藏100万+ 次下载
2 个月前更新
rancher/zookeeper logo

rancher/zookeeper

rancher
暂无描述
1 次收藏10万+ 次下载
10 年前更新
adobe/zookeeper logo

adobe/zookeeper

adobe
暂无描述
1万+ 次下载
2 个月前更新
cilium/zookeeper logo

cilium/zookeeper

cilium
digitalwonderland/zookeeper的分支版本,带有稳定的1.0标签,基于openjdk:8-jre-alpine构建,提供Apache ZooKeeper服务,支持单机和集群模式部署。
7.4千+ 次下载
5 年前更新
rootpublic/zookeeper logo

rootpublic/zookeeper

rootpublic
Root精选ZooKeeper镜像是基于官方ZooKeeper镜像构建的安全、轻量级容器化应用起点,具备减小镜像大小、最小化攻击面和提升初始安全态势的特性。
3.4千+ 次下载
9 个月前更新

查看更多 zookeeper 相关镜像

更多相关 Docker 镜像与资源

以下是 zookeeper 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:

  • wurstmeister/zookeeper Docker 镜像说明(ZooKeeper,分布式协调服务,适合服务发现和配置管理)
  • bitnami/zookeeper Docker 镜像说明(ZooKeeper 分布式协调服务,Bitnami 企业级配置)
  • ubuntu/zookeeper Docker 镜像说明(ZooKeeper 分布式协调服务,基于 Ubuntu,适合服务发现和配置管理)
  • bitnamicharts/zookeeper Docker 镜像说明(ZooKeeper 分布式协调服务,Bitnami Charts 版本,适合服务发现和配置管理)
  • bitnamilegacy/zookeeper Docker 镜像说明(Bitnami Legacy ZooKeeper,适合 Kafka/Hadoop 等协调服务)