文章目录
- 1、kafka集群搭建
- 1.1、下载镜像文件
- 1.2、创建zookeeper容器并运行
- 1.3、创建3个kafka容器并运行
- 1.3.1、9095端口
- 1.3.2、9096端口
- 1.3.3、9097端口
- 1.4、重启kafka-eagle
- 1.5、查看 efak
- 1.5.1、查看 brokers
- 1.5.2、查看 zookeeper
1、kafka集群搭建
1.1、下载镜像文件
docker pull bitnami/zookeeper
docker pull bitnami/kafka
1.2、创建zookeeper容器并运行
docker run -d --name kafka-zk -p 2181:2181 -e ALLOW_ANONYMOUS_LOGIN=yes bitnami/zookeeper
1.3、创建3个kafka容器并运行
1.3.1、9095端口
docker run -d --name kafka-01 -p 9095:9095 -e KAFKA_BROKER_ID=95 -e KAFKA_ZOOKEEPER_CONNECT=192.168.74.148:2181 -e ALLOW_PLAINTEXT_LISTENER=yes -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.74.148:9095 -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL,EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT,SASL_EXTERNAL:SASL_PLAINTEXT,SASL_INTERNAL:SASL_PLAINTEXT,SASL_SSL_EXTERNAL:SASL_SSL,SASL_SSL_INTERNAL:SASL_SSL,SSL_INTERNAL:SSL,SSL_EXTERNAL:SSL -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9095 -e KAFKA_MESSAGE_MAX_BYTES=1000000 bitnami/kafka
1.3.2、9096端口
docker run -d --name kafka-02 -p 9096:9096 -e KAFKA_BROKER_ID=96 -e KAFKA_ZOOKEEPER_CONNECT=192.168.74.148:2181 -e ALLOW_PLAINTEXT_LISTENER=yes -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.74.148:9096 -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL,EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT,SASL_EXTERNAL:SASL_PLAINTEXT,SASL_INTERNAL:SASL_PLAINTEXT,SASL_SSL_EXTERNAL:SASL_SSL,SASL_SSL_INTERNAL:SASL_SSL,SSL_INTERNAL:SSL,SSL_EXTERNAL:SSL -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9096 -e KAFKA_MESSAGE_MAX_BYTES=1000000 bitnami/kafka
1.3.3、9097端口
docker run -d --name kafka-03 -p 9097:9097 -e KAFKA_BROKER_ID=97 -e KAFKA_ZOOKEEPER_CONNECT=192.168.74.148:2181 -e ALLOW_PLAINTEXT_LISTENER=yes -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://192.168.74.148:9097 -e KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL,EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT,SASL_EXTERNAL:SASL_PLAINTEXT,SASL_INTERNAL:SASL_PLAINTEXT,SASL_SSL_EXTERNAL:SASL_SSL,SASL_SSL_INTERNAL:SASL_SSL,SSL_INTERNAL:SSL,SSL_EXTERNAL:SSL -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9097 -e KAFKA_MESSAGE_MAX_BYTES=1000000 bitnami/kafka
1.4、重启kafka-eagle
[root@localhost ~]
kafka-eagle
1.5、查看 efak
1.5.1、查看 brokers
1.5.2、查看 zookeeper