kafka功能演示

1.各个节点启动zookeeper
master和从节点都要启动;

[root@slave2 zookeeper-3.4.11]# ./bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/src/zookeeper-3.4.11/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@slave2 zookeeper-3.4.11]# 

2.启动kafka:
./bin/kafka-server-start.sh config/server.properties

[root@master kafka_2.11-0.10.2.1]# 
[root@master kafka_2.11-0.10.2.1]# ./bin/kafka-server-start.sh config/server.properties 
[2020-06-23 21:51:19,880] INFO KafkaConfig values: 
	advertised.host.name = null
	advertised.listeners = null
	advertised.port = null

3.查看主题:

[root@master kafka_2.11-0.10.2.1]# 
[root@master kafka_2.11-0.10.2.1]# ./bin/kafka-topics.sh --list --zookeeper localhost:2181
__consumer_offsets
test
[root@master kafka_2.11-0.10.2.1]# 

4.查看主题详情:

[root@master kafka_2.11-0.10.2.1]# ./bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test
Topic:test	PartitionCount:1	ReplicationFactor:1	Configs:
	Topic: test	Partition: 0	Leader: 0	Replicas: 0	Isr: 0
[root@master kafka_2.11-0.10.2.1]# 
[root@master kafka_2.11-0.10.2.1]# 

5.启动消息生产者:
./bin/kafka-console-producer.sh --broker-list master:9092 --topic test

5.启动消息生产者:

[root@master kafka_2.11-0.10.2.1]# 
[root@master kafka_2.11-0.10.2.1]# 
[root@master kafka_2.11-0.10.2.1]# 
[root@master kafka_2.11-0.10.2.1]# ./bin/kafka-console-producer.sh --broker-list master:9092 --topic test
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值