kafka2.11安装、测试

kafka的一些基本命令

启动zookeeper
      ./zkServer start.sh    ./config/zookeper.properties

启动kafka
     ./zkfka-server-start.sh   config/server.properties


此处topic名称以test为例
容易出错的地方localhost:2181此处需和server.properties中的配置相吻合

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

查询topic列表
    ./kafka-topics.sh --list --zookeeper localhost:2181

启动 Producer(生产者)
    ./kafka-console-producer.sh --broker-list localhost:9092 --topic test 

启动 Consummer
    ./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning

topic的信息
    ./kafka-topics.sh --describe --zookeeper localhost:2181 --topic test
 

你可能感兴趣的:(Liunx)