编译好的hadoop安装
1:创建hadoop服务的一个用户
[root@hadoop001 home]# useradd hadoop
[root@hadoop001 home]# id hadoop
[root@hadoop001 home]# vi /etc/sudoers
hadoop ALL=(root) NOPASSWD:ALL
2:确保ssh运行
[root@hadoop001 ~]# service sshd status
3:解压hadoop
[root@hadoop001 software]# tar -zxvf hadoop-2.8.1.tar.gz
4:修改hadoop目录权限
[root@hadoop001 software]# chown -R root:root hadoop-2.8.1
[root@hadoop001 software]# chown -R root:root hadoop-2.8.1/*
/opt/software/hadoop-2.8.1
5:配置环境变量
[root@hadoop001 hadoop-2.8.1]# vi /etc/profile
JAVA_HOME=/usr/java/jdk1.8.0_45
HADOOP_HOME=/opt/software/hadoop-2.8.1
export PATH=$HADOOP_HOME/bin:$JAVA_HOME/bin:$PATH
6:
[root@hadoop001 hadoop-2.8.1]# which hadoop
[root@hadoop001 software]# ln -s /opt/software/hadoop-2.8.1 hadoop
[root@hadoop001 software]# chown -R hadoop:hadoop hadoop
[root@hadoop001 software]# chown -R hadoop:hadoop hadoop/*
[root@hadoop001 software]# chown -R hadoop:hadoop hadoop-2.8.1
[root@hadoop001 software]# cd hadoop-2.8.1
[root@hadoop001 hadoop-2.8.1]# cd bin/
[root@hadoop001 bin]# rm -rf *.cmd
7:配置hadoop模块组件
[root@hadoop001 hadoop-2.8.1]# cd /opt/software/hadoop-2.8.1/etc/hadoop/
[root@hadoop001 hadoop]# vi core-site.xml
[root@hadoop001 hadoop]# vi hdfs-site.xml
8:配置root用户ssh信任关系
[root@hadoop001 home]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
[root@hadoop001 home]# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[root@hadoop001 home]# chmod 0600 ~/.ssh/authorized_keys
[root@hadoop001 home]# cd ~/.ssh/
没有ssh客户端的安装openssh 客户端
[root@hadoop001 .ssh]# yum install openssh-clients
[root@hadoop001 .ssh]# ssh localhost date
修改文件
[root@hadoop001 sbin]# vi /opt/software/hadoop-2.8.1/etc/hadoop/hadoop-env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_45
export HADOOP_PREFIX=//opt/software/hadoop-2.8.1
9:格式hadoop存在目录
[root@hadoop001 sbin]# ./hdfs namenode -format
10:启动hadoop
[root@hadoop001 sbin]# ./start-dfs.sh
访问hadoop
http://192.168.43.133:50070/dfshealth.html#tab-overview