tiup
tiup copied to clipboard
tiup cluster check ‘java’;`java_home` not work
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do?
5.129 host vim /etc/profile
export JAVA_HOME=/opt/jdk-11.0.10
export PATH=$JAVA_HOME/bin:$PATH
5.203
yum install java -y
yaml 1 - example
tispark_masters:
- host: 172.16.5.129
tispark_workers:
- host: 172.16.5.203
172.16.5.203 command Pass java: openjdk version "1.8.0_282"
172.16.5.203 command Pass java: openjdk version "1.8.0_282"
172.16.5.129 command Fail java not usable, bash: java: command not found
172.16.5.129 command Fail java not usable, bash: java: command not found
yaml 2 - example
tispark_masters:
- host: 172.16.5.129
java_home: /opt/jdk-11.0.10
tispark_workers:
- host: 172.16.5.203
172.16.5.203 command Pass java: openjdk version "1.8.0_282"
172.16.5.203 command Pass java: openjdk version "1.8.0_282"
172.16.5.129 command Fail java not usable, bash: java: command not found
172.16.5.129 command Fail java not usable, bash: java: command not found
yaml 3 - example
5.129 host
ln -s /opt/jdk-11.0.10/bin/java /bin/java
/bin/java -version
java version "11.0.10" 2021-01-19 LTS
172.16.5.203 command Pass java: openjdk version "1.8.0_282"
172.16.5.203 command Pass java: openjdk version "1.8.0_282"
172.16.5.129 command Pass java: java version "11.0.10" 2021-01-19 LTS
172.16.5.129 command Pass java: java version "11.0.10" 2021-01-19 LTS
First of all, java_home
in the topology is not used currently(maybe we can add it).
tispark_masters:
- host: 172.16.5.129
java_home: /opt/jdk-11.0.10
Secondly, as https://askubuntu.com/a/247769 said:
/etc/profile
is invoked only for login shells because that is its specific purpose. If you want a command to run for interactive shells that are not login shells, and you're using bash, put it in~/.bashrc
or/etc/bash.bashrc
.
same as me