Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/minhhungit/kafka-kraft-cluster-docker-compose

workable kafka cluster with kraft mode using docker-compose
https://github.com/minhhungit/kafka-kraft-cluster-docker-compose

docker-compose kafka kafka-cluster kafka-kraft kafka-ui kafka-zookeeperless

Last synced: about 1 month ago
JSON representation

workable kafka cluster with kraft mode using docker-compose

Awesome Lists containing this project

README

        

# KAFKA CLUSTER KRAFT MODE - DOCKER COMPOSE

- 3 nodes
- UI using `kafka UI` http://localhost:8080/
- UI using `kouncil` http://localhost:8082/

## 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](https://github.com/minhhungit/kafka-kraft-cluster-docker-compose/tree/main/client/KafkaDemo)

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
```