Skip to content

Instantly share code, notes, and snippets.

@vector4wang
Last active July 24, 2019 01:56
Show Gist options
  • Save vector4wang/5dff5b6e5abcc41f8955d566dedf74e7 to your computer and use it in GitHub Desktop.
Save vector4wang/5dff5b6e5abcc41f8955d566dedf74e7 to your computer and use it in GitHub Desktop.
[Docker 安装 kafka] #Docker #Kafka #安装

download images

docker pull wurstmeister/zookeeper
docker pull wurstmeister/kafka
docker pull sheepkiller/kafka-manager

run zookepper

docker run -d --name zookeeper --publish 2181:2181 \
  --volume /etc/localtime:/etc/localtime \
  --restart=always \
  wurstmeister/zookeeper

run kafka

docker run --name kafka \
  -p 9092:9092 \
  --link zookeeper:zookeeper \
  -e KAFKA_ADVERTISED_HOST_NAME=192.168.1.8 \
  -e KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 \
  -d  wurstmeister/kafka  

run kafka manager

docker run -d \
  --link zookeeper:zookeeper \
  -p 9000:9000  \
  -e ZK_HOSTS="zookeeper:2181" \
  hlebalbau/kafka-manager:stable \
  -Dpidfile.path=/dev/null

如果想设置webui 的权限,可以这样设置

KAFKA_MANAGER_AUTH_ENABLED: "true"
KAFKA_MANAGER_USERNAME: username
KAFKA_MANAGER_PASSWORD: password

web ui in localhost:9000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment