您好,登錄后才能下訂單哦!
這篇文章將為大家詳細(xì)講解有關(guān)linux中Hadoop如何安裝,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
一 安裝JDK
1.下載JDK
目前最新JDK:Java SE Development Kit 8u91
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2.解壓安裝
我們把JDK安裝到這個(gè)路徑:/usr/lib/jvm
如果沒有這個(gè)目錄(第一次當(dāng)然沒有),我們就新建一個(gè)目錄
1 cd /usr/lib
2 sudo mkdir jvm
建立好了以后,我們來到剛才下載好的壓縮包的目錄,解壓到我們剛才新建的文件夾里面去,并且修改好名字方便我們管理
1 sudo tar zxvf ./jdk-8u91-linux-x64.tar.gz -C /usr/lib/jvm
2 cd /usr/lib/jvm
3 sudo mv jdk1.8.0_91/ jdk8
3.配置環(huán)境變量
gedit ~/.bashrc
在打開的文件的末尾添加
export JAVA_HOME=/usr/lib/jvm/jdk8
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
保存退出,然后輸入下面的命令來使之生效
source ~/.bashrc
4.配置默認(rèn)JDK(一般情況下這一步都可以省略)
由于一些Linux的發(fā)行版中已經(jīng)存在默認(rèn)的JDK,如OpenJDK等。所以為了使得我們剛才安裝好的JDK版本能成為默認(rèn)的JDK版本,我們還要進(jìn)行下面的配置。
執(zhí)行下面的命令:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk8/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk8/bin/javac 300
注意:如果以上兩個(gè)命令出現(xiàn)找不到路徑問題,只要重啟一下計(jì)算機(jī)在重復(fù)上面兩行代碼就OK了。
5.驗(yàn)證安裝成功
michael@ubuntu:~$ java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
二 配置SSH
michael@ubuntu:~$ sudo apt-get install ssh
[sudo] password for michael:
michael@ubuntu:~$ ls -a /home/michael
. .dmrc .local .python-eggs
.. Documents .mission-control redis-3.2.0
.bash_history Downloads .mozilla redis-3.2.0.tar.gz
.bash_logout examples.desktop Music .rediscli_history
.bashrc ez_setup.py .oracle_jre_usage Templates
.bashrc~ .fontconfig .pam_environment .thumbnails
.cache .gconf Pictures Videos
.compiz-1 .gnome2 .profile .Xauthority
.config .gtk-bookmarks Public .xsession-errors
.dbus .gvfs .pulse .xsession-errors.old
Desktop .ICEauthority .pulse-cookie
michael@ubuntu:~$ cd .ssh
bash: cd: .ssh: No such file or directory
michael@ubuntu:~$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
Generating public/private dsa key pair.
Created directory '/home/michael/.ssh'.
Your identification has been saved in /home/michael/.ssh/id_dsa.
Your public key has been saved in /home/michael/.ssh/id_dsa.pub.
The key fingerprint is:
a8:c1:14:50:51:a8:4f:51:05:92:fe:b3:f0:1c:be:71 michael@ubuntu
The key's randomart p_w_picpath is:
+--[ DSA 1024]----+
| .o=*+o. |
| +o |
| o.. |
| .oo . |
| oo.. S |
| oo+ |
| .=.+E |
| =o |
| .. |
+-----------------+
michael@ubuntu:~$ cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys
michael@ubuntu:~$ ssh -version
OpenSSH_5.9p1 Debian-5ubuntu1.9, OpenSSL 1.0.1 14 Mar 2012
Bad escape character 'rsion'.
michael@ubuntu:~$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is b7:fe:dc:32:13:c0:d6:2f:20:1b:ea:c8:ab:ab:c6:55.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-generic x86_64)
* Documentation: https://help.ubuntu.com/
New release '14.04.4 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Tue May 24 07:20:17 2016
關(guān)于“l(fā)inux中Hadoop如何安裝”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。