Support Questions

Find answers, ask questions, and share your expertise

setuping ambari with existing jdk cause issues

avatar
Explorer

i find out that if i setup ambari with "ambari-server setup -j /path/to/your/installed/jdk".

when i come to the confirm hosts step, i get warning : there are JDK issues on the hosts

but when i change to configurate jdk with downloading from hortonworks,there is no issues,but i still can't find jdk on the hosts.why? please tell me how it works.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@white wartih

When you use the following option to choose your own desired JDK to run your cluster, then you will need to make sure that the mentioned JDK is alredy installed on all the host of the cluster and also it should be present on exactly the same path "/path/to/your/installed/jdk"

# ambari-server setup -j /path/to/your/installed/jdk

.

Please refer to the following note from the doc snippet:

This option specifies the JAVA_HOME path to use on the Ambari Server and all hosts in the cluster. By default when you do not specify this option, Ambari Server setup downloads the Oracle JDK 1.8 binary and accompanying Java Cryptography Extension (JCE) Policy Files to /var/lib/ambari-server/resources. Ambari Server then installs the JDK to /usr/jdk64.

Use this option when you plan to use a JDK other than the default Oracle JDK 1.8. See JDK Requirements for more information on the supported JDKs. If you are using an alternate JDK, you must manually install the JDK on all hosts and specify the Java Home path during Ambari Server setup. If you plan to use Kerberos, you must also install the JCE on all hosts.

This path must be valid on all hosts.

For example: ambari-server setup –j /usr/java/default

.

Reference: https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.0/bk_ambari-installation/content/setup_option...

View solution in original post

3 REPLIES 3

avatar
Master Mentor

@white wartih

When you use the following option to choose your own desired JDK to run your cluster, then you will need to make sure that the mentioned JDK is alredy installed on all the host of the cluster and also it should be present on exactly the same path "/path/to/your/installed/jdk"

# ambari-server setup -j /path/to/your/installed/jdk

.

Please refer to the following note from the doc snippet:

This option specifies the JAVA_HOME path to use on the Ambari Server and all hosts in the cluster. By default when you do not specify this option, Ambari Server setup downloads the Oracle JDK 1.8 binary and accompanying Java Cryptography Extension (JCE) Policy Files to /var/lib/ambari-server/resources. Ambari Server then installs the JDK to /usr/jdk64.

Use this option when you plan to use a JDK other than the default Oracle JDK 1.8. See JDK Requirements for more information on the supported JDKs. If you are using an alternate JDK, you must manually install the JDK on all hosts and specify the Java Home path during Ambari Server setup. If you plan to use Kerberos, you must also install the JCE on all hosts.

This path must be valid on all hosts.

For example: ambari-server setup –j /usr/java/default

.

Reference: https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.0/bk_ambari-installation/content/setup_option...

avatar
Explorer
@Jay SenSharmathanks.but i mean why i need to do this on all hosts while using default choice don't.And i still can't find jdk on hosts by using "find / -name '*jdk* -type d'"

avatar
Master Mentor

@white wartih

When you run the ambari-server setup command (Without using -j /path/to/your/installed/jdk) option then ambari provides you two options to choose your JDK JDK1.8 or JDK1.7 as following

# ambari-server setup
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? 
Customize user account for ambari-server daemon [y/n] (n)? 
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 

.

When you choose any of those options then ambari will download the JDK from the following locations.

# grep "jdk1.7.url" /etc/ambari-server/conf/ambari.properties 
jdk1.7.url=http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-7u67-linux-x64.tar.gz

# grep "jdk1.8.url" /etc/ambari-server/conf/ambari.properties 
jdk1.8.url=http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u112-linux-x64.tar.gz

.

On the ambari server the desired JDK TAR ball is placed inside the following location:

# ls -l /var/lib/ambari-server/resources/jdk-8u60-linux-x64.tar.gz 
-rw-r--r--. 1 root root 181238643 Jun 22 16:26 /var/lib/ambari-server/resources/jdk-8u60-linux-x64.tar.gz

.

And the same JDK is pushed to all the ambari agent machines in the following location.

# ls -l /var/lib/ambari-agent/tmp/jdk-8u112-linux-x64.tar.gz 
-rwxr-xr-x. 1 root root 183212596 Jun  9 11:12 /var/lib/ambari-agent/tmp/jdk-8u112-linux-x64.tar.gz

.

This is how the agents gets the JDK binary from ambari server.

.

So if you want to choose your own JDK then as per the Current Design and Implementation of Ambari you will need to Make sure that the JDK is manually installed on all the host machine by you and on the asme path that you mentioned in the "ambari-server setup -j /path/to/your/installed/jdk" command. And this is what Ambari Server Documentation says:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.4.0.0/bk_ambari-installation/content/setup_option...

.