Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to deploy with java 8 #119

Open
rmelick opened this issue Feb 23, 2016 · 3 comments
Open

Best way to deploy with java 8 #119

rmelick opened this issue Feb 23, 2016 · 3 comments

Comments

@rmelick
Copy link

rmelick commented Feb 23, 2016

What's the best way to start up a cluster with java 8 instead of java 7? HDP Ambari documentation (https://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_ambari_reference_guide/content/ch_changing_the_jdk_version_on_an_existing_cluster.html) suggests using ambari-server setup, but I haven't been able to get that working in an automated way.

I noticed that the ambari-base Dockerfile manually downloads a specific jdk. Is there a reason this was required? Any suggestions for how we could extend the ambari-base of ambari-server/agent Dockerfiles to install java 8 before startup?

@lalyos
Copy link
Contributor

lalyos commented Feb 23, 2016

The jdk is preinstalled, in order to speed up startup time.
Right now the official ambari release is using the sepcific 1.7.0_67 version.

There are some security related issues reported with java8, so right now
we provide only java7.

However if you want to experiment with java 8 you can build the docker images locally:

Just change 2 Lines in ambar-base/Dockerfile

ENV JDK_ARTIFACT jdk-8u60-linux-x64.tar.gz
ENV JDK_VERSION jdk1.8.0_60

Than from the ambari-base dir execute a: docker build -t hortonworks/ambari-base .
After that do the same for ambari-agent and ambari-server images

@rmelick
Copy link
Author

rmelick commented Feb 24, 2016

Thanks @lalyos. We're trying to build Dockerfiles based on ambari-server and ambari-agent with FROM, instead of copying them and replacing some params.

I've gotten it to work sort of by putting the following into our Dockerfile

# install java 8
ENV JDK_ARTIFACT jdk-8u60-linux-x64.tar.gz
ENV JDK_VERSION jdk1.8.0_60
RUN cd /usr/jdk64 && wget http://public-repo-1.hortonworks.com/ARTIFACTS/$JDK_ARTIFACT && \
    tar -xf $JDK_ARTIFACT && rm -f $JDK_ARTIFACT
ENV JAVA_HOME /usr/jdk64/$JDK_VERSION
ENV PATH $JAVA_HOME/bin:$PATH

# jce
ADD http://public-repo-1.hortonworks.com/ARTIFACTS/UnlimitedJCEPolicyJDK7.zip $JAVA_HOME/jre/lib/security/
RUN cd $JAVA_HOME/jre/lib/security && unzip UnlimitedJCEPolicyJDK7.zip && rm -f UnlimitedJCEPolicyJDK7.zip && mv UnlimitedJCEPolicy/*jar . && rm -rf UnlimitedJCEPolicy

Then, after ambari-server starts, but before I register the blueprint or start cluster deployment, I run

docker exec amb-server ambari-server setup -s -j /usr/jdk64/jdk1.8.0_60
docker exec amb-server ambari-server restart

I think it hadn't been working for me before because I had forgotten to run ambari-server restart, or I was running it after the cluster had already been deployed.

I definitely agree about preinstalling into the image to help the startup time. I think I'll open a separate thread about the possibilities of preinstalling or predownloading the contents of the HDP repo, as that would also help significantly.

@grozeille grozeille mentioned this issue Jul 23, 2017
@grozeille
Copy link

I'm not sure that it's needed to choose the JDK, v7 is quite old now, v8 is standard and minimal version for future stack versions.
The pull request #138 will change the jdk to be v8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants