From 0051761c45926a5f570edb3f71465f0e31cb37e4 Mon Sep 17 00:00:00 2001 From: Wasutan Kitijerapat Date: Fri, 16 Feb 2024 15:19:17 +0700 Subject: [PATCH 1/3] test: upgrade zookeeper and kafka version --- examples/docker-compose.yml | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 3a19f462..9d11c4b9 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -1,21 +1,20 @@ version: '3' services: zoo1: - image: zookeeper:3.4.9 + image: confluentinc/cp-zookeeper:7.6.0 hostname: zoo1 container_name: zoo1 ports: - "2181:2181" environment: - ZOO_MY_ID: 1 - ZOO_PORT: 2181 - ZOO_SERVERS: server.1=zoo1:2888:3888 + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 ulimits: nofile: soft: 65536 hard: 65536 kafka1: - image: confluentinc/cp-kafka:5.4.0 + image: confluentinc/cp-kafka:latest hostname: kafka1 container_name: kafka1 ulimits: @@ -25,10 +24,11 @@ services: ports: - "9092:9092" environment: - KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL - KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181" + KAFKA_ZOOKEEPER_CONNECT: zoo1:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka1:19092,PLAINTEXT_HOST://localhost:29092,EXTERNAL_SAME_HOST://${DOCKER_HOST_IP:-127.0.0.1}:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,EXTERNAL_SAME_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" KAFKA_OFFSETS_COMMIT_TIMEOUT_MS: "10000" KAFKA_BROKER_ID: 1 @@ -38,7 +38,7 @@ services: depends_on: - zoo1 kafka2: - image: confluentinc/cp-kafka:5.4.0 + image: confluentinc/cp-kafka:7.6.0 hostname: kafka2 container_name: kafka2 ulimits: @@ -48,10 +48,11 @@ services: ports: - "9093:9093" environment: - KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL - KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181" + KAFKA_ZOOKEEPER_CONNECT: zoo1:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka2:19093,PLAINTEXT_HOST://localhost:29093,EXTERNAL_SAME_HOST://${DOCKER_HOST_IP:-127.0.0.1}:9093 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,EXTERNAL_SAME_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" KAFKA_OFFSETS_COMMIT_TIMEOUT_MS: "10000" KAFKA_BROKER_ID: 2 @@ -61,7 +62,7 @@ services: depends_on: - zoo1 kafka3: - image: confluentinc/cp-kafka:5.4.0 + image: confluentinc/cp-kafka:7.6.0 hostname: kafka3 container_name: kafka3 ulimits: @@ -71,10 +72,11 @@ services: ports: - "9094:9094" environment: - KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka3:19094,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9094 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL - KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181" + KAFKA_ZOOKEEPER_CONNECT: zoo1:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka3:19094,PLAINTEXT_HOST://localhost:29094,EXTERNAL_SAME_HOST://${DOCKER_HOST_IP:-127.0.0.1}:9094 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,EXTERNAL_SAME_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" KAFKA_OFFSETS_COMMIT_TIMEOUT_MS: "10000" KAFKA_BROKER_ID: 3 From fa93489cdfc3a298bed0c3507114f8a70eba4053 Mon Sep 17 00:00:00 2001 From: Wasutan Kitijerapat Date: Fri, 16 Feb 2024 16:55:20 +0700 Subject: [PATCH 2/3] test: add version instead latest --- examples/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml index 9d11c4b9..819e0fad 100644 --- a/examples/docker-compose.yml +++ b/examples/docker-compose.yml @@ -14,7 +14,7 @@ services: soft: 65536 hard: 65536 kafka1: - image: confluentinc/cp-kafka:latest + image: confluentinc/cp-kafka:7.6.0 hostname: kafka1 container_name: kafka1 ulimits: From b5d315cf622cbad45bef7d2259da26f6ee0c68ac Mon Sep 17 00:00:00 2001 From: Wasutan Kitijerapat Date: Mon, 19 Feb 2024 00:58:05 +0700 Subject: [PATCH 3/3] build: update version of kafka and zookeeper to 7.6.0 in create command script --- examples/create-kafka-commands.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/create-kafka-commands.sh b/examples/create-kafka-commands.sh index f11be364..fe699338 100644 --- a/examples/create-kafka-commands.sh +++ b/examples/create-kafka-commands.sh @@ -9,7 +9,7 @@ TARGET=$1 mkdir -p $TARGET # create Kafka scripts -SCRIPTS=$(docker run --rm -it --entrypoint /bin/bash confluentinc/cp-kafka:5.4.0 -c "compgen -c | grep -E '(zook*|kafka*)'") +SCRIPTS=$(docker run --rm -it --entrypoint /bin/bash confluentinc/cp-kafka:7.6.0 -c "compgen -c | grep -E '(zook*|kafka*)'") for SCRIPT in $SCRIPTS; do SCRIPT=$(echo $SCRIPT | tr -d '\r') FN=$TARGET/$(basename $SCRIPT) @@ -17,7 +17,7 @@ for SCRIPT in $SCRIPTS; do cat <<-EOF > $FN #!/bin/bash CMD="$SCRIPT \$@" - docker run --net=host --rm -it --entrypoint /bin/bash confluentinc/cp-kafka:5.4.0 -c "\$CMD" + docker run --net=host --rm -it --entrypoint /bin/bash confluentinc/cp-kafka:7.6.0 -c "\$CMD" EOF chmod +x $FN done @@ -27,6 +27,6 @@ echo creating $TARGET/zkCli.sh cat <<-EOF > $TARGET/zkCli.sh #!/bin/bash CMD="bin/zkCli.sh \$@" - docker run --net=host --rm -it zookeeper:3.4.9 bash -c "\$CMD" + docker run --net=host --rm -it confluentinc/cp-zookeeper:7.6.0 bash -c "\$CMD" EOF chmod +x $TARGET/zkCli.sh