-
Notifications
You must be signed in to change notification settings - Fork 652
Minor refactor in start script to remove Kafka-related leftovers #2349
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
Open
danielgospodinow
wants to merge
2
commits into
cruise-control-for-kafka:main
Choose a base branch
from
qbaware:refactor-start-script
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 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 hidden or 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 |
|---|---|---|
|
|
@@ -62,13 +62,13 @@ fi | |
| shopt -u nullglob | ||
|
|
||
| # JMX settings | ||
| if [ -z "$KAFKA_JMX_OPTS" ]; then | ||
| KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false " | ||
| if [ -z "$JMX_OPTS" ]; then | ||
| JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false " | ||
| fi | ||
|
|
||
| # JMX port to use | ||
| if [ $JMX_PORT ]; then | ||
|
|
||
| KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT " | ||
| JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT " | ||
| fi | ||
|
|
||
| # Log directory to use | ||
|
|
@@ -77,30 +77,26 @@ if [ "x$LOG_DIR" = "x" ]; then | |
| fi | ||
|
Comment on lines
83
to
86
|
||
|
|
||
| # Log4j settings | ||
| if [ -z "$KAFKA_LOG4J_OPTS" ]; then | ||
| if [ -z "$LOG4J_OPTS" ]; then | ||
| # Log to console. This is a tool. | ||
| LOG4J_DIR="$base_dir/config/log4j.properties" | ||
| # If Cygwin is detected, LOG4J_DIR is converted to Windows format. | ||
| (( CYGWIN )) && LOG4J_DIR=$(cygpath --path --mixed "${LOG4J_DIR}") | ||
| KAFKA_LOG4J_OPTS="-Dlog4j.configurationFile=file:${LOG4J_DIR}" | ||
| LOG4J_OPTS="-Dlog4j.configurationFile=file:${LOG4J_DIR}" | ||
| else | ||
| # create logs directory | ||
| if [ ! -d "$LOG_DIR" ]; then | ||
| mkdir -p "$LOG_DIR" | ||
| fi | ||
| fi | ||
|
|
||
| # If Cygwin is detected, LOG_DIR is converted to Windows format. | ||
| (( CYGWIN )) && LOG_DIR=$(cygpath --path --mixed "${LOG_DIR}") | ||
| KAFKA_LOG4J_OPTS="-Dkafka.logs.dir=$LOG_DIR $KAFKA_LOG4J_OPTS" | ||
|
Comment on lines
-93
to
-95
Author
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. This is the only line I've removed given that |
||
|
|
||
| # Generic jvm settings you want to add | ||
| if [ -z "$KAFKA_OPTS" ]; then | ||
| KAFKA_OPTS="" | ||
| if [ -z "$JVM_OPTS" ]; then | ||
| JVM_OPTS="" | ||
| fi | ||
|
|
||
| # Set Debug options if enabled | ||
| if [ "x$KAFKA_DEBUG" != "x" ]; then | ||
| if [ "x$DEBUG" != "x" ]; then | ||
|
|
||
| # Use default ports | ||
| DEFAULT_JAVA_DEBUG_PORT="5005" | ||
|
|
@@ -116,7 +112,7 @@ if [ "x$KAFKA_DEBUG" != "x" ]; then | |
| fi | ||
|
|
||
| echo "Enabling Java debug options: $JAVA_DEBUG_OPTS" | ||
| KAFKA_OPTS="$JAVA_DEBUG_OPTS $KAFKA_OPTS" | ||
| JVM_OPTS="$JAVA_DEBUG_OPTS $JVM_OPTS" | ||
| fi | ||
|
|
||
| # Which java to use | ||
|
|
@@ -127,19 +123,19 @@ else | |
| fi | ||
|
|
||
| # Memory options | ||
| if [ -z "$KAFKA_HEAP_OPTS" ]; then | ||
| KAFKA_HEAP_OPTS="-Xmx1G" | ||
| if [ -z "$HEAP_OPTS" ]; then | ||
| HEAP_OPTS="-Xmx1G" | ||
| fi | ||
|
|
||
| # JVM performance options | ||
| if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then | ||
| KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true" | ||
| if [ -z "$JVM_PERFORMANCE_OPTS" ]; then | ||
| JVM_PERFORMANCE_OPTS="-server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+DisableExplicitGC -Djava.awt.headless=true" | ||
| fi | ||
|
|
||
| #Add jaas file to KAFKA_OPTS if present | ||
| #Add jaas file to JVM_OPTS if present | ||
| if [ -f $base_dir/config/cruise_control_jaas.conf ] | ||
| then | ||
| KAFKA_OPTS="-Djava.security.auth.login.config=$base_dir/config/cruise_control_jaas.conf $KAFKA_OPTS" | ||
| JVM_OPTS="-Djava.security.auth.login.config=$base_dir/config/cruise_control_jaas.conf $JVM_OPTS" | ||
| fi | ||
|
|
||
| DAEMON_NAME="kafka-cruise-control" | ||
|
|
@@ -153,7 +149,7 @@ while [ $# -gt 0 ]; do | |
| shift 2 | ||
| ;; | ||
| -loggc) | ||
| if [ -z "$KAFKA_GC_LOG_OPTS" ]; then | ||
| if [ -z "$GC_LOG_OPTS" ]; then | ||
| GC_LOG_ENABLED="true" | ||
| fi | ||
| shift | ||
|
|
@@ -178,15 +174,15 @@ GC_FILE_SUFFIX='-gc.log' | |
| GC_LOG_FILE_NAME='' | ||
| if [ "x$GC_LOG_ENABLED" = "xtrue" ]; then | ||
| GC_LOG_FILE_NAME=$DAEMON_NAME$GC_FILE_SUFFIX | ||
| KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M" | ||
| GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M" | ||
| fi | ||
|
|
||
| # If Cygwin is detected, classpath is converted to Windows format. | ||
| (( CYGWIN )) && CLASSPATH=$(cygpath --path --mixed "${CLASSPATH}") | ||
|
|
||
| # Launch mode | ||
| if [ "x$DAEMON_MODE" = "xtrue" ]; then | ||
| nohup $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain "$@" > "$CONSOLE_OUTPUT_FILE" 2>&1 < /dev/null & | ||
| nohup $JAVA $HEAP_OPTS $JVM_PERFORMANCE_OPTS $GC_LOG_OPTS $JMX_OPTS $LOG4J_OPTS -cp $CLASSPATH $JVM_OPTS com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain "$@" > "$CONSOLE_OUTPUT_FILE" 2>&1 < /dev/null & | ||
| else | ||
| exec $JAVA $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain "$@" | ||
| exec $JAVA $HEAP_OPTS $JVM_PERFORMANCE_OPTS $GC_LOG_OPTS $JMX_OPTS $LOG4J_OPTS -cp $CLASSPATH $JVM_OPTS com.linkedin.kafka.cruisecontrol.KafkaCruiseControlMain "$@" | ||
| fi | ||
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.
Uh oh!
There was an error while loading. Please reload this page.