eclipse debug调试mapreduce程序
1、将mapred-site.xml文件拷贝一份到项目中
<configuration> <property> <name>mapreduce.framework.name</name> <value>yarn</value> </property> <property> <name>mapred.child.java.opts</name> <value>-Xmx800m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000</value> </property> <property> <name>mapreduce.jobtracker.staging.root.dir</name> <value>/tmp</value> </property> <property> <name>yarn.app.mapreduce.am.staging-dir</name> <value>/tmp</value> </property> <property> <name>mapreduce.framework.name</name> <value>local</value> </property> <property> <name>mapreduce.jobtracker.address</name> <value>local</value> </property> <property> <name>mapred.job.tracker</name> <value>local</value> </property> </configuration>
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");
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。