Docker install Zookeeper stand-alone version

# 拉取 3.4.10版本的
[root@zjj101 ~]# docker pull zookeeper:3.4.10
3.4.10: Pulling from library/zookeeper
b56ae66c2937: Pull complete 
81cebc5bcaf8: Pull complete 
3b27fd892ecb: Pull complete 
6696ccdcd9ed: Pull complete 
a12f6b1c4023: Pull complete 
91e6981f84cd: Pull complete 
cb79785eedc3: Pull complete 
Digest: sha256:0e0dba8ed2eb0769bf1592809940702194a8db9c4d184b7c6b7040c923211648
Status: Downloaded newer image for zookeeper:3.4.10
docker.io/library/zookeeper:3.4.10

View the docker image

[root@zjj101 ~]# docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
springbootdemo4docker   latest              e2c24e317572        4 weeks ago         676MB
zookeeper               3.4.10              d9fe1374256f        2 years ago         144MB
[root@zjj101 ~]# 

Run docker image in stand-alone mode

d9fe1374256f is the IMAGE ID of images, which is the image you want to run, and this is the ID of the image

[root@zjj101 ~]# docker run -d -p 2181:2181 --name some-zookeeper --restart always d9fe1374256f        
90e898963a820ba363e3fb4f6664fbce298661a1d8754d496b6698bb29496bd6

Check if it is activated

[root@zjj101 ~]# docker ps -a         
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                                        NAMES
90e898963a82        d9fe1374256f         "/docker-entrypoint.…"   2 minutes ago       Up 3 seconds        2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp   some-zookeeper

It seems to have started.

External connection to Zookeeper

Found that it can be connected normally, indicating that the installation is successful
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41489540/article/details/109129293