Giter Site home page Giter Site logo

namhsc / kafka-kraft-cluster-docker-compose Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minhhungit/kafka-kraft-cluster-docker-compose

0.0 0.0 0.0 390 KB

workable kafka cluster with kraft mode using docker-compose

Shell 5.13% C# 77.22% Dockerfile 17.65%

kafka-kraft-cluster-docker-compose's Introduction

KAFKA CLUSTER KRAFT MODE - DOCKER COMPOSE

How to run

docker-compose up -d

Before connecting to cluster from outside docker ( ex from your docker host - your PC ), we also need to config host file:

Example for windows:

# C:\Windows\System32\drivers\etc\hosts

127.0.0.1 kafka01
127.0.0.1 kafka02
127.0.0.1 kafka03

Done !

Connection string (public)

kafka01:29192,kafka02:29292,kafka03:29392

.NET Demo (run outside docker)

Check here

Or run demo directly inside docker using bellow commands:

docker run -it --rm --network kafka-kraft-cluster-docker-compose_default confluentinc/cp-kafka /bin/kafka-console-producer --bootstrap-server kafka01:9092,kafka02:9092,kafka03:9092 --topic test_topic

then enter some text to produce message

Performance test

inside docker (container => container)

 docker run -it --rm --network kafka-kraft-cluster-docker-compose_default confluentinc/cp-kafka /bin/kafka-producer-perf-test --topic test_topic --num-records 1000000 --throughput -1 --producer-props bootstrap.servers=kafka01:9092,kafka02:9092,kafka03:9092 batch.size=16384 acks=1 linger.ms=50 --record-size 1000


outside docker (from host => container)

 $ .\kafka-producer-perf-test.bat --topic test_topic --num-records 1000000 --throughput -1 --producer-props bootstrap.servers=kafka01:29192,kafka02:29292,kafka03:29392 acks=1 linger.ms=50 --record-size 1000


$ .\kafka-consumer-groups.bat --bootstrap-server kafka01:29192,kafka02:29292,kafka03:29392 --group my-group1 --describe

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.