[Zookeeper:基于容器化]:快速部署安装

文章目录

  • 一:拉取docker zookeeper镜像
  • 二:创建zookeeper宿主机data目录
  • 三:运行容器
  • 四:开放防火墙

一:拉取docker zookeeper镜像

[root@vboxnode3ccccccttttttchenyang bigdata]# docker pull zookeeper
Using default tag: latest
latest: Pulling from library/zookeeper
a2abf6c4d29d: Pull complete
2bbde5250315: Pull complete
202a34e7968e: Pull complete
4e4231e30efc: Pull complete
707593b95343: Pull complete
b070e6dedb4b: Pull complete
46e5380f3905: Pull complete
8b7e330117e6: Pull complete
Digest: sha256:2c8c5c2db6db22184e197afde13e33dad849af90004c330f20b17282bcd5afd7
Status: Downloaded newer image for zookeeper:latest
docker.io/library/zookeeper:latest

二:创建zookeeper宿主机data目录

[root@vboxnode3ccccccttttttchenyang docker]# cd zookeeper/
[root@vboxnode3ccccccttttttchenyang zookeeper]# ls
[root@vboxnode3ccccccttttttchenyang zookeeper]# mkdir data
[root@vboxnode3ccccccttttttchenyang zookeeper]# ls
data
[root@vboxnode3ccccccttttttchenyang zookeeper]# cd data/
[root@vboxnode3ccccccttttttchenyang data]# pwd
/usr/local/home/docker/zookeeper/data
[root@vboxnode3ccccccttttttchenyang bigdata]# ls
[root@vboxnode3ccccccttttttchenyang bigdata]# cd ..
[root@vboxnode3ccccccttttttchenyang home]# ls
bigdata  docker  log.file  sentinel-dashboard-1.8.6.jar  server
[root@vboxnode3ccccccttttttchenyang home]# cd docker
[root@vboxnode3ccccccttttttchenyang docker]# ls
config.txt  kibana  nacos  seata
[root@vboxnode3ccccccttttttchenyang docker]# mkdir zookeeper
[root@vboxnode3ccccccttttttchenyang docker]# ls
config.txt  kibana  nacos  seata  zookeeper
[root@vboxnode3ccccccttttttchenyang docker]# cd zookeeper/
[root@vboxnode3ccccccttttttchenyang zookeeper]# ls
[root@vboxnode3ccccccttttttchenyang zookeeper]# mkdir data
[root@vboxnode3ccccccttttttchenyang zookeeper]# ls
data
[root@vboxnode3ccccccttttttchenyang zookeeper]# cd data/
[root@vboxnode3ccccccttttttchenyang data]# pwd
/usr/local/home/docker/zookeeper/data
[root@vboxnode3ccccccttttttchenyang data]# docker images
REPOSITORY                                                        TAG        IMAGE ID       CREATED         SIZE
calico/kube-controllers                                           v3.25.0    5e785d005ccc   7 months ago    71.6MB
calico/cni                                                        v3.25.0    d70a5947d57e   7 months ago    198MB
calico/node                                                       v3.25.0    08616d26b8e7   7 months ago    245MB
zookeeper                                                         latest     36c607e7b14d   20 months ago   278MB
coredns/coredns                                                   latest     a4ca41631cc7   22 months ago   46.8MB
registry.aliyuncs.com/google_containers/coredns/coredns           v1.8.0     a4ca41631cc7   22 months ago   46.8MB
registry.aliyuncs.com/google_containers/kube-apiserver            v1.21.0    4d217480042e   2 years ago     126MB
registry.aliyuncs.com/google_containers/kube-proxy                v1.21.0    38ddd85fe90e   2 years ago     122MB
registry.aliyuncs.com/google_containers/kube-controller-manager   v1.21.0    09708983cc37   2 years ago     120MB
registry.aliyuncs.com/google_containers/kube-scheduler            v1.21.0    62ad3129eca8   2 years ago     50.6MB
registry.aliyuncs.com/google_containers/pause                     3.4.1      0f8457a4c2ec   2 years ago     683kB
registry.aliyuncs.com/google_containers/etcd                      3.4.13-0   0369cf4303ff   2 years ago     253MB

三:运行容器

[root@vboxnode3ccccccttttttchenyang data]# docker run -d -e TZ="Asia/Shanghai" -p 2181:2181 -v /usr/local/home/docker/zooke           eper/data:/data --name zookeeper --restart always zookeeper
19e9e530807895843972df3432aad79b1a48826d0f9818763d0db901861cafb8

四:开放防火墙

[root@vboxnode3ccccccttttttchenyang data]# firewall-cmd --permanent --zone=public --add-port=2181/tcp
success
[root@vboxnode3ccccccttttttchenyang data]# firewall-cmd --reload
success
[root@vboxnode3ccccccttttttchenyang data]# firewall-cmd --permanent --zone=public --list-port
3306/tcp 8848/tcp 8091/tcp 8879/tcp 8887/tcp 8083/tcp 8086/tcp 8090/tcp 8099/tcp 9600/tcp 4560/tcp 5601/tcp 443/tcp 8443/tcp 30001/tcp 6443/tcp 2181/tcp
[root@vboxnode3cccccctttt

[Zookeeper:基于容器化]:快速部署安装_第1张图片

你可能感兴趣的:(中间件,zookeeper,分布式,云原生)