Coder Social home page Coder Social logo

docker-kafka's Introduction

前往 github 查看 dockerfiledocker-compose.yml
本 repo 内容与 https://github.com/mailbyms/DockerBuild/tree/master/KAFKA 一致

注意

  1. 修改.env 里的COMPOSE_PROJECT_NAME,它会影响: 生成的容器名字的前缀
    生成的网络名字的前缀
  2. kafka 的 hostname 格式为 xxx-id,在kafka启动脚本中,id会作为 broker-id
  3. kafka 从环境变量 ZK_SERVER 获取 zookeeper 的连接地址
  4. 如果 kafka 要给其它电脑访问,则设置 docker-compose.yml 的 ADVERTISED_IP 为宿主机的 IP
  5. KAFKA_PORT 同时作为 listeners 和 advertised.listeners 的端口。即要求容器映射端口时,内外端口值一致。默认值为9092

启动相关

  • Kafka 在 Zookeeper 上注册,Zookeeper 连接超时默认为 18 秒。当 Kafka 停止后马上启动,会报错 NodeID 已存在。须等待 Zookeper 打印 18 秒超时后再启动 Kafka
  • Kafka 的 Cluster ID (本地保存在 /tmp/kafka-logs/meta.properties),同样在 Zookeeper 上注册。所以 Zookeeper 要做好数据持久化

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.