相关阅读:
在Ubuntu部署Hadoop之单机模式 http://www.linuxidc.com/Linux/2013-01/77683.htm
在Ubuntu部署Hadoop之伪分布模式 http://www.linuxidc.com/Linux/2013-01/77684.htm
在Ubuntu部署Hadoop之全分布模式 http://www.linuxidc.com/Linux/2013-01/77685.htm
已经安装好了jdk和hadoop-0.20.2。
首先在hadoop目录下新建几个文件夹
xukangde@xukangde-01:~/hadoop$ mkdir tmp
xukangde@xukangde-01:~/hadoop$ mkdir hdfs
xukangde@xukangde-01:~/hadoop$ mkdir hdfs/name
xukangde@xukangde-01:~/hadoop$ mkdir hdfs/data
core-site.xml: Hadoop Core的配置项,例如HDFS和MapReduce常用的I/O设置等。
hdfs-site.xml: Hadoop 守护进程的配置项,包括namenode,辅助namenode和datanode等。
mapred-site.xml: MapReduce 守护进程的配置项,包括jobtracker和tasktracker。
在conf目录中,编辑以下文件:(以xukangde用户登录,则目录path/to/your/hadoop应该为/home/xukangde/hadoop)
core-site.xml,hdfs-site.xml,mapred-site.xml
xukangde@xukangde-01:~/hadoop$ sudo gedit conf/core-site.xml
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/path/to/your/hadoop/tmp</value>
</property>
</configuration>
xukangde@xukangde-01:~/hadoop$ sudo gedit conf/hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>/path/to/your/hadoop/hdfs/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/path/to/your/hadoop/hdfs/data</value>
</property>
</configuration>
xukangde@xukangde-01:~/hadoop$ sudo gedit conf/mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>