配置Eclipse连接Hadoop

我的Hadoop配置在开源的Virtual-box上面,系统是Ubuntu 12.04

 

配置Hadoop开发环境的文章就很多了,这里不累述。

这里是我Hadoop单机模式下的配置。

注意一点,地址要用本机的IP地址,不要用localhost,否则Eclipse会连接失败。

因为这一点,我反复搞了2个星期。

 

贴上代码:

core-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
<property>
  <name>hadoop.tmp.dir</name>
  <value>/usr/hadoop/hadoop-1.0.4/tmp</value>
  <description>A base for other temporary directions</description>
</property> 
<property>
  <name>fs.default.name</name>
  <value>hdfs://192.168.1.102:9000</value>
</property>
</configuration>

 

hdfs-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
 <property>
    <name>dfs.data.dir</name>
    <value>/usr/hadoop/hadoop-1.0.4/data</value>
  </property>

 <property>
    <name>dfs.name.dir</name>
    <value>/usr/hadoop/hadoop-1.0.4/name</value>
  </property>

<property>
    <name>dfs.replication</name>
    <value>1</value>
  </property>
</configuration>

 

mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <property>
    <name>mapred.job.tracker</name>
    <value>192.168.1.102:9001</value>
  </property>
</configuration>

 

另外,注意一点,在Eclipse插件配置的地方,要和这里的配置是一样的。

比如说:hadoop.tmp.dir 对应的路径,要配置上去Eclipse

同理有:dfs.data.dir , dfs.name.dir。

 

另外,遇到了一些无法创建路径的问题,

这些问题需要通过Linux文件系统授权来完成。

详情请看附件。

 

 

 

 

你可能感兴趣的:(eclipse)