简体   繁体   English

如何通过whirr在EC2集群上安装JDK 7?

[英]How to install JDK 7 on EC2 cluster via whirr?

I have some map-reduce programs compiled by Oracle JDK 7. And I'm trying to use whirr 0.8.1 to setup an EC2 cluster to run them. 我有一些由Oracle JDK 7编译的map-reduce程序。我正在尝试使用whirr 0.8.1来设置EC2集群来运行它们。 However, the default JDK installed by whirr 0.8.1 seems to be Open JDK 6, and I encountered the following error while running them: 但是,whirr 0.8.1安装的默认JDK似乎是Open JDK 6,运行时遇到以下错误:

Unsupported major.minor version 51.0 不支持的major.minor版本51.0

Therefore I tried to specify the JDK version of whirr by setting: 因此,我尝试通过设置指定JDK版本的whirr:

whirr.java.install-function = install_oracle_jdk7 whirr.java.install-function = install_oracle_jdk7

But this will cause the installation process fail, and it seems to be useless to try to modify the following script: 但这会导致安装过程失败,尝试修改以下脚本似乎没用:

whirr-0.8.1\\core\\src\\main\\resources\\functions\\install_oracle_jdk7.sh 呼呼-0.8.1 \\核心的\\ src \\主\\资源\\功能\\ install_oracle_jdk7.sh

Does anyone know how to install JDK 7 on EC2 cluster via whirr? 有谁知道如何通过whirr在EC2集群上安装JDK 7?


Thanks very much to Ravi. 非常感谢拉维。 The following information mentioned in your page is the critical piece I missed: 您页面中提到的以下信息是我错过的关键部分:

... i have found that one can create a functions directory in the whirr installation directory and putting all modified shell scripts there ... ...我发现可以在whirr安装目录中创建一个函数目录,并将所有修改过的shell脚本放在那里......

I try to put the modified install_oracle_jdk7.sh to whirr-0.8.1\\functions and this really works. 我尝试将修改后的install_oracle_jdk7.sh放到whirr-0.8.1 \\ functions中,这确实有效。 The following are my modifications in install_oracle_jdk7.sh: 以下是我在install_oracle_jdk7.sh中的修改:

(delete)
url=http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz
if [ "x86_64" == "$arch" ]; then
url=http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz
fi
(add)
url=http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-i586.tar.gz
if [ "x86_64" == "$arch" ]; then
url=http://download.oracle.com/otn-pub/java/jdk/7u9-b05/jdk-7u9-linux-x64.tar.gz
fi
(delete)
curl $url -L --silent --show-error --fail --connect-timeout 60 --max-time 600 --retry 5 -o $tmpdir/`basename $url`
(add)
wget -c --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" $url --output-document=$tmpdir/`basename $url`

With Whirr you can try with install_oab_java function as a java.install-function . 使用Whirr,您可以尝试使用install_oab_java函数作为java.install-function I had similar problems and you can find details in the link below: 我有类似的问题,你可以在下面的链接中找到详细信息:

Create hadoop cluster with apache whirr 使用apache whirr创建hadoop集群

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM