mirror of
https://github.com/vimagick/dockerfiles.git
synced 2024-12-25 02:04:06 +02:00
update kafka
This commit is contained in:
parent
152a8f2a43
commit
9509a7ea07
@ -1,2 +1,24 @@
|
||||
kafka
|
||||
=====
|
||||
|
||||
## How It Works
|
||||
|
||||
![](https://github.com/wurstmeister/kafka-docker/wiki/kafka-communication.png)
|
||||
|
||||
[read more](https://github.com/wurstmeister/kafka-docker/wiki/Connectivity)
|
||||
|
||||
## Up and Running
|
||||
|
||||
```bash
|
||||
# Broker
|
||||
$ docker-compose up -d
|
||||
$ docker-compose exec kafka bash
|
||||
>>> kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 2 --topic my-topic
|
||||
>>> exit
|
||||
|
||||
# Producer
|
||||
$ kafkacat -P -b localhost:9092 -t my-topic
|
||||
|
||||
# Consumer
|
||||
$ kafkacat -C -b localhost:9092 -t my-topic -o end
|
||||
```
|
||||
|
@ -11,12 +11,12 @@ kafka:
|
||||
image: wurstmeister/kafka
|
||||
ports:
|
||||
- "9092:9092"
|
||||
links:
|
||||
- zookeeper
|
||||
volumes:
|
||||
- ./kafka:/kafka
|
||||
- ./data/kafka:/kafka
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- KAFKA_ADVERTISED_HOST_NAME=10.50.254.182
|
||||
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
links:
|
||||
- zookeeper
|
||||
restart: always
|
||||
|
Loading…
Reference in New Issue
Block a user