您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關linux中Hadoop如何安裝,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
一 安裝JDK
1.下載JDK
目前最新JDK:Java SE Development Kit 8u91
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2.解壓安裝
我們把JDK安裝到這個路徑:/usr/lib/jvm
如果沒有這個目錄(第一次當然沒有),我們就新建一個目錄
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.配置環境變量
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.配置默認JDK(一般情況下這一步都可以省略)
由于一些Linux的發行版中已經存在默認的JDK,如OpenJDK等。所以為了使得我們剛才安裝好的JDK版本能成為默認的JDK版本,我們還要進行下面的配置。
執行下面的命令:
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
注意:如果以上兩個命令出現找不到路徑問題,只要重啟一下計算機在重復上面兩行代碼就OK了。
5.驗證安裝成功
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
關于“linux中Hadoop如何安裝”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。