1、将mapred-site.xml文件拷贝一份到项目中
mapreduce.framework.name yarn mapred.child.java.opts -Xmx800m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 mapreduce.jobtracker.staging.root.dir /tmp yarn.app.mapreduce.am.staging-dir /tmp mapreduce.framework.name local mapreduce.jobtracker.address local mapred.job.tracker local
2、在项目中加入本地mapred-site.xml配置,从本地项目中读取配置文件运行,在reduce中debug
Job job = new Job(conf, "word count"); conf.addResource("classpath:/Hadoop01/mapred-site.xml"); conf.set("fs.defaultFS", "hdfs://192.168.1.10:9008"); conf.set("mapreduce.framework.name", "yarn"); conf.set("yarn.resourcemanager.address", "192.168.1.10:8032"); conf.set("mapred.remote.os", "Linux"); conf.set("hadoop.job.ugi", "hadoop,hadoop");