zoukankan      html  css  js  c++  java
  • windows kafka 命令操作主题

    windows 其实windows 和 Linux 差别就是

    windows要在bin内的windows文件夹内执行命令

    然后把 .sh改为 .bat

    对与主题等一些操作 也只是换成对应的名称

    widows 操作

    查询消费组

    kafka-consumer-groups.bat --bootstrap-server {kafka连接地址} --list

    D:kafkakafka_2.13-2.8.0inwindows>kafka-consumer-groups.bat --bootstrap-server localhost:9092 --list
    test4
    test2
    test3
    test
    test1


    查询消费组详情

    kafka-consumer-groups.bat --bootstrap-server {kafka连接地址} --describe --group {消费组}

    D:kafkakafka_2.13-2.8.0inwindows>kafka-consumer-groups.bat --bootstrap-server localhost:9092 --describe --group test

    GROUP           TOPIC           PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG             CONSUMER-ID                                         HOST           CLIENT-ID
    test           topic2          0          0               0               0               consumer-test-1-408db940-9588-4b23-8ba2-0ce73854add2 /172.19.214.14 consumer-test-1
    test           topic3          0          0               0               0               consumer-test-1-408db940-9588-4b23-8ba2-0ce73854add2 /172.19.214.14 consumer-test-1
    test           my-topic        0          1600            1600            0               consumer-test-1-408db940-9588-4b23-8ba2-0ce73854add2 /172.19.214.14 consumer-test-1
    test           my-topic1       0          0               0               0               -                                                    -               -
    test           my-topic2       0          0               0               0               -                                                    -               -

     

     

    删除消费组

    kafka-consumer-groups.bat --bootstrap-server {kafka连接地址} --delete --group {消费组}


    D:kafkakafka_2.13-2.8.0inwindows>kafka-consumer-groups.bat --bootstrap-server localhost:9092 --delete --group test3
    Deletion of requested consumer groups ('test3') was successful.

     

     

    Linux 操作

    查询消费组

    kafka-consumer-groups.sh --bootstrap-server {kafka连接地址} --list

    [root@zk-server-1 bin]# ./kafka-consumer-groups.sh --bootstrap-server 172.31.1.245:9091,172.31.1.86:9091,172.31.1.128:9091 --list
    Note: This will not show information about old Zookeeper-based consumers.
    KMOffsetCache-zk-server-1
    bbbb
    KMOffsetCache-zk-server-0

    ####

    查询消费组详情

    kafka-consumer-groups.sh --bootstrap-server {kafka连接地址} --describe --group {消费组}

    [root@zk-server-1 bin]#  ./kafka-consumer-groups.sh --bootstrap-server 172.31.1.245:9091,172.31.1.86:9091,172.31.1.128:9091 --describe --group bbbb
    Note: This will not show information about old Zookeeper-based consumers.
    Consumer group 'bbbb' has no active members.

    TOPIC           PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG             CONSUMER-ID     HOST           CLIENT-ID
    test            1          336             336             0               -               -               -
    test            0          334             334             0               -               -               -
    test            2          334             334             0               -               -               -

    ####

     

    删除消费组

    kafka-consumer-groups.sh --bootstrap-server {kafka连接地址} --delete --group {消费组}

    [root@zk-server-1 bin]# ./kafka-consumer-groups.sh --bootstrap-server 172.31.1.245:9091,172.31.1.86:9091,172.31.1.128:9091 --delete --group bbbb
    Note: This will not show information about old Zookeeper-based consumers.
    Deletion of requested consumer groups ('bbbb') was successful.

     

    对于老的消费者,由--zookeeper参数设置;对于新的消费者,由--bootstrap-server参数设置

  • 相关阅读:
    Google recaptcha在webform中的使用
    User control's property loses value after a postback
    share memory cache across multi web application
    Losing session data in ASP.NET
    What is the difference between UserControl, WebControl, RenderedControl and CompositeControl?
    maven跳过单元测试-maven.test.skip和skipTests的区别
    @RequestMapping @ResponseBody 和 @RequestBody 注解的用法与区别
    SpringBoot-@PathVariable
    pick王菊?作为“菊外人”的程序员能做点什么?
    数据库CRUD操作
  • 原文地址:https://www.cnblogs.com/blog-tian/p/15064462.html
Copyright © 2011-2022 走看看