All Projects → santthosh → kafka-for-mac

santthosh / kafka-for-mac

Licence: MIT license
Getting Confluent Kafka components to work on Mac OS X

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to kafka-for-mac

zk cpp
zookeeper client of cpp, base on zookeeper c api
Stars: ✭ 34 (-30.61%)
Mutual labels:  zookeeper
dis-seckill-test
⭐⭐⭐SpringBoot+Zookeeper+Dubbo打造分布式高并发商品秒杀系统
Stars: ✭ 20 (-59.18%)
Mutual labels:  zookeeper
spring-cloud-stream-kafka-elasticsearch
The goal of this project is to implement a "News" processing pipeline composed of five Spring Boot applications: producer-api, categorizer-service, collector-service, publisher-api and news-client.
Stars: ✭ 44 (-10.2%)
Mutual labels:  zookeeper
kafkacli
CLI and Go Clients to manage Kafka components (Kafka Connect & SchemaRegistry)
Stars: ✭ 28 (-42.86%)
Mutual labels:  schema-registry
JavaYouth
主要是Java技术栈的文章,涉及到了源码、原理,面试等知识。如AQS,JVM,rpc,计网,os等等,后续可能会写mysql,redis,zk这些
Stars: ✭ 616 (+1157.14%)
Mutual labels:  zookeeper
avro turf
A library that makes it easier to use the Avro serialization format from Ruby.
Stars: ✭ 130 (+165.31%)
Mutual labels:  schema-registry
vacomall
☀️☀️ 基于 dubbo 实现的分布式电商平台。
Stars: ✭ 42 (-14.29%)
Mutual labels:  zookeeper
zookeeper-on-aws
zookeeper-on-aws (with dynamic reconfiguration based on r3.5.3-beta)
Stars: ✭ 15 (-69.39%)
Mutual labels:  zookeeper
taotao-cloud-project
微服务开发脚手架,包括大数据模块、微服务模块、前端模块。基于Spring Cloud Alibaba的微服务架构。提供技术框架的基础能力的封装,减少开发工作,只关注业务,包含了工作以来的工作总结和技术沉淀
Stars: ✭ 76 (+55.1%)
Mutual labels:  zookeeper
schema-registry
📙 json & avro http schema registry backed by Kafka
Stars: ✭ 23 (-53.06%)
Mutual labels:  schema-registry
kafka-kubernetes
Apache Kafka on Kubernetes
Stars: ✭ 71 (+44.9%)
Mutual labels:  zookeeper
Mario
A zookeeper monitor platform.
Stars: ✭ 26 (-46.94%)
Mutual labels:  zookeeper
aaocp
一个对用户行为日志进行分析的大数据项目
Stars: ✭ 53 (+8.16%)
Mutual labels:  zookeeper
docker-case
这个项目主要是为了快速拉起docker服务
Stars: ✭ 31 (-36.73%)
Mutual labels:  zookeeper
schema-registry-gitops
Manage Confluent Schema Registry subjects through Infrastructure as code
Stars: ✭ 36 (-26.53%)
Mutual labels:  schema-registry
fdb-zk
ZooKeeper server on top of FoundationDB
Stars: ✭ 22 (-55.1%)
Mutual labels:  zookeeper
ZooKeeper-Admin
ZooKeeper 管理工具
Stars: ✭ 45 (-8.16%)
Mutual labels:  zookeeper
go interview
Interview Questions & Answers For Experienced Go Developers | 互联网 GO 工程师面经交流,学习
Stars: ✭ 522 (+965.31%)
Mutual labels:  zookeeper
zk-sniffer
sniffer and parse zookeeper packet
Stars: ✭ 38 (-22.45%)
Mutual labels:  zookeeper
mini-rpc
Spring + Netty + Protostuff + ZooKeeper 实现了一个轻量级 RPC 框架,使用 Spring 提供依赖注入与参数配置,使用 Netty 实现 NIO 方式的数据传输,使用 Protostuff 实现对象序列化,使用 ZooKeeper 实现服务注册与发现。使用该框架,可将服务部署到分布式环境中的任意节点上,客户端通过远程接口来调用服务端的具体实现,让服务端与客户端的开发完全分离,为实现大规模分布式应用提供了基础支持
Stars: ✭ 221 (+351.02%)
Mutual labels:  zookeeper

kafka-for-mac

For those who use macOS and docker, it can be quite challenging to get several Confluent Kafka components up and running. Support for Docker on macOS / Windows is not yet available as per Confluent. This repo is an attempt to remove the uncertainty and let people experiment with Confluent Kafka faster. Here are some references for you to understand why this challenging

