GithubHelp home page GithubHelp logo

kafka-compose-3-node-cluster's Introduction

  • single-zookeeper-docker-compose.yaml 3kf, 1zk, Working.
  • 3zk-3kf-docker-compose.yaml - 3kf, 3zk. Working.
  • docker-compose.yaml - volumes for data/logs, 3zk, 3kf. Not working.

Useful links: https://github.com/conduktor/kafka-stack-docker-compose https://github.com/confluentinc/cp-docker-images/blob/5.3.3-post/examples/kafka-cluster/docker-compose.yml https://github.com/bitnami/bitnami-docker-zookeeper/blob/master/docker-compose-cluster.yml

Guide for docker-compose.yaml:

1. SSH to VM and prepare env

Create required directories:

mkdir kafka && cd kafka
mkdir zk1 zk2 zk3 kf1 kf2 kf3

Copy docker-compose

vi docker-compose.yaml

Start docker compose

docker-compose up -d

Get docker network private IPs of container instances

docker ps -a
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container_name> 

2. Connect to kafka containers

docker exec -it <container_name> /bin/bash

Broker 1 container:

kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 3 --partitions 3 --topic reviews
kafka-topics --list --bootstrap-server localhost:9092
kafka-topics --bootstrap-server localhost:9092 --describe --topic reviews
kafka-console-producer --topic reviews --bootstrap-server localhost:9092

Broker 2 container:

kafka-console-consumer --topic reviews --from-beginning --bootstrap-server localhost:9092

kafka-compose-3-node-cluster's People

Contributors

marianhladun avatar

Watchers

 avatar

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.