zoukankan      html  css  js  c++  java
  • kafka的一些常用命令

     

    启动zookeeper

    bin/zookeeper-server-start.sh config/zookeeper.properties &

    启动kafka

    bin/kafka-server-start.sh config/server.properties &

    停止kafka
    bin/kafka-server-stop.sh

    停止zookeeper
    bin/zookeeper-server-stop.sh

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

    展示topic
    bin/kafka-topics.sh --list --zookeeper localhost:2181

    描述topic
    bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic my-replicated-topic

    生产者:
    bin/kafka-console-producer.sh --broker-list 130.51.23.95:9092 --topic my-replicated-topic

    消费者:
    bin/kafka-console-consumer.sh --zookeeper 130.51.23.95:2181 --topic test --from-beginnin

    查看条数
    ./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list localhost:9092 --topic my-topic --time -1

    删除话题
    /kafka-topics.sh --zookeeper localhost:2181 --delete --topic my-topic

  • 相关阅读:
    16解释器模式Interpreter
    15适配器模式Adapter
    14桥接模式Bridge
    13组合模式Composite
    12外观模式Facade
    11代理模式Proxy
    10享元模式Flyweight
    09观察者模式ObServer
    08策略模式Strategy
    07装饰模式Decorator
  • 原文地址:https://www.cnblogs.com/skying555/p/7890955.html
Copyright © 2011-2022 走看看