#!/bin/bash
-IMAGE=juplo/cruise-control
+IMAGE_CRUISECONTROL=juplo/cruise-control
+IMAGE_KAFKA=juplo/kafka
if [ "$1" = "cleanup" ]
then
exit
fi
-docker-compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3
-
if [[
- $(docker image ls -q $IMAGE) == "" ||
+ $(docker image ls -q $IMAGE_CRUISECONTROL) == "" ||
"$1" = "build"
]]
then
DOCKER_BUILDKIT=0 docker build -t juplo/cruise-control cruise-control || exit 1
else
echo "Using image existing images:"
- docker image ls $IMAGE
+ docker image ls $IMAGE_CRUISECONTROL
+fi
+
+if [[
+ $(docker image ls -q $IMAGE_KAFKA) == "" ||
+ "$1" = "build"
+]]
+then
+ DOCKER_BUILDKIT=0 docker build -t juplo/kafka kafka || exit 1
+else
+ echo "Using image existing images:"
+ docker image ls $IMAGE_KAFKA
fi
docker-compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1
- zookeeper-log:/var/lib/zookeeper/log
kafka-1:
- image: confluentinc/cp-kafka:7.5.1
+ image: juplo/kafka
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://: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
+ KAFKA_CRUISE_CONTROL_METRICS_REPORTER_BOOTSTRAP_SERVERS: localhost:9092
volumes:
- kafka-1-data:/var/lib/kafka/data
ports:
- zookeeper
kafka-2:
- image: confluentinc/cp-kafka:7.5.1
+ image: juplo/kafka
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://: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
+ KAFKA_CRUISE_CONTROL_METRICS_REPORTER_BOOTSTRAP_SERVERS: localhost:9092
volumes:
- kafka-2-data:/var/lib/kafka/data
ports:
- zookeeper
kafka-3:
- image: confluentinc/cp-kafka:7.5.1
+ image: juplo/kafka
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9083
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
+ KAFKA_CRUISE_CONTROL_METRICS_REPORTER_BOOTSTRAP_SERVERS: localhost:9092
volumes:
- kafka-3-data:/var/lib/kafka/data
ports:
- zookeeper
kafka-4:
- image: confluentinc/cp-kafka:7.5.1
+ image: juplo/kafka
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: BROKER://:9092, LOCALHOST://:9084
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
+ KAFKA_CRUISE_CONTROL_METRICS_REPORTER_BOOTSTRAP_SERVERS: localhost:9092
volumes:
- kafka-4-data:/var/lib/kafka/data
ports:
WORKDIR cruise-control
RUN ./gradlew jar
-FROM confluentinc/cp-kafka-connect:${VERSION}
-USER root
-COPY --from=0 /tmp/cruise-control/config /opt/cruise-control/config/
-COPY --from=0 /tmp/cruise-control/cruise-control/build /opt/cruise-control/cruise-control/build/
-COPY --from=0 /tmp/cruise-control/kafka-cruise-control-start.sh /opt/cruise-control/
-WORKDIR /opt/cruise-control
-RUN wget -O - https://github.com/linkedin/cruise-control-ui/releases/download/v0.4.0/cruise-control-ui-0.4.0.tar.gz | tar -xzv
-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" ]
+FROM confluentinc/cp-kafka:${VERSION}
+COPY --from=0 \
+ /tmp/cruise-control/cruise-control-metrics-reporter/build/libs/cruise-control-metrics-reporter-*.jar \
+ /usr/share/java/kafka/cruise-control-metrics-reporter.jar