hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Wittenauer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-13935) A command to print JAVA_VERSION used by Hadoop/HDFS
Date Fri, 23 Dec 2016 05:30:58 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-13935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15771987#comment-15771987

Allen Wittenauer commented on HADOOP-13935:

It's a pretty common configuration to not define JAVA_HOME in hadoop-env.sh but as part of
a /etc/profile.d configuration. In the future, we're likely to see .hadoop-env and .hadooprc
set it. So it isn't safe to make the assumption that this is being defined there.

Experience with Apache Yetus has shown that the binary location is actually much more important
than the actual version being reported when debugging these types of issues. A machine with
different JDKs (e.g., IBM, OpenJDK, Oracle, etc) may report the same version string but will
always have different paths.  The path (resolved or otherwise) is also likely to have the
version string as part of the directory component.

That said, this issue is basically covered by HADOOP-12366.  As part of that JIRA issue, the
various envvars subcommands in hadoop, hdfs, mapred, and yarn expose what JAVA_HOME is in
use when the shell scripts launch Java commands (barring a custom JAVA_HOME getting set via
dynamic subcommands).  

> A command to print JAVA_VERSION used by Hadoop/HDFS
> ---------------------------------------------------
>                 Key: HADOOP-13935
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13935
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: common
>    Affects Versions: 3.0.0-alpha2
>            Reporter: Anu Engineer
>            Assignee: Yiqun Lin
>              Labels: newbie
> The java version used by hadoop is controlled by JAVA_HOME variable defined in hadoop_env.sh.
We log this information when HDFS starts in the log file. 
> {noformat}
> STARTUP_MSG:   java = 1.8.0_112
> {noformat}
> However, it is quite possible that a user might have many versions of java installed
on his/her machine. Generally, users tend to check for the java version via 
> {noformat}
> java -version
> {noformat}
> This just means we are printing out the java version in the current shell path.
> This jira proposes adding a new simple command or an extension to existing hadoop version
command where the current java version used by hadoop is also printed out.
> This avoids customer confusion when they are looking at if the java stack is properly
configured. For example, checking if JCE is installed correctly.
> This is a very minor change that can be done by modifying hdfs.cmd or hdfs shell script
in the /bin directory. Thanks to [~sujit] for bringing this to my attention.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message