一、安装准备
1.安装包:
Hadoop-2.8.1.tar.gz 下载地址:
JDK1.8 下载地址:
二、环境配置
1.静态IP配置
2.免密码登录
3.JDK安装
安装 tar -zxvf jdk1.8.0.tar.gz
配置环境变量
export JAVA_HOME=/opt/soft/jdk1.8export PATH=$JAVA_HOME/bin:$PATH
三、Hadoop安装
1.解压下载好的安装包
tar -zxvf hadoop-2.8.1.tar.gz
2.配置环境变量
export HADOOP_HOME=/usr/hadoop export PATH=$PATH:$HADOOP_HOME/bin
3.修改配置文件
位置your_hadoop_dir/etc/hadoop
(1)hadoop-env.sh
export JAVA_HOME=/opt/soft/jdk1.8
即与系统的环境变量JAVA_HOME保持一致。
(2)core-site.xml
hadoop.tmp.dir /opt/soft/hadoop-2.8.1/tmp true A base for other temporary directories. fs.default.name hdfs://Hadoop1:9000 true io.file.buffer.size 131072
(3)hdfs-site.xml
dfs.replication 2 dfs.name.dir /usr/local/hadoop/hdfs/name dfs.data.dir /usr/local/hadoop/hdfs/data dfs.namenode.secondary.http-address Hadoop1:9001 dfs.webhdfs.enabled true dfs.permissions false
(3)mapred-site.xml
mapreduce.framework.name yarn
(4)yarn-site.xml
yarn.resourcemanager.address Hadoop1:18040 yarn.resourcemanager.scheduler.address Hadoop1:18030 yarn.resourcemanager.webapp.address Hadoop1:18088 yarn.resourcemanager.resource-tracker.address Hadoop1:18025 yarn.resourcemanager.admin.address Hadoop1:18141 yarn.nodemanager.aux-services mapreduce_shuffle yarn.nodemanager.aux-services.mapreduce.shuffle.class org.apache.hadoop.mapred.ShuffleHandler
(5)slaves
Hadoop2Hadoop3
(6)将配置好的hadoop,发送到其他两台机器
scp –r /opt/soft/hadoop2.8.1 root :/opt/soft/
三、启动
1.格式化namenode
hadoop namenode -format
2.启动
./sbin/start-all.sh
3.查看节点状态
hadoop dfsadmin -report
4.web页面 http://your_ip:50079/