1.格式化HDFS:
hadoop namenode -format
錯誤1 :
配置文件 *-*.xml 中 <*></*> 標籤配對錯誤
[Fatal Error] hdfs-site.xml:10:6: The element type "name" must be terminated by the matching end-tag "</name>".
13/05/10 19:52:26 FATAL conf.Configuration: error parsing conf file: org.xml.sax.SAXParseException: The element type "name" must be terminated by the matching end-tag "</name>".
13/05/10 19:52:26 ERROR namenode.NameNode: java.lang.RuntimeException: org.xml.sax.SAXParseException: The element type "name" must be terminated by the matching end-tag "</name>".
解決:
沒啥說的。 java
錯誤2:
當前用戶對配置文件 core-site.xml 中指定的臨時目錄 hadoop.tmp.dir 沒有足夠權限
hm@hm-ubuntu:/usr/hadoop-1.1.2/bin$ hadoop namenode -format
13/05/10 19:55:32 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = hm-ubuntu/127.0.1.1
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 1.1.2
STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.1 -r 1440782; compiled by 'hortonfo' on Thu Jan 31 02:03:24 UTC 2013
************************************************************/
13/05/10 19:55:32 INFO util.GSet: VM type = 32-bit
13/05/10 19:55:32 INFO util.GSet: 2% max memory = 19.33375 MB
13/05/10 19:55:32 INFO util.GSet: capacity = 2^22 = 4194304 entries
13/05/10 19:55:32 INFO util.GSet: recommended=4194304, actual=4194304
13/05/10 19:55:33 INFO namenode.FSNamesystem: fsOwner=hm
13/05/10 19:55:33 INFO namenode.FSNamesystem: supergroup=supergroup
13/05/10 19:55:33 INFO namenode.FSNamesystem: isPermissionEnabled=true
13/05/10 19:55:33 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=100
13/05/10 19:55:33 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
13/05/10 19:55:33 INFO namenode.NameNode: Caching file names occuring more than 10 times
13/05/10 19:55:33 ERROR namenode.NameNode: java.io.IOException: Cannot create directory /opt/hadoop/hadoop-hm/dfs/name/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:294)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1326)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1345)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1207)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1398)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1419)
13/05/10 19:55:33 INFO namenode.NameNode:
SHUTDOWN_MSG
:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at hm-ubuntu/127.0.1.1
************************************************************/
解決:
指定爲有足夠權限的目錄 node
成功:
2.啓動Hadoop:
1)使用start-all.sh啓動Hadoop:
hm@hm-ubuntu:/usr/hadoop-1.1.2/bin$ start-all.sh
錯誤:
當前用戶對hadoop安裝目錄無足夠權限
chrome
hm@hm-ubuntu:/usr/hadoop-1.1.2/bin$ start-all.sh
mkdir: cannot create directory `/usr/hadoop-1.1.2/libexec/../logs': Permission denied
chown: cannot access `/usr/hadoop-1.1.2/libexec/../logs': No such file or directory
starting namenode, logging to /usr/hadoop-1.1.2/libexec/../logs/hadoop-hm-namenode-hm-ubuntu.out
/usr/hadoop-1.1.2/bin/hadoop-daemon.sh: line 136: /usr/hadoop-1.1.2/libexec/../logs/hadoop-hm-namenode-hm-ubuntu.out: No such file or directory
head: cannot open `/usr/hadoop-1.1.2/libexec/../logs/hadoop-hm-namenode-hm-ubuntu.out' for reading: No such file or directory
hm@localhost's password:
... ...
解決:
執行 chown 命令爲當前用戶賦予對目錄可寫的權限 shell
sudo chown -hR hm hadoop-1.1.2
2)查看當前java進程:
3)中止Hadoop:
4)從網頁瀏覽Hadoop狀態:
若是更改了用戶名和主機名,可能致使ubuntu自帶的firefox不能啓動。卸載firefox,安裝chrome。
apache
sudo apt-get remove firefox
sudo dpkg -i chrome.deb
http://localhost:50030
ubuntu
http://localhost:50070
- end svn