docker部署kafka

docker镜像

[root@localhost kafka]# docker images 
REPOSITORY                                                        TAG                 IMAGE ID            CREATED             SIZE
zookeeper                                                         latest              50d238989423        2 months ago        269MB
wurstmeister/kafka                                                latest              c3b059ede60e        2 months ago        507MB

load

docker load -i zookeeper.tar 
docker load -i kafka.tar

启动

docker run -d --name zookeeper -p 2181:2181  zookeeper
docker run -d --name kafka --publish 9092:9092 --link zookeeper --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env KAFKA_ADVERTISED_HOST_NAME=你的宿主ip --env KAFKA_ADVERTISED_PORT=9092 --volume /etc/localtime:/etc/localtime wurstmeister/kafka:latest

produce,sub

cd /opt/kafka/bin

创建topic
kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 1 --topic aa

创建生产者
./kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic aa

创建消费者
./kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic aa --group g1


查看broker下的所有group
kafka-consumer-groups.sh --bootstrap-server 127.0.0.1:9092 --list

查询某个group下订阅的所有topic
kafka-consumer-groups.sh --bootstrap-server 127.0.0.1:9092 --describe --group g1

查询订阅某个topic的所有group, 无

docker部署kafka

原理
http://www.360doc.com/content/18/0904/21/41344223_783908767.shtml
https://my.oschina.net/jallenkwong/blog/4449224

命令
https://www.cnblogs.com/wangzhuxing/p/10127497.html
https://www.cnblogs.com/lvzuwen/p/13803154.html
https://www.jianshu.com/p/d5c88f0b904c

https://segmentfault.com/a/1190000038974239
http://blog.70ci.com/post/736.html
https://www.cnblogs.com/kaichenkai/p/11234450.html

docker部署kafka

上一篇:PS设计制作一个逼真的翻页日历图标教程


下一篇:Photoshop照亮边缘滤镜把人物的脸部合成烧焦效果图