Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to deploy an ookeeper with docker in centos6

Shulou Source: shulou.com Published: 2022-06-01 22:06:08 11月08日 Update

Today, I will talk to you about how to use docker to deploy an ookeeper in centos6. Many people may not know much about it. In order to make you understand better, the editor summarized the following content for you. I hope you can get something according to this article.

Directory structure:

/ zookeeper

/ Dockerfile

/ start.sh

/ Readme

/ zookeeper-3.4.10.tar.gz

Dockerfile

FROM centosMAINTAINER qiongtao.li hnatao@126.comADD. / zookeeper-3.4.10.tar.gz / optADD. / start.sh / start.shENV ZOO_PORT=2181\ ZOO_DIR=/opt/zookeeper\ ZOO_DATA_DIR=/data/zookeeper/data ZOO_DATA_LOG_DIR=/data/zookeeper/logsRUN echo "Asia/shanghai" > / etc/timezone\ & & cp / usr/share/zoneinfo/Asia/Shanghai / etc/localtime\ & & yum-y install java\ & & mkdir-p "$ZOO_DATA _ DIR "\ & & mkdir-p" $ZOO_DATA_LOG_DIR "\ & & mv / opt/zookeeper-3.4.10" $ZOO_DIR "VOLUME [" $ZOO_DATA_DIR "] EXPOSE $ZOO_PORTENV PATH=$PATH:$ZOO_DIR/binENTRYPOINT [" sh " "/ start.sh"]

Start.sh

#! / bin/bashCONF=$ {ZOO_DIR} / conf/zoo.cfgcp-a ${ZOO_DIR} / conf/zoo_sample.cfg $CONFsed-I "s | dataDir=/tmp/zookeeper | dataDir=$ {ZOO_DATA_DIR} | g" $CONFsed-I "s | clientPort=2181 | clientPort=$ {ZOO_PORT} | g" $CONFecho "dataLogDir=$ {ZOO_DATA_LOG_DIR}" > $CONFfor server in $ZOO_SERVERS; do echo "$server" > $CONFdoneif [!-f "$ZOO_DATA_DIR/myid"] Then echo "${ZOO_MY_ID:-1}" > "$ZOO_DATA_DIR/myid" fizkServer.sh start-foreground

Readme

Docker rm-f zkdocker rmi-f zkdocker build-t zk. Docker run-d\-p 2181 zk 2181\-name zk\-v / data:/data\ zkdocker ps-adocker logs-f zk

Test installation deployment

Cat Readme | while read line; do $line; done after reading the above, do you have any further understanding of how to deploy an ookeeper in centos6 using docker? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Content more contents knowledge articles structure Industry Information Channel Channel enter one support related Test Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux OPPO Reno Apple Xiaomi