Docker安装zookeeper


docker pull zookeeper ,默认安装最新的
当出现如下结果时, 表示镜像已经下载完成了:
>>> docker pull zookeeper:latest

latest: Pulling from library/zookeeper
123275d6e508: Already exists                                                                                            
2750eaebe665: Pull complete                                                                                             
98ad45fdc135: Pull complete                                                                                             
a51062359ac5: Pull complete                                                                                             
cd982f90894b: Pull complete                                                                                             
4d85f4709f0f: Pull complete                                                                                             
48e09383f722: Pull complete                                                                                             
f9784b3748c5: Pull complete                                                                                             
Digest: sha256:def4c98a21f5da99130dabdb497b4446ee0fb718adc78be7655bff075726df2d
Status: Downloaded newer image for zookeeper:latest
docker.io/library/zookeeper:latest

>>> docker images
查看所有镜像,就能看到zookeeper


ZK 镜像的基本使用
启动 ZK 镜像
>>> docker run --name my_zookeeper -d zookeeper:latest
这个命令在后台运行一个 zookeeper 容器, 名字是 my_zookeeper, 并且它默认会导出 2181 端口

>>> docker ps -a


然后可以使用:docker logs -f my_zookeeper,查看 ZK 的运行情况, 输出类似如下内容时, 表示 ZK 已经成功启动了:
>>> docker logs -f my_zookeeper
ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
...

 

posted on 2020-04-18 22:24  fengyelan2233  阅读(821)  评论(0编辑  收藏  举报

导航