kafka 集群搭建
kafka集群
>sa1,sa2,sa3
配置文件信息
broker.id=0
listeners=PLAINTEXT://192.168.0.130:9092
log.dirs=/home/centos01/kafka/logs
zookeeper.connect=sa0:2181,sa1:2181,sa2:2181
启动过程:
kafka-server-start.sh -daemon server.properties
查看主题
kafka-topics.sh --zookeeper sa0:2181 --list
创建主题
kafka-topics.sh --create --zookeeper sa0:2181 --replication-factor 2 --partitions 3 --topic test
生产者
kafka-console-producer.sh --broker-list sa0:9092 --topic test
消费者
kafka-console-consumer.sh --zookeeper sa0:2181 --from-beginning --topic test
查看topic描述信息
kafka-topics.sh --zookeeper node1:2181 --topic topic1 --describe
遇到的问题
Service has only 0 Kafka Broker roles running instead of minimum required 1.