CentOS 7.4下Hadoop 2.7.6安装部署(2)

[yun@mini01 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini01
[yun@mini01 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini02
[yun@mini01 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini03
[yun@mini01 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini04
[yun@mini01 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini05

mini02分发密钥

[yun@mini02 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini01
[yun@mini02 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini02
[yun@mini02 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini03
[yun@mini02 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini04
[yun@mini02 .ssh]$ ssh-copy-id -i ~/.ssh/id_rsa.pub mini05

远程登录测试【最好都测试一下】

[yun@mini02 ~]$ ssh mini05
Last login: Sat Jun  9 19:47:43 2018 from 10.0.0.11
 
Welcome You Login
 
[yun@mini05 ~]$            # 表示远程登录成功

3.3. 远程免密登录原理图

CentOS 7.4下Hadoop 2.7.6安装部署

3.4. .ssh目录中的文件说明

[yun@mini01 .ssh]$ pwd
/app/.ssh
[yun@mini01 .ssh]$ ll
total 16
-rw------- 1 yun yun  784 Jun  9 19:43 authorized_keys
-rw------- 1 yun yun 1679 Jun  9 19:17 id_rsa
-rw-r--r-- 1 yun yun  392 Jun  9 19:17 id_rsa.pub
-rw-r--r-- 1 yun yun 1332 Jun  9 19:41 known_hosts
########################################################################################
  authorized_keys:存放远程免密登录的公钥,主要通过这个文件记录多台机器的公钥
  id_rsa : 生成的私钥文件
  id_rsa.pub : 生成的公钥文件
know_hosts : 已知的主机公钥清单

4. Jdk【java8】 4.1. 软件安装

[yun@mini01 software]# pwd
/app/software
[yun@mini01 software]# tar xf jdk1.8.0_112.tar.gz
[yun@mini01 software]# ll
total 201392
drwxr-xr-x 8  10  143      4096 Dec 20 13:27 jdk1.8.0_112
-rw-r--r-- 1 root root 189815615 Mar 12 16:47 jdk1.8.0_112.tar.gz
[yun@mini01 software]# mv jdk1.8.0_112/ /app/
[yun@mini01 software]# cd /app/
[yun@mini01 app]# ll
total 8
drwxr-xr-x  8  10  143 4096 Dec 20 13:27 jdk1.8.0_112
[yun@mini01 app]# ln -s jdk1.8.0_112/ jdk
[yun@mini01 app]# ll
total 8
lrwxrwxrwx  1 root root    13 May 16 23:19 jdk -> jdk1.8.0_112/
drwxr-xr-x  8  10  143 4096 Dec 20 13:27 jdk1.8.0_112

4.2. 环境变量

[root@mini01 ~]$ pwd
/app
[root@mini01 ~]$ ll -d jdk*  # 可以根据实际情况选择jdk版本,其中jdk1.8 可以兼容 jdk1.7 
lrwxrwxrwx 1 yun yun  11 Mar 15 14:58 jdk -> jdk1.8.0_112
drwxr-xr-x 8 yun yun 4096 Dec 20 13:27 jdk1.8.0_112
[root@mini01 profile.d]$ pwd
/etc/profile.d
[root@mini01 profile.d]$ cat jdk.sh # java环境变量 
export JAVA_HOME=/app/jdk
export JRE_HOME=/app/jdk/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
 
[root@mini01 profile.d]# source /etc/profile
[root@mini01 profile.d]$ java -version 
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

5. Hadoop配置修改并启动【所有机器配置文件一样】

[yun@mini01 software]$ pwd
/app/software
[yun@mini01 software]$ ll
total 194152
-rw-r--r-- 1 yun yun 198811365 Jun  8 16:36 CentOS-7.4_hadoop-2.7.6.tar.gz
[yun@mini01 software]$ tar xf CentOS-7.4_hadoop-2.7.6.tar.gz
[yun@mini01 software]$ mv hadoop-2.7.6/ /app/
[yun@mini01 software]$ cd
[yun@mini01 ~]$ ln -s hadoop-2.7.6/ hadoop
[yun@mini01 ~]$ ll
total 4
lrwxrwxrwx  1 yun yun  13 Jun  9 16:21 hadoop -> hadoop-2.7.6/
drwxr-xr-x  9 yun yun  149 Jun  8 16:36 hadoop-2.7.6
lrwxrwxrwx  1 yun yun  12 May 26 11:18 jdk -> jdk1.8.0_112
drwxr-xr-x  8 yun yun  255 Sep 23  2016 jdk1.8.0_112

5.1. 环境变量

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/b2e31508b89581f63241fcea001a6e24.html