zoukankan      html  css  js  c++  java
  • docker-搭建单机 kafka+zookeeper

    1 zookeeper
     
    docker run --name zookeeper -p 12181:2181 -d wurstmeister/zookeeper:latest
     
    2 kafka
     
    docker run -p 19092:9092 --name kafka1 -d -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=10.10.10.188:12181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.10.10.188:19092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 wurstmeister/kafka:latest
     
    3.测试
     
    #在守护式容器中启动一个交互式进程
    docker exec -i -t kafka1 /bin/bash
    cd /opt/kafka/bin/
     
    #创建主题test3
    ./kafka-topics.sh --zookeeper 10.10.10.188:12181 --create --topic test3 --replication-factor 1 --partitions 3 Created topic "test3"
     
    #查看主题test3
    ./kafka-topics.sh --zookeeper 10.10.10.188:12181 --describe --topic test3 
  • 相关阅读:
    redis
    JSP
    Cookie&Session
    Servlet
    HTTP
    TomCat
    CSS
    XML
    JDBC
    Mysql(对表的操作)
  • 原文地址:https://www.cnblogs.com/brady-wang/p/13741988.html
Copyright © 2011-2022 走看看