This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Add HA configuration #23
Closed
Closed
Changes from 1 commit
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,13 +73,37 @@ function add_kerberos_configurations() { | |
fi | ||
} | ||
|
||
function add_ha_configurations() { | ||
if [[ "${FLINK_HA_ENABLED}" == true ]]; then | ||
export FLINK_JAVA_OPTS="$FLINK_JAVA_OPTS -Dhigh-availability=ZOOKEEPER" | ||
add_if_non_empty high-availability.cluster-id "${FLINK_HIGH_AVAILABILITY_CLUSTER_ID}" | ||
add_if_non_empty high-availability.storageDir "${FLINK_HIGH_AVAILABILITY_STORAGE_DIR}" | ||
add_if_non_empty high-availability.zookeeper.quorum "${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_QUORUM}" | ||
add_if_non_empty high-availability.jobmanager.port "${FLINK_HIGH_AVAILABILITY_JOBMANAGER_PORT}" | ||
add_if_non_empty high-availability.job.delay "${FLINK_HIGH_AVAILABILITY_JOB_DELAY}" | ||
add_if_non_empty high-availability.zookeeper.path.root "${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_PATH_ROOT}" | ||
# used for the client at ha services initiated by the mesos app master runner | ||
add_if_non_empty ghigh-availability.zookeeper.client.session-timeout \ | ||
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. (typo) 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. will fix thnx. 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. 👍 |
||
"${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_CLIENT_SESSION_TIMEOUT}" | ||
add_if_non_empty high-availability.zookeeper.client.connection-timeout \ | ||
"${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_CLIENT_CONNECTION_TIMEOUT}" | ||
add_if_non_empty high-availability.zookeeper.client.retry-wait \ | ||
"${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_CLIENT_RETRY_WAIT}" | ||
add_if_non_empty high-availability.zookeeper.client.max-retry-attempts \ | ||
"${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_CLIENT_MAX_RETRY_ATTEMPTS}" | ||
add_if_non_empty high-availability.zookeeper.path.running-registry \ | ||
"${FLINK_HIGH_AVAILABILITY_ZOOKEEPER_PATH_RUNNING_REGISTRY}" | ||
fi | ||
} | ||
|
||
function update_log_level() { | ||
if [[ "${FLINK_LOG_LEVEL}" != "" ]]; then | ||
sed -ie 's/log4j.rootLogger=INFO, file/log4j.rootLogger='"${FLINK_LOG_LEVEL}"', file/g' ${FLINK_HOME}/conf/log4j.properties | ||
fi | ||
} | ||
|
||
add_flink_configurations | ||
add_ha_configurations | ||
add_mesos_configurations | ||
add_ssl_configurations | ||
add_kerberos_configurations | ||
|
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.
Why did you need to set
high-availability
viaFLINK_JAVA_OPTS
as opposed to the config file?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.
I follow the pattern there. This pre-existed just used previous work, didnt refactor it.
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.
Have a look at the
add_if_non_empty
function, it is basically a wrapper for appending toFLINK_JAVA_OPTS
. For the sake of uniformity, please use it to set thehigh-availability
flag.I have a minor concern about the sheer number of settings being configured as dynamic properties, as opposed to being configured in
flink-conf.yaml
. Perhaps some of these HA settings can be set statically.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.
Yeah sure for the first option I missed that. By the way it wont work for every property, there is one that causes problems:
2017-08-02 00:00:20,277 INFO org.apache.flink.mesos.runtime.clusterframework.MesosApplicationMasterRunner - -Dhigh-availability.job.delay="10
2017-08-02 00:00:20,277 INFO org.apache.flink.mesos.runtime.clusterframework.MesosApplicationMasterRunner - s"
The property Dhigh-availability.job.delay="10 s" is not preserved when passed due to spaces.
In on order to fix this you can either pass each arg explicitly with quotes or if you want to keep a global variable you need to use eval. The first option is not handy as we have many variables and the second one is not a good choice since it opens security problems if we don't sanitize every input. It gets ugly so I will try put HA options in the file.