/kafka-docker

Build kafka with docker and orchestrate kafka as well as zookeeper with docker-compose

Primary LanguageShellApache License 2.0Apache-2.0

Build Kafka cluster with docker-compose


集群管理方法

构建image

cd demokafka.0.10.1.0
docker-compose build

启动集群

cd demokafka.0.10.1.0
docker-compose up -d

停止集群

cd demokafka.0.10.1.0
docker-compose stop

删除集群

cd demokafka.0.10.1.0
docker-compose rm -f

集群配置说明

主要配置

  • ZOOKEEPER_CONNECT: zookeeper0:12181,zookeeper1:12182,zookeeper2:12183/kafka
  • BROKER_ID: 0
  • LISTENERS: PLAINTEXT://kafka0:19092,SSL://kafka0:29092
  • ZOOKEEPER_SESSION_TIMEOUT: 3600000
  • CONNECT_REST_PORT: 18083

其它配置

对于其它配置,配置名应以KAFKA_PROPERTY_开头,并且配置名须将点号换成下划线,如auto.create.topics.enable应以以下方式配置
KAFKA_PROPERTY_AUTO_CREATE_TOPICS_ENABLE: "false"