- 安装JDK
a) 下载jdk-8u65-linux-x64.tar.gz
b)上传并tar开
$ cd ~
$ mkdir downloads
c)利用FileZilla把jdk-8u65-linux-x64.tar.gz
上传到~/downloads/目录下
$ cd ~/downloads/
$ cd ls
$ tar -zxvf jdk-8u65-linux-x64.tar.gz
d)创建/soft文件夹
$ sudo mkdir /soft
$ sudo chown yylin:yylin /soft
e)移动tar开的文件到/soft下
$ mv ~/downloads/jdk1.8.0_65 /soft/
f)创建符号连接
$ ln -s /soft/jdk1.8.0_65 /soft/jdk
g)验证jdk安装是否成功
$ cd /soft/jdk/bin
$ ./java -version
出现java版本信息,说明安装成功,接下来配置环境变量。
h)配置java环境变量
(1)编辑/etc/profile
$ sudo vi /etc/profile
在profile文件最后加上下面两行
(2)使环境变量即刻生效... export JAVA_HOME=/soft/jdk exprot PATH=$PATH:$JAVA_HOME/bin
$ source /etc/profile
(3)进入任意目录下,测试是否ok
$ cd ~
$ java -version
出现java版本信息,说明JDK环境变量配置成功。
- 安装JDK
-
- 安装Hadoop
(1)安装hadoop
a)下载 hadoop-2.7.7.tar.gz
b)上传并tar开
[yylin@big ~]$ cd ~/downloads/ [yylin@big downloads]$ ll total 390612 -rw-rw-r--. 1 yylin yylin 218720521 May 7 17:36 hadoop-2.7.7.tar.gz -rw-rw-r--. 1 yylin yylin 181260798 May 3 19:32 jdk-8u65-linux-x64.tar.gz [yylin@big downloads]$ tar -zxvf hadoop-2.7.7 ...... [yylin@big downloads]$ ll total 390612 drwxr-xr-x. 9 yylin yylin 149 Jul 19 2018 hadoop-2.7.7 -rw-rw-r--. 1 yylin yylin 218720521 May 7 17:36 hadoop-2.7.7.tar.gz -rw-rw-r--. 1 yylin yylin 181260798 May 3 19:32 jdk-8u65-linux-x64.tar.gz
c)移动tar开的文件到/soft下,并创建符号连接
[yylin@big downloads]$ mv ~/downloads/hadoop-2.7.7 /soft/ [yylin@big downloads]$ cd /soft/ [yylin@big soft]$ ll total 0 drwxr-xr-x. 9 yylin yylin 149 Jul 19 2018 hadoop-2.7.7 lrwxrwxrwx. 1 yylin yylin 18 May 6 21:31 jdk -> /soft/jdk1.8.0_65/ drwxr-xr-x. 8 yylin yylin 255 Oct 7 2015 jdk1.8.0_65 [yylin@big soft]$ ln -s /soft/hadoop-2.7.7 /soft/hadoop [yylin@big soft]$ ll total 0 lrwxrwxrwx. 1 yylin yylin 18 May 7 17:45 hadoop -> /soft/hadoop-2.7.7 drwxr-xr-x. 9 yylin yylin 149 Jul 19 2018 hadoop-2.7.7 lrwxrwxrwx. 1 yylin yylin 18 May 6 21:31 jdk -> /soft/jdk1.8.0_65/ drwxr-xr-x. 8 yylin yylin 255 Oct 7 2015 jdk1.8.0_65
d)验证jdk安装是否成功(出现版本信息,说明安装成功)
[yylin@big hadoop]$ cd /soft/hadoop/bin/ [yylin@big bin]$ ls container-executor hadoop.cmd hdfs.cmd mapred.cmd test-container-executor yarn.cmd hadoop hdfs mapred rcc yarn [yylin@big bin]$ ./hadoop version Hadoop 2.7.7 Subversion Unknown -r c1aad84bd27cd79c3d1a7dd58202a8c3ee1ed3ac Compiled by stevel on 2018-07-18T22:47Z Compiled with protoc 2.5.0 From source with checksum 792e15d20b12c74bd6f19a1fb886490 This command was run using /soft/hadoop-2.7.7/share/hadoop/common/hadoop-common-2.7.7.jar
- 安装Hadoop
(2)配置hadoop环境变量
编辑/etc/profile文件
[yylin@big bin]$ sudo vi /etc/profile
在profile文件最后加上下面两行
...
export HADOOP_HOME=/soft/hadoop
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
(3)生效并测试
[yylin@big bin]$ source /etc/profile
[yylin@big bin]$ cd ~
[yylin@big ~]$ hadoop version
Hadoop 2.7.7
Subversion Unknown -r c1aad84bd27cd79c3d1a7dd58202a8c3ee1ed3ac
Compiled by stevel on 2018-07-18T22:47Z
Compiled with protoc 2.5.0
From source with checksum 792e15d20b12c74bd6f19a1fb886490
This command was run using /soft/hadoop-2.7.7/share/hadoop/common/hadoop-common-2.7.7.jar
经过上述操作就搭建好了hadoop环境,到目前为止是本地模式(单机模式),接下来配置完全分布式模式。
网友评论