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

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

官方QQ群: 1072982923

perrykim/zookeeper Docker 镜像 - 轩辕镜像 | Docker 镜像高效稳定拉取服务

热门搜索:openclaw🔥nginx🔥redis🔥mysqlopenjdkcursorweb2apimemgraphzabbixetcdubuntucorednsjdk
zookeeper
perrykim/zookeeper
自动构建
perrykim
k8s - zookeeper ( forked k8s contrib )
1 次收藏下载次数: 0状态:自动构建维护者:perrykim仓库类型:镜像最近更新:7 年前
轩辕镜像,快一点,稳很多。点击查看
镜像简介版本下载
轩辕镜像,快一点,稳很多。点击查看

Kubernetes ZooKeeper K8SZK

This project contains a Docker image meant to facilitate the deployment of Apache ZooKeeper on Kubernetes using StatefulSets.

Limitations

  1. Scaling is not currently supported. An ensemble's membership can not be updated in a safe way in ZooKeeper 3.4.10 (The current stable release).
  2. Observers are currently not supported. Contributions are welcome.
  3. Persistent Volumes must be used. emptyDirs will likely result in a loss of data.

Docker Image

The docker image contained in this repository is comprised of a base Ubuntu 16.04 image using the latest release of the OpenJDK JRE based on the 1.8 JVM (JDK 8u111) and the latest stable release of ZooKeeper, 3.4.10. Ubuntu is a much larger image than BusyBox or Alpine, but these images contain mucl or ulibc. This requires a custom version of OpenJDK to be built against a libc runtime other than glibc. No vendor of the ZooKeeper software supplies or verifies the software against such a JVM, and, while Alpine or BusyBox would provide smaller images, we have prioritized a well known environment.

The image is built such that the ZooKeeper process is designated to run as a non-root user. By default, this user is zookeeper. The ZooKeeper package is installed into the /opt/zookeeper directory, all configuration is sym linked into the /usr/etc/zookeeper/, and all executables are sym linked into /usr/bin. The ZooKeeper data directories are contained in /var/lib/zookeeper. This is identical to the RPM distribution that users should be familiar with.

Configuration

Headless Service

The ZooKeeper Stateful Set requires a Headless Service to control the network domain for the ZooKeeper processes. An example configuration is provided below.

yaml
apiVersion: v1
kind: Service
metadata:
  name: zk-svc
  labels:
    app: zk-svc
spec:
  ports:
  - port: 2888
    name: server
  - port: 3888
    name: leader-election
  clusterIP: None
  selector:
    app: zk-svc

Note that the Service contains two ports. The server port is used for followers to tail the leaders even log, and the leader-election port is used by the ensemble to perform leader election.

Stateful Set

The Stateful Set configuration must match the Headless Service, and it must provide the number of replicas. In the example below we request a ZooKeeper ensemble of size 3. As weighted quorums are not supported, it is imperative that an odd number of replicas be chosen. Moreover, the number of replicas should be either 1, 3, 5, or 7. Ensembles may be scaled to larger membership for read fan out, but, as this will adversely impact write performance, careful thought should be given to selecting a larger value.

yaml
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: zk
spec:
  serviceName: zk-svc
  replicas: 3
Container Configuration

The zkGenConfig.sh script will generate the ZooKeeper configuration (zoo.cfg), Log4J configuration (log4j.properties), and JVM configuration (jvm.env). These will be written to the /opt/zookeeper/conf directory with correct read permissions for the zookeeper user. These files are generated from environment variables that are injected into the container as in the example, minimal configuration below.

yaml
containers:
      - name: k8szk
        imagePullPolicy: Always
        image: gcr.io/google_samples/k8szk:v3
        ports:
        - containerPort: 2181
          name: client
        - containerPort: 2888
          name: server
        - containerPort: 3888
          name: leader-election
        env:
        - name : ZK_ENSEMBLE
          value: "zk-0;zk-1;zk-2"
        - name: ZK_CLIENT_PORT
          value: "2181"
        - name: ZK_SERVER_PORT
          value: "2888"
        - name: ZK_ELECTION_PORT
          value: "3888"
Membership Configuration
VariableTypeDefaultDescription
ZK_ENSEMBLEstringN/AA colon separated list of servers in the ensemble.
This is a mandatory configuration variable that is used to configure the membership of the
ZooKeeper ensemble. It is also used to prevent data loss during accidental scale operations. The
set can be computed as follows. For all integers in the range [0,replicas), prepend the name of
service followed by a dash to the integer. So for the Stateful Set above, the name is zk and we have
3 replicas. for the set {0,1,2} we prepend zk- giving us zk-0;zk-1;zk-2.
Network Configuration
VariableTypeDefaultDescription
ZK_CLIENT_PORTinteger2181The port on which the server will accept client requests.
ZK_SERVER_PORTinteger2888The port on which the leader will send events to followers.
ZK_ELECTION_PORTinteger3888The port on which the ensemble performs leader election.
ZK_MAX_CLIENT_CNXNSinteger60The maximum number of concurrent client connections that a server in the ensemble will accept.

