hadoop2.6安装
https://blog.csdn.net/qq_51903852/article/details/120952910?spm=1001.2014.3001.5501
修改配置
# 查看目录
[root@mihaoyu151 hadoop]# pwd
/opt/soft/hadoop260/etc/hadoop# 修改
[root@mihaoyu151 hadoop]# vi ./hadoop-env.sh
25 export JAVA_HOME=/opt/soft/jdk180# 修改
[root@mihaoyu151 hadoop]# vi ./mapred-env.sh
16 export JAVA_HOME=/opt/soft/jdk180# 修改
[root@mihaoyu151 hadoop]# vi ./yarn-env.sh
23 export JAVA_HOME=/opt/soft/jdk180# 添加
[root@mihaoyu151 hadoop]# vi ./core-site.xml
<configuration><property><!-- HDFS namenode地址 --><name>fs.defaultFS</name><value>hdfs://mihaoyu151:9000</value></property><property><!-- HADOOP 运行时存储路径 --><name>hadoop.tmp.dir</name><value>/opt/soft/hadoop260/hadooptmp</value></property><property><name>hadoop.proxyuser.root.hosts</name><value>*</value></property><property><name>hadoop.proxyuser.root.groups</name><value>*</value></property>
</configuration># 添加
[root@mihaoyu151 hadoop]# vi ./hdfs-site.xml
<configuration><property><!-- 设置hadoop存储文件的副本数,默认三份 --><name>dfs.replication</name><value>1</value></property><property><!-- secondary设置 --><name>dfs.namenode.secondary.http-address</name><value>mihaoyu151:50090</value></property>
</configuration># 添加
[root@mihaoyu151 hadoop]# vi ./mapred-site.xml
<configuration><property><!-- mapreduce执行计算时,使用的资源调度框架为Yarn --><name>mapreduce.framework.name</name><value>yarn</value></property><property><name>mapreduce.jobhistory.address</name><value>mihaoyu151:10020</value></property><property><name>mapreduce.jobhistory.webapp.address</name><value>mihaoyu151:19888</value></property>
</configuration># 添加
[root@mihaoyu151 hadoop]# vi ./yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties --><property><!-- reduce获取数据的方式 --><name>yarn.nodemanager.aux-services</name><value>mapreduce_shuffle</value></property><property><name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name><value>org.apache.hadoop.mapred.ShuffleHandler</value></property><property><!-- 指定YARN的resourceManager的地址 --><name>yarn.resourcemanager.hostname</name><value>mihaoyu151</value></property><property><!-- 日志聚集功能 --><name>yarn.log-aggregation-enable</name><value>true</value></property><property><!-- 设置日志记录保留天数为7天 --><name>yarn.log-aggregation.retain-seconds</name><value>604800</value></property>
</configuration># 修改
[root@mihaoyu151 hadoop]# vi ./slaves
mihaoyu151# 格式化
[root@mihaoyu151 hadoop]# hadoop namenode -format
1)格式化出现错误,返回/opt/soft/hadoop260目录,删除hadooptmp文件夹
2)修改错误,重新格式化