zoukankan      html  css  js  c++  java
  • kafka本地单机模式配置

    下载kafka:http://kafka.apache.org/downloads

    配置config/server.properties

      启动kafka

    lihudeMacBook-Pro:kafka_2.11-0.10.1.0 SunAndLi$ sh bin/kafka-server-start.sh config/server.properties
    

      新建一个topic

    lihudeMacBook-Pro:kafka_2.11-0.10.1.0 SunAndLi$  bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic sun_test
    查看topic是否成功
    lihudeMacBook-Pro:kafka_2.11-0.10.1.0 SunAndLi$ bin/kafka-topics.sh --list --zookeeper localhost:2181
    
    
    把KAFKA的生产者启动起来:
    lihudeMacBook-Pro:kafka_2.11-0.10.1.0 SunAndLi$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic sun_test
    
    
    另开一个终端,把消费者启动起来:
    lihudeMacBook-Pro:kafka_2.11-0.10.1.0 SunAndLi$ bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic sun_test --from-beginning
    
    
    ps:若需要挂到后台使用只需在代码后面添加&
  • 相关阅读:
    restapi(6)- do it the functional way, 重温函数式编程
    JS模块化
    socket.io websocket
    CSS 文字换行
    webpack初识
    升级nodejs至最新
    JavaScript Promise迷你书(中文版)
    时间格式化
    npm yarn
    深入浅出MongoDB应用实战开发
  • 原文地址:https://www.cnblogs.com/sunyaxue/p/6375119.html
Copyright © 2011-2022 走看看