In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
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.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.