##查询zookeeper镜像docker search zookeeper##拉去zookeeper镜像docker pull zookeeper:latest##本地创建zookeeper的挂载目录mkdir -p /opt/software/myfile/zookeeper/confmkdir -p /opt/software/myfile/zookeeper/datamkdir -p /opt/software/myfile/zookeeper/datalogcd /opt/software/myfile/zookeeper##运行一个zookeeper 复制它的配置文件到本地docker run --name zookeeper -p 2181:2181 -d zookeeperdocker container cp zookeeper:/conf .##关闭并删除dockerdocker stop zookeeperdocker rm zookeeper##启动一个新的zookeeper容器,并挂载本地配置和数据目录docker run --name zookeeper -p 2181:2181 -v /opt/software/myfile/zookeeper/conf:/conf -v /opt/software/myfile/zookeeper/data:/data -v /opt/software/myfile/zookeeper/datalog:/datalog --restart=always -d zookeeper
6、Docker-常用安装:Zookeeper、Kafka
时间:2023-06-14
一、Docker安装Zookeeper
上一篇:程序员怎么写出难维护的代码?
下一篇:Java代码中字符串拼接方式分析
相关推荐