Detailed tutorial on how to quickly install Zookeeper in Docker

Detailed tutorial on how to quickly install Zookeeper in Docker

Docker Quickly Install Zookeeper

I haven't used Zookeeper for a long time after changing companies. Recently, I need to use it when working on Elastic-Job . Here I briefly record the process of setting up with Docker . The next article will explain how to quickly build a cluster. I won’t go into detail here about how to build Docker . If you want to learn more about Docker , you can check out the Docker series of articles I wrote before.

Search for Zookeeper images

evans-MacBook-Pro:tool evan$ docker search zookeeper
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
zookeeper Apache ZooKeeper is an open-source server which… 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 which… 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.

Pull the official Zookeeper

Pull the latest version by default

evans-MacBook-Pro:tool evan$ docker pull zookeeper
Using default tag: latest
latest: Pulling from library/zookeeper
b4d181a07f80: 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:d5965c84bbfc33f9a718d9eedec0137dd91e2298e213379549e75ebb0fa49d51
Status: Downloaded newer image for zookeeper:latest
docker.io/library/zookeeper:latest

Query local image

evans-MacBook-Pro:tool evan$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
zookeeper latest 50d238989423 33 hours ago 269MB
mysql latest c0cdc95609f1 6 weeks ago 556MB
jenkins/jenkins-latest 22c34b2deb6c 15 months ago 619MB
postgres latest cf879a45faaa 17 months ago 394MB
evan/centos-dev 631b0bcb4bcc 18 months ago 191MB
truevoly/oracle-12c latest 21789d4d876f 2 years ago 5.7GB

Running Zookeeper

Specify port 2181 and container name zookeeper

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

View Zookeeper container ID

evans-MacBook-Pro:tool evan$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
548d103dabaa 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

Enter Zookeeper by container ID

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

Execute the Zookeeper startup command

root@548d103dabaa:/apache-zookeeper-3.7.0-bin# ./bin/zkCli.sh
Connecting to localhost:2181
2021-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
 ##...omitted...
 WatchedEvent state:SyncConnected type:None path:null
[zk:localhost:2181(CONNECTED) 0]

Download Zookeeper Visualization Console

Here I just downloaded one from Github for your reference

https://github.com/hellosix/zookeeper-manager/archive/refs/heads/master.zip

Run Zookeeper-manager code

Import IDEA and start ZookeeperManagerApplication directly. The default port is 8081.

Connecting to Zookeeper Service

Add a new service here and enter 127.0.0.1:2181

This is the end of this article about how to quickly install Zookeeper with Docker. For more information about how to install Zookeeper with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Install Zookeeper under Docker (standalone and cluster)
  • CentOS 6 uses Docker to deploy Zookeeper operation example
  • Implementation of Docker to build Zookeeper&Kafka cluster

<<:  MySQL full-text search usage examples

>>:  A brief analysis of HTML space code

Recommend

Implementation of Mysql User Rights Management

1. Introduction to MySQL permissions There are 4 ...

Detailed explanation of cross-usage of Ref in React

Table of contents 1. First, let’s explain what Re...

Vue implements weather forecast function

This article shares the specific code of Vue to r...

A few steps to easily build a Windows SSH server

The SSH mentioned here is called Security Shell. ...

Native JS to achieve image marquee effects

Today I will share with you a picture marquee eff...

How to monitor multiple JVM processes in Zabbix

1. Scenario description: Our environment uses mic...

MySQL installation and configuration methods and precautions under Windows platform

2.1、msi installation package 2.1.1、Installation I...

Understanding of haslaylout and bfc parsing

1. haslayout and bfc are IE-specific and standard ...

Tutorial on how to quickly deploy a Nebula Graph cluster using Docker swarm

1. Introduction This article describes how to use...

A case study on MySQL optimization

1. Background A sql-killer process is set up on e...

Solve the problem of Docker starting Elasticsearch7.x and reporting an error

Using the Docker run command docker run -d -p 920...

MySQL query optimization: causes and solutions for slow queries

Friends who are doing development, especially tho...