社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  docker

zookeeper-docker 可以通过环境变量定义zk配置参数

赵安家 • 6 年前 • 543 次点击  

Useage

Clone repo

$ git clone https://github.com/anjia0532/zookeeper-docker.git
$ cd zookeeper-docker

Build

$ docker build --build-arg ZK_VERSION=3.4.10 . -t anjia0532/zookeeper:stable-alpine
$ docker build . -t anjia0532/zookeeper:stable-alpine # default ZK_VERSION is 3.4.11

Set zk config

$ docker run  -d --name zk  -e  ZK_abc_a=1 -e ZK_aBc=1 -e ZK_aB_c=1 anjia0532/zookeeper:3.4.11-alpine && docker container exec zk cat /opt/zk/conf/zoo.cfg
# //output 
# //...
# //aB.c=1
# //abc.a=1
# //aBc=1
  1. ZK_abc_a => abc.a
  2. ZK_aBc => aBc
  3. ZK_aB_c => aB.c

Custom init script

$ docker run  -d --name zk  -e  CUSTOM_INIT_SCRIPT="echo 1 > /opt/zk/data/myid" -e ZK_dataDir="/opt/zk/data/" anjia0532/zookeeper:3.4.11-alpine && docker container exec zk cat /opt/zk/conf/zoo.cfg && docker container exec zk cat /opt/zk/data/myid

#// /opt/zk/conf/zoo.cfg output
#// ...
#// dataDir=/opt/zk/data/
#// ...

#// /opt/zk/data/myid output
#// 1

Thanks

  1. wurstmeister/zookeeper-docker
  2. wurstmeister/kafka-docker
  3. rawmind0/alpine-zk

Feedback

create new issues

Copyright and License

This module is licensed under the BSD license.

Copyright (C) 2017-, by AnJia anjia0532@gmail.com.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


今天看啥 - 高品质阅读平台
本文地址:http://www.jintiankansha.me/t/U7TaWEV7iT
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/10144
 
543 次点击