Skip to content
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

Support running Yarn with JDK 17 #305

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/impl/install/hadoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,16 @@ $SED "s#YARN_NM_CPU_VCORES#$YARN_NM_CPU_VCORES#g" "$hadoop_conf/yarn-site.xml"
} >> "$hadoop_conf/hadoop-env.sh"
[[ $HADOOP_VERSION =~ ^2\..*$ ]] && echo "export YARN_LOG_DIR=$HADOOP_LOG_DIR" >> "$hadoop_conf/yarn-env.sh"

# Yarn requires extra JVM args to start with Java 17+
jver=$("$JAVA_HOME"/bin/java -version 2>&1 | grep version | cut -f2 -d'"' | cut -f1 -d.)

if [[ $jver -gt 11 ]]; then
echo "Setting yarn JVM args for java $jver"
{
echo "export YARN_RESOURCEMANAGER_OPTS=\"--add-opens java.base/java.lang=ALL-UNNAMED\""
echo "export YARN_NODEMANAGER_OPTS=\"--add-opens java.base/java.lang=ALL-UNNAMED\""
} >> "$hadoop_conf/yarn-env.sh"
fi

true
# hadoop.sh
8 changes: 1 addition & 7 deletions bin/impl/run/hadoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAN

"$HADOOP_HOME"/bin/hdfs namenode -format
"$HADOOP_HOME"/sbin/start-dfs.sh
# Yarn won't start on newer versions of Java
jver=$("$JAVA_HOME"/bin/java -version 2>&1 | grep version | cut -f2 -d'"' | cut -f1 -d.)
if [[ $jver -gt 11 ]]; then
echo "Skipping yarn because it doesn't start on Java $jver"
else
"$HADOOP_HOME"/sbin/start-yarn.sh
fi
"$HADOOP_HOME"/sbin/start-yarn.sh

namenode_port=9870
if [[ $HADOOP_VERSION =~ ^2\..*$ ]]; then
Expand Down
Loading