Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ambari Setup - JAVA HOME Error

avatar
New Contributor

I have similar issue which was posted in Ambari Setup. I could see in some post about the 2 JDK with third option as Custom but in my case, i could see only JDK as single option. Can someone please help me to get rid of this issue?

[root@localhost ~]# ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? n Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Custom JDK ============================================================================== Enter choice (1): 1 WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts. WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts. Path to JAVA_HOME: /usr/lib/jvm/jre-1.8.0-openjdk/bin ERROR: Exiting with exit code 1. REASON: Downloading or installing JDK failed: 'Fatal exception: Java home path or java binary file is unavailable. Please put correct path to java home., exit code 1'. Exiting.

6 REPLIES 6

avatar
Expert Contributor

Please edit "vi /etc/ambari-server/conf/ambari.properties"

java.home=/usr/<jdk>/jdk_version

After that restart ambari server.

avatar
New Contributor

Your solution helped us.

avatar
New Contributor

Hi,

I have tried as per your suggestion but here what i got as a result. Still i have not made full ambari-server. I just installed the ambari-server and trying to create the setup for the GUI.

[root@localhost ~]# service ambari-server start Using python /usr/bin/python Starting ambari-server ERROR: Exiting with exit code -1. REASON: DB Name property not set in config file. - If this is a new setup, then run the "ambari-server setup" command to create the user - If this is an upgrade of an existing setup, run the "ambari-server upgrade" command. Refer to the Ambari documentation for more information on setup and upgrade. [root@localhost ~]# ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? n Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... Do you want to change Oracle JDK [y/n] (n)? n Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? n Configuring database... Default properties detected. Using built-in database. Configuring ambari database... Checking PostgreSQL... Running initdb: This may take up to a minute. Initializing database ... OK About to start PostgreSQL Configuring local database... Configuring PostgreSQL... Restarting PostgreSQL Creating schema and user... done. Creating tables... done. Extracting system views... Looking for available JDKs at /usr/jdk64 Found: [] ERROR: No JDK found, please run the "setup" command to install a JDK automatically or install any JDK manually to /usr/jdk64 ERROR: Exiting with exit code 1. REASON: Error while extracting system views. Exiting

Also, please find the properties file input where i have 2 JDK version.

java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.ppc64le/jre/bin/java java.releases=jdk1.8,jdk1.7 java.releases.ppc64le= jce.download.supported=true jdk.download.supported=true jdk1.7.desc=Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7 jdk1.7.dest-file=jdk-7u67-linux-x64.tar.gz jdk1.7.home=/usr/jdk64/

Please suggest.

avatar
Master Mentor

@Sabarigirivasan Kuttuva

Your java.home set inside the ambari.properties is incorrect. It is pointing to the "java" file instead of pointing to the directory where the JDK is installed

java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.ppc64le/jre/bin/java

.

Can you please try this path:

java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.ppc64le

.

Please check if your PATH contains the "bin" directory as following:

# ls -l /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.ppc64le/bin/java

Java home is a directory up t; the directory where the "bin" is present.

Example:

# grep 'java.home' /etc/ambari-server/conf/ambari.properties
java.home=/usr/jdk64/jdk1.8.0_112
stack.java.home=/usr/jdk64/jdk1.8.0_112


[root@latest1 ~]# ls -l /usr/jdk64/jdk1.8.0_112
total 25916
drwxr-xr-x. 2 root root     4096 Sep 23  2016 bin
-r--r--r--. 1 root root     3244 Sep 23  2016 COPYRIGHT
drwxr-xr-x. 4 root root     4096 Sep 23  2016 db
drwxr-xr-x. 3 root root     4096 Sep 23  2016 include
-rwxr-xr-x. 1 root root  5094021 Sep 22  2016 javafx-src.zip
drwxr-xr-x. 5 root root     4096 Sep 23  2016 jre
drwxr-xr-x. 5 root root     4096 Sep 23  2016 lib
-r--r--r--. 1 root root       40 Sep 23  2016 LICENSE
drwxr-xr-x. 4 root root       44 Sep 23  2016 man
-r--r--r--. 1 root root      159 Sep 23  2016 README.html
-rw-r--r--. 1 root root      526 Sep 23  2016 release
-rw-r--r--. 1 root root 21112816 Sep 23  2016 src.zip
-rwxr-xr-x. 1 root root   110114 Sep 22  2016 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r--. 1 root root   177094 Sep 23  2016 THIRDPARTYLICENSEREADME.txt

.

avatar
Master Mentor

@Sabarigirivasan Kuttuva

If this answers your query/issue then please mark this HCC thread as answered by clicking on "Accept" link on the correct answer, That way it will help other HCC users to quickly find the answers.

avatar
New Contributor

Thanks a lot, your suggestion really worked. Now i have made the ambari-server setup successfully.

ambari-server setup

Using python /usr/bin/python Setup ambari-server Checking SELinux...

SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? n

Adjusting ambari-server permissions and ownership...

Checking firewall status...

Checking JDK...

Do you want to change Oracle JDK [y/n] (n)? n

Completing setup...

Configuring database...

Enter advanced database configuration [y/n] (n)? n

Configuring database...

Default properties detected. Using built-in database.

Configuring ambari database...

Checking PostgreSQL...

Configuring local database...

Configuring PostgreSQL...

Backup for pg_hba found, reconfiguration not required Creating schema and user... done.

Creating tables... done.

Extracting system views... ambari-admin-2.6.0.0.267.jar ...........

Adjusting ambari-server permissions and ownership...

Ambari Server 'setup' completed successfully.