
michaeldqin/kafkaApache Kafka (1.0.0) Docker Image Bundled with Zookeeper
Why do I create this Kafka (& Zookeeper) docker image? Simply because I couldn't find any better Kafka docker images bundled with Zookeeper for my development needs. I need the latest Kafka 1.0.0 to work in docker. Explored spotify/kafka docker image (currently Kafka 0.10.1.0), and it's not up to date yet. Therefore, I've decided to create one myself.
This is my environment for your reference. If your environment is different from mine, you can easily twist the settings for your own.
Here is the diagram to show the environment.
!environment
You can pull the docker image from docker hub:
shdocker pull michaeldqin/kafka
Apache Kafka (1.0.0) Docker Image Bundled with Zookeeper @ Docker Hub
This docker image is built on:
shdocker run --rm -d -p 2181:2181 -p 9092:9092 \ --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 \ --name kafka -h kafka michaeldqin/kafka
sh$KAFKA_HOME/bin/kafka-console-producer.sh \ --broker-list localhost:9092 --topic test
sh$KAFKA_HOME/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 \ --topic test --from-beginning
Here is the diagram to show Kafka server container listens on 'localhost:9092'.
shdocker run --rm -d -p 2181:2181 -p 9092:9092 \ --env ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092 \ --name kafka -h kafka michaeldqin/kafka
shdocker run --rm -it --name producer --link kafka michaeldqin/kafka \ kafka-console-producer.sh --broker-list kafka:9092 --topic test
shdocker run --rm -it --name consumer --link kafka michaeldqin/kafka \ kafka-console-consumer.sh --bootstrap-server kafka:9092 \ --topic test --from-beginning
Here is the diagram to show Kafka server container listens on 'kafka:9092'.
!container
The following optional environment variables can be passed onto Kafka container during startup:
Use the following format:
--env ENV_VARIABLE_NAME=[value]
sh# DEFAULT: advertised.listeners=null #ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 # DEFAULT: auto.create.topics.enable=true #AUTO_CREATE_TOPICS_ENABLE=true # DEFAULT: auto.leader.rebalance.enable=true #AUTO_LEADER_REBALANCE_ENABLE=true # DEFAULT: delete.topic.enable=true #DELETE_TOPIC_ENABLE=true # DEFAULT: broker.id=0 #BROKER_ID=100 # DEFAULT: log.dirs=/tmp/kafka-logs #LOG_DIRS=/tmp/kafka-logs # DEFAULT: num.partitions=1 #NUM_PARTITONS=1 # DEFAULT: log.retention.hours=168 #LOG_RETENTION_HOURS=168 # DEFAULT: log.retention.bytes=-1 #LOG_RETENTION_BYTES=*** # DEFAULT: socket.send.buffer.bytes=*** #SOCKET_SEND_BUFFER_BYTES=204800 # DEFAULT: socket.receive.buffer.bytes=*** #SOCKET_RECEIVE_BUFFER_BYTES=204800 # DEFAULT: zookeeper.connect=localhost:2181 #ZOOKEEPER_CONNECT=localhost:2181 # DEFAULT: zookeeper.connection.timeout.ms=6000 #ZOOKEEPER_CONNECTION_TIMEOUT_MS=***
To access container start-up log, it's located in $KAFKA_HOME/log/start-kafka.log inside the container.
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务