Code Monkey home page Code Monkey logo

docker-kafka's Introduction

Kafka

Anchore Image Overview

Kafka is a distributed streaming platform that lets you publish and subscribe to streams of records in fault-tolerant way and lets you process streams of records as they occur.

NOTE: This image is no longer maintained. See confluentinc/cp-kafka for Kafka images.

Starting a Kafka Broker

Kafka is a distributed system that uses Zookeeper to coordinate Kafka brokers and keep track of Kafka topics and partitions. Before starting Kafka, you need a Zookeeper service that it can connect to. The official zookeeper image can be used to create and start a Zookeeper container.

docker run --name zookeeper -d zookeeper

Next, create and start a Kafka container, with a link to the Zookeeper container. This Kafka image is pre-configured to connect to Zookeeper using the service name zookeeper on port 2181, the default Zookeeper client port.

docker run --name kakfa --link zookeeper:zookeeper -d ucalgary/kafka

Defining a Simple Kafka Stack

Docker Compose files can be used to define and run multi-container systems. Since Kafka requires Zookeeper to run, a Compose file is a great way to define the two services and deploy them together.

Here is a simple Compose file that defines services for Zookeeper and Kafka.

version: '3'
services:
  zookeeper:
    image: zookeeper
  kafka:
    image: ucalgary/kafka
    depends_on:
    - zookeeper

Both services will be connected to a default network for this stack when it is brought up using Docker Compose or deployed as a stack in swarm mode. Containers for the kafka service can automatically connect to zookeeper containers via the service name.

The depends_on parameter expresses a dependency from the kafka service to the zookeeper service. If you specifically tell Docker Compose to start the kafka service, Docker Compose will also start the zookeeper service because of the declared dependency.

Note: depends_on does not apply for Docker stack deployments.

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.