yoda-mon opened a new pull request, #1067:
URL: https://github.com/apache/bigtop/pull/1067
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/BIGTOP/How+to+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'BIGTOP-3638: Your PR title ...'.
-->
### 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.
1. If user does not specify this option, there is no change.
1. If users set `--[component]-java-version [java_version]` for
`docker-hadoop.sh`, `docker-hadoop.sh` will set
`bigtop::${component}_java_version: "${version}"` to
`config/hearadata/site.xml`.
1. Some specific component's `init.pp` receive the value from `site.xml`.
`init.pp` compares the value with `8` and if it is greater than `8`, try to
install that java version. (To improve reusability I write defined component to
`jdk.pp` ). In addition, `init.pp` places
`/etc/profile.d/bigtop_${component}_javaversion.sh`. This will set
`BIGTOP_KAFKA_JAVA_VERSION=${JAVA_VERSION}` to environment variable.
1. `bigtop-utils/bigtop-detect-component-specific-javahome $component` check
the environment variable `BIGTOP_${COMPONENT}_JAVA_VERSION` , and try to
overwrite `JAVA_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.
1. Add some `jdk.pp` calls to `init.pp`.
1. Decorate server and client script with
`bigtop-detect-component-specific-javahome`
**Limitation**
- The order of stack deployment will be sensitive because after
installation, Java version is switch to newer version. I think this problem
could be acceptable because Kafka and the other candidates(e.g. Flink) usually
come later part.
### How was this patch tested?
I tested on CentOS 7 and Ubuntu 20.04 docker container on
- CentOS 7/ arm64
- Ubuntu 20.04 / x86
host machine.
#### Prerequirement
This PR includes bigtop-utils arrangement, so required to use local repo.
```sh
./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
```sh
./docker-hadoop.sh -d \
-C config_centos-7.yaml \
-c 3 \
--stack zookeeper,kafka --smoke-tests zookeeper,kafka \
--enable-local-repo --repo file:///bigtop-home/output \
--kafka-java-version 11
```
#### Check newer java version
```sh
./docker-hadoop.sh --exec 1 bash
[root@bf23cebac91c /]# ps aux|grep java
zookeep+ 744 1.3 0.4 6060380 77240 ? Sl 09:13 0:00
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.352.b08-2.el7_9.x86_64/bin/java ...
kafka 998 11.5 1.5 6890636 241836 ? Sl 09:13 0:04
/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/bin/java ...
```
### For code changes:
- [ ] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'BIGTOP-3638. Your PR title ...')?
- [ ] Make sure that newly added files do not have any licensing issues.
When in doubt refer to https://www.apache.org/licenses/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]