Giter Club home page Giter Club logo

kafka-nginx-reverseproxy's Introduction

3 Node Kafka with NGINX Reverse Proxy

Introduction

As you might know, the Kafka protocol is such that clients have to be able to address individual kafka nodes after connecting to the bootstrap servers and getting the metadata which contain the nodes list and the partition assignments. Also, since consumers typically read from the leader (exclusively before Apache Kafka 2.3), that is another reason that load balancing Kafka is not possible. However, we can setup a reverse proxy to front a Kafka cluster as long as we can allow individual nodes to be addressable. The following setup gives one such example using nginx and using a separate advertised port per broker to route the requests to the right broker

Up and running

> docker-compose up

This should install a 3 node cluster and an nginx proxy advertising kafka brokers at localhost:9092, localhost:9093, localhost:9094

Check metadata

> kafkacat -L -b localhost:9092
> kafkacat -L -b localhost:9093
> kafkacat -L -b localhost:9094

Produce some data

> kafkacat -P -b localhost:9092 -t new_topic
1
2
3
4
5

Consume some data

> kafkacat -C -b localhost:9092 -t new_topic

kafka-nginx-reverseproxy's People

Stargazers

Mateus Valgueiro avatar Bowofade Oyerinde avatar  avatar  avatar Juliano Ramos avatar Rustam G avatar

Watchers

Sarwar Bhuiyan avatar James Cloos avatar

kafka-nginx-reverseproxy's Issues

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.