1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 11:58:47 +00:00
dockerfiles/zookeeper/README.md
2019-12-03 17:28:17 +08:00

1.1 KiB

zookeeper

Apache ZooKeeper is an effort to develop and maintain an open-source server which enables highly reliable distributed coordination.

docker-compose.yml

zookeeper:
  image: zookeeper
  ports:
    - "2181:2181"
  volumes:
    - ./data/data:/data
    - ./data/datalog:/datalog
    - ./data/logs:/logs
  environment:
    - ZOO_LOG4J_PROP=INFO,ROLLINGFILE
    - ZOO_STANDALONE_ENABLED=true
  restart: always

Standalone Mode

$ docker-compose up -d

$ docker-compose exec zookeeper cat /conf/zoo.cfg

$ docker-compose exec zookeeper zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /conf/zoo.cfg
Client port found: 2181. Client address: localhost.
Mode: standalone

$ docker-compose exec zookeeper zkCli.sh
>>> help
>>> create /hello world
>>> get /hello
>>> delete /hello
>>> quit

Click this to learn more.

Cluster Mode

See: https://github.com/vimagick/dockerfiles/tree/master/kafka