您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關Ubuntu 14中怎么安裝 Hadoop 2.7 集群,文章內(nèi)容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
解壓下載的JRE:
ak@UBU14HADOOP01:~$ tar zxvf server-jre-7u80-linux-x64.tar.gz
在USR目錄新建Java目錄:
ak@UBU14HADOOP01:~$ sudo mkdir /usr/java
拷貝剛剛解壓的JRE文件目錄到上面新建的java目錄,得到如下目錄:
ak@UBU14HADOOP01:/usr/java$ ll total 12 drwxr-xr-x 3 root root 4096 Mar 7 11:49 ./ drwxr-xr-x 11 root root 4096 Mar 7 11:49 ../ drwxr-xr-x 8 root root 4096 Mar 7 11:49 jdk1.7.0_80/
修改環(huán)境變量:
修改/etc/profile文件,在文件末尾添加如下內(nèi)容:
# Path Oracle JAVA JAVA_HOME=/usr/java/jdk1.7.0_80 JRE_HOME=/usr/java/jdk1.7.0_80/jre PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib export JAVA_HOME JRE_HOME PATH CLASSPATH
重新讀取profile文件使java目錄生效:
ak@UBU14HADOOP01:~$ source /etc/profile
檢查Java -version以確認java路徑是否生效,如果看到如下圖的返回表示java設置正確:
ak@UBU14HADOOP01:~$ java -version java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
下載Hadoop 2.7.2 binary:
ak@UBU14HADOOP02:~$ wget http://mirrors.cnnic.cn/apache/hadoop/common/hadoop-2.7.2/hadoop-2.7.2.tar.gz
解壓
ak@UBU14HADOOP02:~$ tar zxvf hadoop-2.7.2.tar.gz
SSH到本地:
ak@UBU14HADOOP01:~$ ssh localhost
命令返回如下結果:
The authenticity of host 'localhost (::1)' can't be established. ECDSA key fingerprint is 45:3e:07:9e:1f:05:bf:9d:bc:1d:7c:18:aa:f5:03:f3. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts. ak@localhost's password:
這表示SSH還沒有配置免密碼登陸。
使用SSH-KEYGEN生成秘鑰公鑰:
ak@UBU14HADOOP01:~$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
運行結果如下:
Generating public/private dsa key pair. Your identification has been saved in /home/ak/.ssh/id_dsa. Your public key has been saved in /home/ak/.ssh/id_dsa.pub. The key fingerprint is: 61:56:f3:b2:aa:8b:b0:df:cb:89:ea:6b:26:13:7d:eb ak@UBU14HADOOP01 The key's randomart image is: +--[ DSA 1024]----+ | o | | . o | | + . . | | o . o | | . S . | |. . . . | | ... . . | |o oo.= o | | *==E Bo | +-----------------+
文件存放的路徑為當前用戶的home路面下的.ssh目錄。由于ssh名前有一個點,該目錄是隱藏的。
使用如下命令把生成的公鑰放到anthorized_keys里面去:
ak@UBU14HADOOP01:~$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
使用如下命令修改authorized_keys文件的權限,這樣只有本用戶才能修改:
ak@UBU14HADOOP01:~$ chmod 0600 ~/.ssh/authorized_keys
再次ssh到本地,系統(tǒng)無密碼提示,表示配置成功:
ak@UBU14HADOOP01:~$ ssh localhost Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.19.0-51-generic x86_64) * Documentation: https://help.ubuntu.com/ System information as of Mon Mar 7 12:11:46 CST 2016 System load: 0.08 Processes: 146 Usage of /: 11.0% of 17.34GB Users logged in: 1 Memory usage: 4% IP address for eth0: 192.168.88.90 Swap usage: 0% Graph this data and manage this system at: https://landscape.canonical.com/ Last login: Mon Mar 7 12:11:47 2016 from localhost ak@UBU14HADOOP01:~$ exit logout Connection to localhost closed.
關于Ubuntu 14中怎么安裝 Hadoop 2.7 集群就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。