Giriş
Açıklaması şöyle
But first, we need to set up our Kafka Environment. For this, I am going to use the landoop/fast-data-dev’s docker image, since it comes with almost everything properly configured starting from the zookeeper, schema registry, kafka-connect and the broker and ending with a nice UI provided by Landoop for managing everything Kafka-related.
kafka komutları
kafka komutlarına erişmek için şöyle yaparız. Hepsi /opt/landoop/kafka/bin/ altında
> docker exec docker-kafka-1 \ /opt/landoop/kafka/bin/kafka-topics \ --create \ --bootstrap-server localhost:9092 \ --replication-factor 1 \ --partitions 1 \ --topic straight-through-stock-price
Docker ile de landoop çalıştırılabilir. Şöyle yaparız. ADV_HOST ile kendi bilgisayarımdan landoop hizmetlerine erişeceğimi belirtirim.
docker run --rm --net=host -e ADV_HOST=<IP> lensesio/fast-data-dev
Örnek
Şöyle yaparız
kafka: image: landoop/fast-data-dev:latest ports: - "3030:3030" # Web UI - "8081:8081" # Schema registry - "8082:8082" # Kafka REST proxy - "8083:8083" # Kafka connect distributed - "9092:9092" # Kafka broker - "2181:2181" # ZooKeeper environment: ADV_HOST: 127.0.0.1 RUNTESTS: 0 DEBUG: 1 SAMPLEDATA: 0
Örnek
Şöyle yaparız
kafka-cluster: image: landoop/fast-data-dev:latest environment: ADV_HOST: 127.0.0.1 # Change to 192.168.99.100 if using Docker Toolbox RUNTESTS: 0 # Disable Running tests so the cluster starts faster ports: - 2181:2181 # Zookeeper - 3030:3030 # Landoop UI - 8084-8086:8084-8086 # REST Proxy, Schema Registry, Kafka Connect ports - 9581-9585:9581-9585 # JMX Ports - 9092:9092 # Kafka Broker
Örnek - volume
Şöyle yaparız. zookeeper,schema registry, kafka-connect ve kafka başlatır
version: '3' services: course-catalog-kafka-cluster: container_name: course-catalog-kafka-cluster image: landoop/fast-data-dev environment: ADV_HOST: 127.0.0.1 # Change to 192.168.99.100 if using Docker Toolbox RUNTESTS: 0 # Disable Running tests so the cluster starts faster ports: - 2181:2181 # Zookeeper - 3030:3030 # Landoop UI - 8081-8083:8081-8083 # REST Proxy, Schema Registry, Kafka Connect ports - 9581-9585:9581-9585 # JMX Ports - 9092:9092 # Kafka Broker volumes: # Specify an absolute path mapping - C:\Users\ionpa\Projects\course-catalog\infra:/my-data
Örnek - healthcheck
Şöyle yaparız
services: kafka: image: landoop/fast-data-dev:latest environment: - ADV_HOST=127.0.0.1 - SAMPLEDATA=0 - RUNTESTS=0 ports: - 3030:3030 - 9092:9092 - 8081:8081 healthcheck: test: nc -z localhost 9092 || exit -1 start_period: 15s interval: 5s timeout: 10s retries: 10
No comments:
Post a Comment