The ZK_CLIENT_PORT, ZK_ELECTION_PORT, and ZK_SERVERS_PORT must be set to the containerPorts specified in the container configuration, and the ZK_SERVER_PORT and ZK_ELECTION_PORT must match the Headless Service configuration. However, if the default values of the environment variables are used for both the containerPorts and the Headless Service, the environment variables may be omitted from the configuration.

ZooKeeper Time Configuration
VariableTypeDefaultDescription
ZK_TICK_TIMEinteger2000The number of wall clock ms that corresponds to a Tick for the ensembles internal time.
ZK_INIT_LIMITinteger5The number of Ticks that an ensemble member is allowed to perform leader election.
ZK_SYNC_LIMITinteger10The number of Tick by which a follower may lag behind the ensembles leader.
ZooKeeper Session Configuration
VariableTypeDefaultDescription
ZK_MIN_SESSION_TIMEOUTinteger2 * ZK_TICK_TIMEThe minimum session timeout that the ensemble will allow a client to request.
ZK_MAX_SESSION_TIMEOUTinteger20 * ZK_TICK_TIMEThe maximum session timeout that the ensemble will allow a client to request.
Data Retention Configuration

ZooKeeper does not, by default, purge old transactions logs or snapshots. This can cause the disk to become full. If you have backup procedures and retention policies that rely on external systems, the snapshots can be retrieved manually from the /var/lib/zookeeper/data directory, and the logs can be retrieved manually from the /var/lib/zookeeper/log directory. These will be stored on the persistent volume. The zkCleanup.sh script can be used to manually purge outdated logs and snapshots.

If you do not have an existing retention policy and backup procedure, and if you are comfortable with an automatic procedure, you can use the environment variables below to enable and configure automatic data purge policies.

VariableTypeDefaultDescription
ZK_SNAP_RETAIN_COUNTinteger3The number of snapshots that the ZooKeeper process will retain if ZK_PURGE_INTERVAL is set to a value greater than 0.
ZK_PURGE_INTERVALinteger0The delay, in hours, between ZooKeeper log and snapshot cleanups.
JVM Configuration

Currently the only supported JVM configuration is the JVM heap size. Be sure that the heap size you request does not cause the process to swap out.

VariableTypeDefaultDescription
ZK_HEAP_SIZEinteger2The JVM heap size in Gibibytes.
Log Level Configuration
VariableTypeDefaultDescription
ZK_LOG_LEVELenum(TRACE,DEBUG,INFO,WARN,ERROR,FATAL)INFOThe Log Level that for the ZooKeeper processes logger.
Liveness and Readiness

The zkOk.sh script can be used to check the liveness and readiness of ZooKeeper process. The example below demonstrates how to configure liveness and readiness probes for the Pods in the Stateful Set.

yaml
  readinessProbe:
    exec:
      command:
      - sh
      - -c
      - "zkOk.sh"
    initialDelaySeconds: 15 
    timeoutSeconds: 5
  livenessProbe:
    exec:
      command:
      - sh
      - -c
      - "zkOk.sh"
    initialDelaySeconds: 15
    timeoutSeconds: 5
Volume Mounts

volumeMounts for the container should be defined as below.

yaml
  volumeMounts:
  - name: datadir
    mountPath: /var/lib/zookeeper
Storage Configuration

Currently, the use of Persistent Volumes to provide durable, network attached storage is mandatory. If you use the provided image with emptyDirs, you will likely suffer a data loss. The example below demonstrates how to request a dynamically provisioned persistent volume of 20 GiB.

yaml
  volumeClaimTemplates:
  - metadata:
      name: datadir
      annotations:
        volume.alpha.kubernetes.io/storage-class: anything
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 20Gi
Logging

The Log Level configuration may be modified via the ZK_LOG_LEVEL environment variable as described above. However, the location of the log output is not modifiable. The ZooKeeper process must be run in the foreground, and the log information will be shipped to the stdout. This is ***ed to be a best practice for containerized applications, and it allows users to make use of the log rotation and retention infrastructure that already exists for K8s.

Metrics

The zkMetrics script can be used to retrieve metrics from the ZooKeeper process and print them to stdout. A recurring Kubernetes job can be used to collect these metrics and provide them to a collector.

bash
bash$ kubectl exec zk-0 zkMetrics.sh
zk_version	3.4.9-***, built on 08/23/2016 06:50 GMT
zk_avg_latency	0
zk_max_latency	0
zk_min_latency	0
zk_packets_received	21
zk_packets_sent	20
zk_num_alive_connections	1
zk_outstanding_requests	0
zk_server_state	follower
zk_znode_count	4
zk_watch_count	0
zk_ephemerals_count	0
zk_approximate_data_size	27
zk_open_file_descriptor_count	39
zk_max_file_descriptor_count	***

