设置 Java_Home

设置 Java_Home

当我尝试格式化我的集群时,我得到了以下 msj

Re-format filesystem in /app/hadoop/tmp/dfs/name ? (Y or N) Y
14/04/28 10:20:16 INFO util.GSet: VM type       = 64-bit
14/04/28 10:20:16 INFO util.GSet: 2% max memory = 19.33375 MB
14/04/28 10:20:16 INFO util.GSet: capacity      = 2^21 = 2097152 entries
14/04/28 10:20:16 INFO util.GSet: recommended=2097152, actual=2097152
14/04/28 10:20:17 INFO namenode.FSNamesystem: fsOwner=ricardo
14/04/28 10:20:17 INFO namenode.FSNamesystem: supergroup=supergroup
14/04/28 10:20:17 INFO namenode.FSNamesystem: isPermissionEnabled=true
14/04/28 10:20:17 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=100
14/04/28 10:20:17 INFO namenode.FSNamesystem: isAccessTokenEnabled=false     accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
14/04/28 10:20:17 INFO namenode.NameNode: Caching file names occuring more than 10 times 
14/04/28 10:20:17 ERROR namenode.NameNode: java.io.IOException: Cannot remove current directory: /app/hadoop/tmp/dfs/name/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:292)
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)

14/04/28 10:20:17 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at ricardo-VirtualBox/127.0.1.1
************************************************************/

有人能帮助解决这些错误信息吗

ERROR namenode.NameNode: java.io.IOException: Cannot remove current directory: /app/hadoop/tmp/dfs/name/current

我尝试运行这个:

sudo su 

bin/hadoop namenode -format

我得到了这个:

Error: JAVA_HOME is not set.

答案1

设置 Java_Home

1)cd /usr/lib/jvm
2) ls -l
检查哪个 java
3)java-6-openjdk-amd64 (或) java-7-openjdk-amd64

4)vi /etc/environment
粘贴如果 java-6-openjdk-amd64

JAVA_HOME="/usr/lib/jvm/java-6-openjdk-amd64"

如果是 java-7-openjdk-amd6 则粘贴

JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" 保存

相关内容