zoukankan      html  css  js  c++  java
  • Kafka安装

    1.安装zk集群

    2.config/server.properties
    添加zk地址:zookeeper.connect=node-1:2181,node-2:2181,node-3:2181
    修改broker.id(唯一的):broker.id=0

    3.启动
    /bin/kafka-server-start.sh config/server.properties > /dev/null 2>&1 &

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

    5.列出所有topic
    bin/kafka-topics.sh --list --zookeeper localhost:2181

    6.向topic中写入数据
    bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

    7.消费数据
    bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning

    8.查看指定topic的详情
    bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test

  • 相关阅读:
    sys.stdout.flush-倒计时
    wget 网站扒取
    万能英数脚本
    sample function
    get_time
    读取指定行
    request设置cookies
    resize2fs
    闭包与认识装饰器
    函数的名称空间与作用域
  • 原文地址:https://www.cnblogs.com/shan13936/p/13840160.html
Copyright © 2011-2022 走看看