天天看点

eclipse配置连接Hadoop

1. eclipse配置连接hadoop

hadoop的plugins包

,拷贝到eclipse的plugins目录下。管理员启动eclipse

在eclipse的windows下,preferences,找到Hadoop Map/Reduce,添加hadoop安装目录。即可。

在eclipse下,选windows,show view下,将map/reduce location调出来。 右击添加,具体端口参考配置文件。

# vim /opt/hadoop-2.6.0/etc/hadoop/core-site.xml

<configuration>
 <property>
 <name>hadoop.tmp.dir</name>
 <value>file:/opt/hadoop-2.6.0/tmp</value>
 <description>Abase for other temporary directories.</description>
 </property>
 <property>
 <name>fs.defaultFS</name>
 <value>hdfs://192.168.208.110:9000</value>
 </property>
</configuration>
           
# vim /opt/hadoop-2.6.0/etc/hadoop/hdfs-site.xml

<configuration>
 <property>
 <name>dfs.replication</name>
 <value>1</value>
 </property>
 <property>
 <name>dfs.namenode.name.dir</name>
 <value>file:/opt/hadoop-2.6.0/tmp/dfs/name</value>
 </property>
 <property>
 <name>dfs.datanode.data.dir</name>
 <value>file:/opt/hadoop-2.6.0/tmp/dfs/data</value>
 </property>
 <property>
 <name>dfs.permissions.enabled</name>
 <value>false</value>
 </property>
</configuration>
           
# vim /opt/hadoop-2.6.0/etc/hadoop/mapred-site.xml

<configuration>
<property>
 <name>mapreduce.framework.name</name>
 <value>yarn</value>
 </property>
 <property>
 <name>mapred.job.tracker</name>
 <value>192.168.208.110:10020</value>
 </property>
</configuration>           
# vim /opt/hadoop-2.6.0/etc/hadoop/yarn-site.xml

<configuration>
<property>
 <name>yarn.nodemanager.aux-services</name>
 <value>mapreduce_shuffle</value>
 </property>
</configuration>           

2. eclipse运行mapreduce程序

hdfs://192.168.208.110:9000/tmp/input
 hdfs://192.168.208.110:9000/tmp/output           

继续阅读