查看更多 zookeeper 相关镜像 →
zookeeper logo
zookeeper
Docker 官方镜像
Apache ZooKeeper 是一款开源服务器,专为分布式系统设计,致力于提供高可靠的协调服务,它通过简洁高效的接口支持配置管理、命名服务、分布式锁、集群节点同步等关键功能,帮助分布式应用实现数据一致性维护、节点状态监控及故障自动恢复,是构建稳定、可靠分布式架构不可或缺的基础设施,广泛应用于分布式计算、大数据处理等领域,为各类分布式系统的协调与协作提供坚实保障。
1.5千 次收藏1亿+ 次下载
1 天前更新
bitnami/zookeeper logo
bitnami/zookeeper
bitnami
Bitnami为ZooKeeper提供的安全镜像是一款预配置且经过安全加固的软件包,旨在简化分布式协调服务ZooKeeper的部署与管理流程,集成了自动化安全更新、合规性检查及行业最佳实践配置,可确保在生产环境中稳定运行,适用于需要可靠分布式协调能力的企业级应用,帮助用户快速搭建安全高效的ZooKeeper集群,有效降低部署复杂度并显著增强系统整体安全性。
132 次收藏1亿+ 次下载
6 个月前更新
bitnamicharts/zookeeper logo
bitnamicharts/zookeeper
bitnamicharts
Bitnami提供的Apache ZooKeeper Helm图表,用于在Kubernetes环境中简化分布式协调服务的部署与管理。
500万+ 次下载
7 个月前更新
ubuntu/zookeeper logo
ubuntu/zookeeper
Ubuntu 官方镜像
ZooKeeper提供集中式配置信息维护,由Canonical提供长期支持的跟踪版本。
14 次收藏100万+ 次下载
1 天前更新
rancher/zookeeper logo
rancher/zookeeper
rancher
暂无描述
1 次收藏10万+ 次下载
9 年前更新
adobe/zookeeper logo
adobe/zookeeper
adobe
暂无描述
1万+ 次下载
16 天前更新

轩辕镜像配置手册

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

Docker 配置

登录仓库拉取

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

专属域名拉取

无需登录使用专属域名

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

系统配置

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

MacOS OrbStack

MacOS OrbStack 容器配置

Docker Compose

Docker Compose 项目配置

NAS 设备

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

极空间

极空间 NAS 系统配置服务

网络设备

爱快路由

爱快 iKuai 路由系统配置

宝塔面板

在宝塔面板一键配置镜像

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

镜像拉取常见问题

使用与功能问题

docker search 报错:专属域名下仅支持 Docker Hub 查询

docker search 报错问题

网页搜不到镜像:Docker Hub 有但轩辕镜像搜索无结果

镜像搜索不到

离线传输镜像:无法直连时用 docker save/load 迁移

离线传输镜像

Docker 插件安装错误:application/vnd.docker.plugin.v1+json

Docker 插件安装错误

WSL 下 Docker 拉取慢:网络与挂载目录影响及优化

WSL 拉取镜像慢

轩辕镜像是否安全?镜像完整性校验(digest)说明

镜像安全性

如何用轩辕镜像拉取镜像?登录方式与专属域名配置

如何拉取镜像

错误码与失败问题

manifest unknown 错误:镜像不存在或标签错误

manifest unknown 错误

TLS/SSL 证书验证失败:Docker pull 时 HTTPS 证书错误

TLS 证书验证失败

DNS 解析超时:无法解析镜像仓库地址或连接超时

DNS 解析超时

410 Gone 错误:Docker 版本过低导致协议不兼容

410 错误:版本过低

402 Payment Required 错误:流量耗尽错误提示

402 错误:流量耗尽

401 UNAUTHORIZED 错误:身份认证失败或登录信息错误

身份认证失败错误

429 Too Many Requests 错误:请求频率超出专业版限制

429 限流错误

Docker login 凭证保存错误:Cannot autolaunch D-Bus(不影响登录)

凭证保存错误

账号 / 计费 / 权限

免费版与专业版区别:功能、限额与使用场景对比

免费版与专业版区别

支持的镜像仓库:Docker Hub、GCR、GHCR、K8s 等列表

轩辕镜像支持的镜像仓库

拉取失败是否扣流量?计费规则说明

拉取失败流量计费

KYSEC 权限不够:麒麟 V10/统信 UOS 下脚本执行被拦截

KYSEC 权限错误

如何申请开具发票?(增值税普票/专票)

开具发票

如何修改网站与仓库登录密码?

修改网站和仓库密码

配置与原理类

registry-mirrors 未生效:仍访问官方仓库或报错的原因

registry-mirrors 未生效

如何去掉镜像名称中的轩辕域名前缀?(docker tag)

去掉域名前缀

如何拉取指定架构镜像?(ARM64/AMD64 等多架构)

拉取指定架构镜像

查看全部问题→

用户好评

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

用户头像

oldzhang

运维工程师

Linux服务器

5

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

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