= 2009-03-30 = * Hadoop 與 DRBL 整合時,常遇到 storageID 無法識別的困擾,遇到這種問題的時候,就直接給定 hostname 當 storageID 就可以看到全部的 !DataNode 都加進 HDFS 了 * 首先,為了日後重開機以後,維持 !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 fs.default.name 192.168.100.254:9000 The name of the default file system. Either the literal string "local" or a host:port for NDFS. mapred.job.tracker 192.168.100.254:9001 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. dfs.name.dir /home/hdfsadm/dfs/name 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. jazz@drbl:~$ cat /etc/hadoop/slaves 192.168.100.1 192.168.100.2 ... 192.168.100.30 }}} * 接著以 dcs 的功能執行 re-deploy 好讓每一個 nodes 的設定同步。然後只做一次 namenode 格式化,以後就不需要再格式化了。 {{{ jazz@drbl:~$ sudo /opt/drbl/sbin/dcs jazz@drbl:~$ sudo /opt/hadoop/bin/hadoop namenode -format }}} {{{ hdfsadm@drbl:~$ /opt/hadoop/bin/stop-all.sh hdfsadm@drbl:~$ dsh -a "echo \"storageID=\$(hostname)\" >> /tmp/hadoop-hdfsadm/dfs/data/current/VERSION" hdfsadm@drbl:~$ /opt/hadoop/bin/start-all.sh }}}