--- /dev/null
+ARG VERSION=7.5.1
+FROM confluentinc/cp-kafka-connect:${VERSION}
+USER root
+COPY cruise-control /opt/cruise-control/
+WORKDIR /opt/cruise-control
+ENV BOOTSTRAP_SERVERS=localhost:9092
+ENV ZOOKEEPER_CONNECT=localhost:2181
+RUN echo -e '#!/bin/bash\n sed -ie "s+^bootstrap\.servers=.*$+bootstrap.servers=${BOOTSTRAP_SERVERS}+;s+^zookeeper\.connect=.*$+zookeeper.connect=${ZOOKEEPER_CONNECT}+" config/cruisecontrol.properties\nexec ./kafka-cruise-control-start.sh "$@"' > run.sh; chmod a+x run.sh
+ENTRYPOINT [ "/opt/cruise-control/run.sh" ]
+CMD [ "config/cruisecontrol.properties" ]
if [ "$1" = "cleanup" ]
then
docker-compose -f docker/docker-compose.yml down -t0 -v --remove-orphans
+ (cd cruise-control; ./gradlew clean)
exit
fi
+git submodule update --init cruise-control || exit 1
+(cd cruise-control; ./gradlew jar) || exit 1
+(cd docker; ln -sf ../cruise-control/cruise-control-metrics-reporter/build/libs/cruise-control-metrics-reporter-*.jar cruise-control-metrics-reporter.jar)
+docker build -t juplo/cruise-control .
+
docker-compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1
docker-compose -f docker/docker-compose.yml ps
KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+ KAFKA_METRIC_REPORTERS: com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter
volumes:
+ - ./cruise-control-metrics-reporter.jar:/usr/share/java/kafka/cruise-control-metrics-reporter.jar:ro
- kafka-1-data:/var/lib/kafka/data
ports:
- 9081:9081
KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+ KAFKA_METRIC_REPORTERS: com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter
volumes:
+ - ./cruise-control-metrics-reporter.jar:/usr/share/java/kafka/cruise-control-metrics-reporter.jar:ro
- kafka-2-data:/var/lib/kafka/data
ports:
- 9092:9082
KAFKA_INTER_BROKER_LISTENER_NAME: BROKER
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
+ KAFKA_METRIC_REPORTERS: com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter
volumes:
+ - ./cruise-control-metrics-reporter.jar:/usr/share/java/kafka/cruise-control-metrics-reporter.jar:ro
- kafka-3-data:/var/lib/kafka/data
ports:
- 9083:9083
depends_on:
- zookeeper
+ cruise-control:
+ image: juplo/cruise-control
+ environment:
+ BOOTSTRAP_SERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
+ ZOOKEEPER_CONNECT: zookeeper:2181/
+ ports:
+ - "9090:9090"
+
schema-registry:
image: confluentinc/cp-schema-registry:7.5.1
environment:
echo -n Bereits konfiguriert:
cat INITIALIZED
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
+ kafka-topics --bootstrap-server kafka:9092 --describe --topic __CruiseControlMetrics
else
kafka-topics --bootstrap-server kafka:9092 \
--delete \
--replication-factor 3 \
--config min.insync.replicas=2 \
&& echo Das Topic \'test\' wurde erfolgreich angelegt: \
- && kafka-topics --bootstrap-server kafka:9092 --describe --topic test \
- && date > INITIALIZED
- fi
+ && kafka-topics --bootstrap-server kafka:9092 --describe --topic test
+ kafka-topics --bootstrap-server kafka:9092 \
+ --delete \
+ --if-exists \
+ --topic __CruiseControlMetrics
+ kafka-topics --bootstrap-server kafka:9092 \
+ --create \
+ --topic __CruiseControlMetrics \
+ --partitions 2 \
+ --replication-factor 3 \
+ --config min.insync.replicas=2 \
+ && echo Das Topic \'__CruiseControlMetrics\' wurde erfolgreich angelegt: \
+ && kafka-topics --bootstrap-server kafka:9092 --describe --topic __CruiseControlMetrics
+ fi \
+ && date > INITIALIZED
stop_grace_period: 0s
depends_on:
- cli