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