zoukankan      html  css  js  c++  java
  • Kafka命令清单

    一、队列常用命令

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

    #查看队列列表
    $ ./kafka-topics.sh --list --zookeeper chenx02:2181

    #查看队列明细
    $ ./kafka-topics.sh --describe --zookeeper chenx02:2181 --topic test

    #修改(test)队列参数
    $ ./kafka-topics.sh --zookeeper chenx02:2181 --partition 3 --topic test --alter

    #创建多副本的队列
    $ ./kafka-topics.sh --create --zookeeper chenx02:2181 --replication-factor 3 --partitions 4 --topic test_kafka 

    #删除kafka的队列[注意需要重启kafka集群] 
    $ ./kafka-run-class.sh kafka.admin.DeleteTopicCommand --topic test_kafka --zookeeper chenx02:2181

    #查看不可用的分区 
    $./kafka-topics.sh --describe --unavailable-partitions --zookeeper chenx02:2181 --topic  test_kafka

    #发送消息 
    $ ./kafka-console-producer.sh --broker-list chenx02:9092 --topic test
    #消费消息 
    $ ./kafka-console-consumer.sh --zookeeper chenx02:2181 --topic test --from-beginning
  • 相关阅读:
    String类
    Scanner类
    Object类
    接口
    static关键字
    final关键字
    抽象类
    权限修饰符
    方法重写 (Override)
    面向对象思想特征
  • 原文地址:https://www.cnblogs.com/wxd0108/p/6829982.html
Copyright © 2011-2022 走看看