tiup icon indicating copy to clipboard operation
tiup copied to clipboard

tiup cluster check ‘java’;`java_home` not work

Open buggithubs opened this issue 3 years ago • 2 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. 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

buggithubs avatar Mar 16 '21 08:03 buggithubs

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.

9547 avatar Mar 16 '21 15:03 9547

same as me

yxfcodeup avatar Jan 26 '22 02:01 yxfcodeup