I. Main points of this paper

This article will introduce the use of Docker to quickly build a development environment, build ZooKeeper, Kafka instance. A complete catalog of articles in the series

  • Docker command
  • Docker installation kafka
  • Common docker commands

Second, development environment

  • 2 d0083d docker 18.09.7, build
  • Linux 64 – bit
  • 2.12 2.3.0 kafka
  • Zookeeper 3.4.13

Install docker

Reference: blog.csdn.net/caiwen_5050…

4. Install ZooKeeper

1. Install and set the password

Zookeeper port 2181
docker pull wurstmeister/zookeeper
docker run -d --name zookeeper --publish  2181:2181 -t wurstmeister/zookeeper
Copy the code

2. Login and verify

Enter the ZooKeeper container
docker exec -it zookeeper /bin/bash

# Login service
bin/zkCli.sh 

# query command
[zk: localhost:2181(CONNECTED) 0] ls /
[log_dir_event_notification, isr_change_notification, zookeeper, admin, consumers, cluster, config, latest_producer_id_block, kafka-manager, controller, brokers, controller_epoch]
[zk: localhost:2181(CONNECTED) 1] 
[zk: localhost:2181(CONNECTED) 1] 
Copy the code

Install Kafka

#Install Kafka on port 9092docker run -d --name kafka --publish 9092:9092 --link zookeeper --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env KAFKA_ADVERTISED_HOST_NAME = 9.134. XXX. XXX -- -- env KAFKA_ADVERTISED_PORT = 9092 - volume/etc/localtime: / etc/localtime wurstmeister/kafka:latestCopy the code

Six, the summary

Zookeeper and Kafka are set up with a few simple commands. SpringBoot integration Kafka

Add me to exchange learning!