首先,為了日後重開機以後,維持 NameNode 的 namenodeID 不變,我們把 namenode 的資料存在 /home/hdfsadm 中。修改 /etc/hadoop/hadoop-site.xml 的 dfs.name.dir 來達成這個目標。至於原本安裝 hadoop 套件時設定的 localhost 則應該要改成 DRBL 對內的 IP 位址(這裡以 192.168.100.254 為例)。另外,也把 /etc/hadoop/slaves 修改成目前 DRBL Client 的 IP 範圍。
jazz@drbl:~$ cat /etc/hadoop/hadoop-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>fs.default.name</name>
<value>192.168.100.254:9000</value>
<description>
The name of the default file system. Either the literal string
"local" or a host:port for NDFS.
</description>
</property>
<property>
<name>mapred.job.tracker</name>
<value>192.168.100.254:9001</value>
<description>
The host and port that the MapReduce job tracker runs at. If
"local", then jobs are run in-process as a single map and
reduce task.
</description>
</property>
<property>
<name>dfs.name.dir</name>
<value>/home/hdfsadm/dfs/name</value>
<description>
Determines where on the local filesystem the DFS name node
should store the name table. If this is a comma-delimited list
of directories then the name table is replicated in all of the
directories, for redundancy.
</description>
</property>
</configuration>
jazz@drbl:~$ cat /etc/hadoop/slaves
192.168.100.1
192.168.100.2
...
192.168.100.30