BIGTOP-3867: Add an option for installing and using newer java version on bigtop-deploy #1067
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.
Description of PR
This PR add an option that installs and uses newer java version on bigtop-deploy for Puppet.
Bigtop's default Java version is 8, this option enables some components (on this PR, Kafka) to use newer version.
--[component]-java-version [java_version]
fordocker-hadoop.sh
,docker-hadoop.sh
will setbigtop::${component}_java_version: "${version}"
toconfig/hearadata/site.xml
.init.pp
receive the value fromsite.xml
.init.pp
compares the value with8
and if it is greater than8
, try to install that java version. (To improve reusability I write defined component tojdk.pp
). In addition,init.pp
places/etc/profile.d/bigtop_${component}_javaversion.sh
. This will setBIGTOP_KAFKA_JAVA_VERSION=${JAVA_VERSION}
to environment variable.bigtop-utils/bigtop-detect-component-specific-javahome $component
check the environment variableBIGTOP_${COMPONENT}_JAVA_VERSION
, and try to overwriteJAVA_HOME
to the specific version during the process. By lauching or accessing through this script, that component can choose appropricate java version.If users want to adds this option to another component, the steps below does.
jdk.pp
calls toinit.pp
.bigtop-detect-component-specific-javahome
Limitation
How was this patch tested?
I tested on CentOS 7 and Ubuntu 20.04 docker container on
host machine.
Prerequirement
This PR includes bigtop-utils arrangement, so required to use local repo.
./gradlew -POS="centos-7" \ bigtop-utils-clean bigtop-utils-pkg-ind \ zookeeper-clean zookeeper-pkg-ind \ kafka-clean kafka-pkg-ind \ repo-ind
Deploy and Smoke Test
Check newer java version
For code changes: