-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCKER] fix controller port #1859
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,13 @@ source $DOCKER_FOLDER/docker_build_common.sh | |
# ===============================[global variables]=============================== | ||
declare -r ACCOUNT=${ACCOUNT:-opensource4you} | ||
declare -r KAFKA_ACCOUNT=${KAFKA_ACCOUNT:-apache} | ||
declare -r KAFKA_VERSION=${KAFKA_REVISION:-${KAFKA_VERSION:-3.8.1}} | ||
declare -r KAFKA_VERSION=${KAFKA_REVISION:-${KAFKA_VERSION:-3.9.0}} | ||
declare -r DOCKERFILE=$DOCKER_FOLDER/controller.dockerfile | ||
declare -r EXPORTER_VERSION="0.16.1" | ||
declare -r CLUSTER_ID=${CLUSTER_ID:-"$(randomString)"} | ||
declare -r EXPORTER_PORT=${EXPORTER_PORT:-"$(getRandomPort)"} | ||
declare -r NODE_ID=${NODE_ID:-"$(getRandomPort)"} | ||
declare -r VOTERS=${VOTERS:-""} | ||
declare -r CONTROLLER_PORT=${CONTROLLER_PORT:-"$(generateControllerPort)"} | ||
declare -r CONTAINER_NAME="controller-$CONTROLLER_PORT" | ||
declare -r CONTROLLER_JMX_PORT="${CONTROLLER_JMX_PORT:-"$(getRandomPort)"}" | ||
|
@@ -53,7 +54,7 @@ function showHelp() { | |
echo " ACCOUNT=opensource4you set the github account for astraea repo" | ||
echo " HEAP_OPTS=\"-Xmx2G -Xms2G\" set controller JVM memory" | ||
echo " KAFKA_REVISION=trunk set revision of kafka source code to build container" | ||
echo " KAFKA_VERSION=3.8.1 set version of kafka distribution" | ||
echo " KAFKA_VERSION=3.9.0 set version of kafka distribution" | ||
echo " BUILD=false set true if you want to build image locally" | ||
echo " RUN=false set false if you want to build/pull image only" | ||
echo " META_FOLDER=/tmp/folder1 set host folder used by controller" | ||
|
@@ -102,7 +103,7 @@ function generateDockerfileByVersion() { | |
local kafka_url="https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.13-${KAFKA_VERSION}.tgz" | ||
local version=$KAFKA_VERSION | ||
if [[ "$KAFKA_VERSION" == *"rc"* ]]; then | ||
## `3.8.1-rc1` the rc release does not exist in archive repo | ||
## `3.9.0-rc1` the rc release does not exist in archive repo | ||
version=${KAFKA_VERSION%-*} | ||
kafka_url="https://dist.apache.org/repos/dist/dev/kafka/${KAFKA_VERSION}/kafka_2.13-${version}.tgz" | ||
fi | ||
|
@@ -244,11 +245,15 @@ docker run -d --init \ | |
-p $EXPORTER_PORT:$EXPORTER_PORT \ | ||
"$IMAGE_NAME" sh -c "./bin/kafka-storage.sh format -t $CLUSTER_ID $release_version -c /tmp/controller.properties --standalone --ignore-formatted && ./bin/kafka-server-start.sh /tmp/controller.properties" | ||
|
||
echo "=================================================" | ||
[[ -n "$META_FOLDER" ]] && echo "mount $META_FOLDER to container: $CONTAINER_NAME" | ||
echo "controller address: ${ADDRESS}:$CONTROLLER_PORT" | ||
echo "jmx address: ${ADDRESS}:$CONTROLLER_JMX_PORT" | ||
echo "exporter address: ${ADDRESS}:$EXPORTER_PORT" | ||
echo "=================================================" | ||
echo "run CLUSTER_ID=$CLUSTER_ID $DOCKER_FOLDER/start_broker.sh controller.quorum.bootstrap.servers=${ADDRESS}:$CONTROLLER_PORT to join broker" | ||
echo "=================================================" | ||
if [ "$(echo $?)" -eq 0 ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add error check. |
||
echo "=================================================" | ||
[[ -n "$META_FOLDER" ]] && echo "mount $META_FOLDER to container: $CONTAINER_NAME" | ||
echo "controller address: ${ADDRESS}:$CONTROLLER_PORT" | ||
echo "jmx address: ${ADDRESS}:$CONTROLLER_JMX_PORT" | ||
echo "exporter address: ${ADDRESS}:$EXPORTER_PORT" | ||
echo "=================================================" | ||
echo "run CLUSTER_ID=$CLUSTER_ID $DOCKER_FOLDER/start_broker.sh controller.quorum.bootstrap.servers=${ADDRESS}:$CONTROLLER_PORT to join broker" | ||
echo "=================================================" | ||
else | ||
echo "Start up fail" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is removed within in 9fab2a0.