I can't connect to Kafka on OS X

Note: Important Caveat - Images Not Tested for Docker for Mac or Windows

Networking features in Docker for Mac

Pre-requisites

As of this writing, my local is running

Docker version 17.12.0-ce, build c97c6d6r

Getting Started

This docker-compose file has all the components necessary to bring up single node / single broker Kafka cluster,

  • Zookeeper
  • Kafka Broker
  • Schema Registry
  • Kafka REST Proxy

Bootstrap

docker-compose up -d

You should see some results like this

Creating kafkaformac_kafka_1           ... done
Creating kafkaformac_zookeeper_1       ...
Creating kafkaformac_schema-registry_1 ... done
Creating kafkaformac_schema-registry_1 ...
Creating kafkaformac_kafka-rest_1      ... done

Ensure the processes are running

docker-compose ps

You should see some results like this

            Name                         Command            State                           Ports
--------------------------------------------------------------------------------------------------------------------------
kafkaformac_kafka-rest_1        /etc/confluent/docker/run   Up      0.0.0.0:29080->29080/tcp, 8082/tcp
kafkaformac_kafka_1             /etc/confluent/docker/run   Up      0.0.0.0:29092->29092/tcp, 9092/tcp
kafkaformac_schema-registry_1   /etc/confluent/docker/run   Up      0.0.0.0:29081->29081/tcp, 8081/tcp
kafkaformac_zookeeper_1         /etc/confluent/docker/run   Up      2181/tcp, 2888/tcp, 0.0.0.0:32181->32181/tcp, 3888/tcp

Check the health of zookeeper by monitoring its logs through this command

docker-compose logs zookeeper | grep -i binding

Check if the kafka broker is healthy

docker-compose logs kafka | grep -i started

Similarly inspect logs for schema-registry and kafka-rest

docker-compose logs schema-registry

docker-compose logs kafka-rest

Consuming and Producing using the Kafka clients

  • Add a mapping with your machine ip to docker.for.mac.host.internal to your /etc/hosts file
    • e.g. 10.0.4.162 docker.for.mac.host.internal
    • find your machine ip with ifconfig | grep -e "inet "
    • (!) your machine ip changes if you change network, update the config and restart the container
  • Connect to the kafka cluster via localhost:29092 (bootstrap server)

Publishing and Subscribing using Kafka REST

confluentinc/kafka-rest has full documentation around this, but the validate.sh script allows you to run all the same quickly, go ahead and run it

./validate.sh

You should see the RESTful endpoints invoked in sequence for publishing and subscribing from your Kafka

# Get a list of topics
["_schemas","jsontest"]
# Produce a message with JSON data
{"offsets":[{"partition":0,"offset":6,"error_code":null,"error":null}],"key_schema_id":null,"value_schema_id":null}
# Get info about one topic
{"name":"jsontest","configs":{"file.delete.delay.ms":"60000","segment.ms":"604800000","min.compaction.lag.ms":"0","retention.bytes":"-1","segment.index.bytes":"10485760","cleanup.policy":"delete","follower.replication.throttled.replicas":"","message.timestamp.difference.max.ms":"9223372036854775807","segment.jitter.ms":"0","preallocate":"false","segment.bytes":"1073741824","message.timestamp.type":"CreateTime","message.format.version":"0.11.0-IV2","max.message.bytes":"1000012","unclean.leader.election.enable":"false","retention.ms":"604800000","flush.ms":"9223372036854775807","delete.retention.ms":"86400000","leader.replication.throttled.replicas":"","min.insync.replicas":"1","flush.messages":"9223372036854775807","compression.type":"producer","min.cleanable.dirty.ratio":"0.5","index.interval.bytes":"4096"},"partitions":[{"partition":0,"leader":1,"replicas":[{"broker":1,"leader":true,"in_sync":true}]}]}
# Create a consumer for JSON data, starting at the beginning of the topic's log. The consumer group is called "my_json_consumer" and the instance is "my_consumer_instance\  .
{"instance_id":"my_consumer_instance","base_uri":"http://kr-host:8082/consumers/my_json_consumer/instances/my_consumer_instance"}
# Subscribe the consumer to a topic
No content in response
# Then consume some data from a topic using the base URL in the first response.
[]
# Finally, close the consumer with a DELETE to make it leave the group and clean up its resources.
No content in response

Tear down

docker-compose down

Caveats

  • You really don't want bridge network on your docker compose, while its not well documented on why, its advised so. confluentinc/cp-docker-images

Contributing

Fork this repository, send in a pull request

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].