重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Docker快速安装Zookeeper的详细教程

Docker快速安装Zookeeper

成都创新互联主营江城网站建设的网络公司,主营网站建设方案,重庆App定制开发,江城h5重庆小程序开发搭建,江城网站营销推广欢迎江城等地区企业咨询

换了公司后很久没用过Zookeeper,最近因为在搞Elastic-Job需要用到,这里简单记录下用Docker搭建过程,下一篇会讲解怎么快速搭建集群。这里不会细讲如何搭建Docker,如果想了解Docker的朋友可以查看我之前写的Docker系列文章。

搜索Zookeeper镜像evans-MacBook-Pro:tool evan$ docker search zookeeperNAME DESCRIPTION STARS OFFICIAL AUTOMATEDzookeeper Apache ZooKeeper is an open-source server wh… 1099 [OK] jplock/zookeeper Builds a docker image for Zookeeper version … 165 [OK]wurstmeister/zookeeper 149 [OK]mesoscloud/zookeeper ZooKeeper 73 [OK]bitnami/zookeeper ZooKeeper is a centralized service for distr… 60 [OK]digitalwonderland/zookeeper Latest Zookeeper - clusterable 23 [OK]mbabineau/zookeeper-exhibitor 23 [OK]tobilg/zookeeper-webui Docker image for using `zk-web` as ZooKeeper… 15 [OK]debezium/zookeeper Zookeeper image required when running the De… 14 [OK]confluent/zookeeper [deprecated - please use confluentinc/cp-zoo… 13 [OK]31z4/zookeeper Dockerized Apache Zookeeper. 9 [OK]thefactory/zookeeper-exhibitor Exhibitor-managed ZooKeeper with S3 backups … 6 [OK]engapa/zookeeper Zookeeper image optimised for being used int… 3 emccorp/zookeeper Zookeeper 2 harisekhon/zookeeper Apache ZooKeeper (tags 3.3 - 3.4) 2 [OK]paulbrown/zookeeper Zookeeper on Kubernetes (PetSet) 1 [OK]openshift/zookeeper-346-fedora20 ZooKeeper 3.4.6 with replication support 1 perrykim/zookeeper k8s - zookeeper ( forked k8s contrib ) 1 [OK]josdotso/zookeeper-exporter ref: https://github.com/carlpett/zookeeper_e… 1 [OK]duffqiu/zookeeper-cli 1 [OK]pravega/zookeeper-operator Kubernetes operator for Zookeeper 0 phenompeople/zookeeper Apache ZooKeeper is an open-source server wh… 0 [OK]dabealu/zookeeper-exporter zookeeper exporter for prometheus 0 [OK]midonet/zookeeper Dockerfile for a Zookeeper server. 0 [OK]humio/zookeeper-dev zookeeper build with zulu jvm.拉取官方Zookeeper

默认拉取最新版本

evans-MacBook-Pro:tool evan$ docker pull zookeeperUsing default tag: latestlatest: Pulling from library/zookeeperb4d181a07f80: Pull complete 3ee45ae97306: Pull complete 567d410fadc4: Pull complete 891cdfaa81b9: Pull complete 7d811fb3c718: Pull complete 259c7b233169: Pull complete 19a00500c36e: Pull complete 907b63c43842: Pull complete Digest: sha256:d5965c84bbfc33f9a718d9eedec0137dd91e2298e213379549e75ebb0fa49d51Status: Downloaded newer image for zookeeper:latestdocker.io/library/zookeeper:latest

查询本地镜像

evans-MacBook-Pro:tool evan$ docker image lsREPOSITORY TAG IMAGE ID CREATED SIZEzookeeper latest 50d238989423 33 hours ago 269MBmysql latest c0cdc95609f1 6 weeks ago 556MBjenkins/jenkins latest 22c34b2deb6c 15 months ago 619MBpostgres latest cf879a45faaa 17 months ago 394MBevan/centos dev 631b0bcb4bcc 18 months ago 191MBtruevoly/oracle-12c latest 21789d4d876f 2 years ago 5.7GB

运行Zookeeper

指定端口为2181,容器名称为zookeeper

evans-MacBook-Pro:tool evan$ docker run -d -p 2181:2181 --name zookeeper --restart always 50d238989423548d103dabaa3c453f48a55f8dfeb3d241a60ad27fe0f11a114534ae5464b3fe

查看Zookeeper容器ID

evans-MacBook-Pro:tool evan$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES548d103dabaa 50d238989423 "/docker-entrypoint.…" 3 minutes ago Up 3 minutes 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp, :::2181->2181/tcp, 8080/tcp zookeeper

通过容器ID进入Zookeeper

evans-MacBook-Pro:tool evan$ docker exec -it 548d103dabaa bashroot@548d103dabaa:/apache-zookeeper-3.7.0-bin#

执行Zookeeper启动命令

root@548d103dabaa:/apache-zookeeper-3.7.0-bin# ./bin/zkCli.shConnecting to localhost:21812021-06-27 15:15:06,993 [myid:] - INFO [main:Environment@98] - Client environment:zookeeper.version=3.7.0-e3704b390a6697bfdf4b0bef79e3da7a4f6bac4b, built on 2021-03-17 09:46 UTC ##...省略... WatchedEvent state:SyncConnected type:None path:null[zk: localhost:2181(CONNECTED) 0]

下载Zookeeper可视化控制台

这里我随便在Github下了一个 ,供大家参考

运行Zookeeper-manager代码

导入IDEA,直接启动ZookeeperManagerApplication,默认端口是8081

连接Zookeeper服务

这里添加一个新的服务,输入127.0.0.1:2181

到此这篇关于Docker快速安装Zookeeper的文章就介绍到这了,更多相关Docker安装Zookeeper内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!


网页名称:Docker快速安装Zookeeper的详细教程
浏览路径:http://cqcxhl.com/article/sgeogc.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP