详细配置还是得看官网:https://hadoop.apache.org/docs/r3.2.0/hadoop-project-dist/hadoop-common/SingleCluster.html#Pseudo-Distributed_Operation
我配置的是单节点,伪分布式
运行实例wordcount报错
Container exited with a non-zero exit code 1. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster
解决方法:
跟着官网的配置,在etc/hadoop/mapred-site.xml中加入配置
<configuration> <property> <name>mapreduce.application.classpath</name> <value>$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*</value> </property> </configuration> 注意自己的环境变量的配置,就可成功运行 bin/yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.0.jar wordcount /input /output