Docker安装Zookeeper

Docker安装Zookeeper

微信搜索 zze_coding 或扫描 👉 二维码关注我的微信公众号获取更多资源推送:

1、拉取 Zookeeper 镜像:

[root@localhost ~]# docker pull zookeeper
Using default tag: latest
Trying to pull repository docker.io/library/zookeeper ... 
latest: Pulling from docker.io/library/zookeeper
8e402f1a9c57: Pull complete 
4866c822999c: Pull complete 
cf419f3f41ff: Pull complete 
88430b15d43f: Pull complete 
d5a9723280f1: Pull complete 
c43110341cd8: Pull complete 
9ec9c92edf13: Pull complete 
cdf8329cd90a: Pull complete 
Digest: sha256:8832a49f7ee6399c608e9a666e294adeaef0e4b1bc540c60ac75b8ec4b41f572
Status: Downloaded newer image for docker.io/zookeeper:latest

2、创建并运行一个容器:

[root@localhost ~]# docker run --name myZookeeper -p 2181:2181 -p 2888:2888 -p 3888:3888 --restart always -d zookeeper
7131a3e7db31900f5f3acd5db51d5e75f23b82ee223c926514679c4b477e4471

Zookeeper 默认暴露 2181、2888、3888 这三个端口,分别为客户端端口,集群端口,选举端口。

Copyright: 采用 知识共享署名4.0 国际许可协议进行许可

Links: https://www.zze.xyz/archives/docker-zookeeper.html

Buy me a cup of coffee ☕.