首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

KAFKA的安装及使用

下载KAFKA和zookeeper

KAFKA下载地址:

zookeeper下载地址:

启动zookeeper

运行zookeeper的bin目录的zkServer.cmd

修改kafka配置

config\server.properties

advertised.listeners=PLAINTEXT://192.168.0.10:9092 //配置对应的ip

log.dirs=E:\kafka_2.12-1.1.0\kafka-logs //配置对应的路径

启动kafka

启动cmd,进人到解压的kafka目录下运行下面命令:

.\BIN\windows\kafka-server-start.bat .\config\server.properties

创建一个topic:

.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic pms_cc

WARNING: Due to limitations in metric names, topics with a period ('.') or under

score ('_') could collide. To avoid issues it is best to use either, but not bot

h.

Created topic "pms_cc".

启动消费端:

.\bin\windows\kafka-console-consumer.bat --zookeeper 127.0.0.1:2181 --topicpms_cc

查看消费端列表:

.\bin\windows\kafka-consumer-groups.bat --zookeeper 127.0.0.1:2181 --list

Note: This will only show information about consumers that use ZooKeeper (not th

ose using the Java consumer API).

console-consumer-59686

查看消费端具体的信息:

.\bin\windows\kafka-consumer-groups.bat --zookeeper 127.0.0.1:2181 --group console-consumer-59686 --describe

Note: This will only show information about consumers that use ZooKeeper (not th

ose using the Java consumer API).

Error: Could not fetch offset from zookeeper for group 'console-consumer-59686'

partition 'pms_cc-0' due to missing offset data in zookeeper.

TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSU

MER-ID

pms_cc 0 - 0 - conso

le-consumer-59686_WRGHO-20181016O-1542109588575-ae591d12

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20181114G1N55G00?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券