1.设置主机名和对应的地址映射
[root@master ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.230.130 master 192.168.230.131 slave1 192.168.230.100 slave2 #分别对三台设备配置hostname和hosts2.在三个节点上分别新建hadoop用户
[root@master ~]# tail -1 /etc/passwd hadoop:x:1001:1001::/home/hadoop:/bin/bash二、为hadoop配置所有节点之间的ssh免密登陆
1.生成密钥
[hadoop@master ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/hadoop/.ssh/id_rsa): /home/hadoop/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/hadoop/.ssh/id_rsa. Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub. The key fingerprint is: 1c:16:61:04:4f:76:93:cd:da:9a:08:04:15:58:7d:96 hadoop@master The key's randomart p_w_picpath is: +--[ RSA 2048]----+ | .===B.o= | | . .=.oE.o | | . +o o | | .o .. . | | .S. o | | . o | | | | | | | +-----------------+ [hadoop@master ~]$2.发送公钥
3.验证登陆
三、配置JAVA
1.使用xftp将hadoop-2.7.3.tar.gz和jdk-8u131-linux-x64.tar.gz上传至master
[hadoop@master ~]$ ls hadoop-2.7.3.tar.gz jdk-8u131-linux-x64.tar.gz2.使用root用户解压并移动到/usr/local 下
[hadoop@master ~]$ exit exit [root@master ~]# cd /home/hadoop/ [root@master hadoop]# ls hadoop-2.7.3.tar.gz jdk-8u131-linux-x64.tar.gz [root@master hadoop]# tar -zxf jdk-8u131-linux-x64.tar.gz [root@master hadoop]# ls hadoop-2.7.3.tar.gz jdk1.8.0_131 jdk-8u131-linux-x64.tar.gz [root@master hadoop]# mv jdk1.8.0_131 /usr/local/ [root@master hadoop]# cd /usr/local/ [root@master local]# ls bin etc games include jdk1.8.0_131 lib lib64 libexec sbin share src [root@master local]#郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。