Hadoop 安裝步驟: 0. 安裝前準備(節點機器,環境設置,yum源設置) 1. 配置並安裝Cloudera-Manager 2. 啓動 CM 服務 3. 安裝CDH,並配置集羣 4. 啓動
在啓動Yarn時, NodeManager 啓動失敗。接下來查看對應的日誌:Cloudera Manager 主頁,點擊YARN項操做,選擇「實例」,點擊角色類型,進入NodeManager 主頁,在日誌文件下拉框有stdout,stderr,角色日誌文件,建議查看角色日誌文件。html
下面是角色日誌文件的輸出內容java
Error starting NodeManager
org.apache.hadoop.service.ServiceStateException: org.fusesource.leveldbjni.internal.NativeDB$DBException: IO error: /var/lib/hadoop-yarn/yarn-nm-recovery/yarn-nm-state/LOCK: Permission denied
at org.apache.hadoop.service.ServiceStateException.convert(ServiceStateException.java:59)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:172)
at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartRecoveryStore(NodeManager.java:181)
at org.apache.hadoop.yarn.server.nodemanager.NodeManager.serviceInit(NodeManager.java:245)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
at org.apache.hadoop.yarn.server.nodemanager.NodeManager.initAndStartNodeManager(NodeManager.java:562)
at org.apache.hadoop.yarn.server.nodemanager.NodeManager.main(NodeManager.java:609)
Caused by: org.fusesource.leveldbjni.internal.NativeDB$DBException: IO error: /var/lib/hadoop-yarn/yarn-nm-recovery/yarn-nm-state/LOCK: Permission denied
at org.fusesource.leveldbjni.internal.NativeDB.checkStatus(NativeDB.java:200)
at org.fusesource.leveldbjni.internal.NativeDB.open(NativeDB.java:218)
at org.fusesource.leveldbjni.JniDBFactory.open(JniDBFactory.java:168)
at org.apache.hadoop.yarn.server.nodemanager.recovery.NMLeveldbStateStoreService.openDatabase(NMLeveldbStateStoreService.java:944)
at org.apache.hadoop.yarn.server.nodemanager.recovery.NMLeveldbStateStoreService.initStorage(NMLeveldbStateStoreService.java:931)
at org.apache.hadoop.yarn.server.nodemanager.recovery.NMStateStoreService.serviceInit(NMStateStoreService.java:204)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
... 5 more
經過網絡查看不僅人遇到過這樣的問題node
login the related node server, check the permission and ownership of those directories /var/lib/hadoop-*, I got the following infoapache
[root@elephant lib]# ls -l | grep -i hadoop d---------. 2 root root 6 Nov 25 05:27 hadoop-hdfs d---------. 2 root root 6 Nov 25 05:27 hadoop-httpfs d---------. 2 root root 6 Nov 25 05:27 hadoop-kms d---------. 2 root root 6 Nov 25 05:27 hadoop-mapreduce d---------. 3 root root 29 Nov 25 06:44 hadoop-yarn
they are not right. so we need to do the following steps to fix itbash
chown -R hdfs:hdfs /var/lib/hadoop-hdfs chown -R httpfs.httpfs /var/lib/hadoop-httpfs chown -R kms.kms /var/lib/hadoop-kms chown -R mapred:mapred /var/lib/hadoop-mapreduce chown -R yarn:yarn /var/lib/hadoop-yarn chmod -R 755 /var/lib/hadoop-*
then try to start the node manager, it succeed.網絡
Cheers!!!oop