記錄:hadoop 2.5.2 叢集動態增加新datanode 無法通訊的問題

denglt發表於2014-12-03

1、拷貝NameNode上的hadoop home 目錄到新的datanode(包括配置檔案等)。

2、啟動新的datanode

      hadoop-daemon.sh start datanode

datanode 與 namenode通訊成功,成功建立資料目錄。

[hadoop@laodeng2 current]$ ls -l
total 8
drwx------ 4 hadoop hadoop 4096 Dec  2 20:07 BP-1446562160-127.0.0.1-1417496109738
-rw-rw-r-- 1 hadoop hadoop  229 Dec  2 20:02 VERSION

[hadoop@laodeng2 current]$ more VERSION
#Tue Dec 02 20:02:39 CST 2014
storageID=DS-bc5ecbbd-0542-41f6-a273-854d44f537c0
clusterID=CID-118021aa-dc88-4fa3-81db-f203b3502726
cTime=0
datanodeUuid=91493e2e-8525-4971-bd06-3248dc3b8787
storageType=DATA_NODE
layoutVersion=-55


但是在namenode上使用hdfs dfsadmin -report 看不到新增加的datanode。

檢視datanode日誌:

2014-12-02 18:48:42,046 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool BP-1446562160-127.0.0.1-1417496109738 (Data
node Uuid null) service to /172.16.110.133:9000 beginning handshake with NN
2014-12-02 18:48:42,123 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool BP-1446562160-12
7.0.0.1-1417496109738 (Datanode Uuid null) service to /172.16.110.133:9000 Datanode denied communication with namenode because hostn
ame cannot be resolved (ip=172.16.110.132, hostname=172.16.110.132): DatanodeRegistration(0.0.0.0, datanodeUuid=91493e2e-8525-4971-b
d06-3248dc3b8787, infoPort=50075, ipcPort=50020, storageInfo=lv=-55;cid=CID-118021aa-dc88-4fa3-81db-f203b3502726;nsid=1575155189;c=0
)
        at org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager.registerDatanode(DatanodeManager.java:874)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.registerDatanode(FSNamesystem.java:4514)
        at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.registerDatanode(NameNodeRpcServer.java:1017)
        at org.apache.hadoop.hdfs.protocolPB.DatanodeProtocolServerSideTranslatorPB.registerDatanode(DatanodeProtocolServerSideTrans
latorPB.java:92)
        at org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos$DatanodeProtocolService$2.callBlockingMethod(DatanodeProtoco
lProtos.java:28057)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:585)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:928)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2013)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2009)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2007)


dns解析問題:

修改namenode上的/etc/hosts檔案,加上新datanode的ip配置,問題解決。

疑問:datanode已經連線上namenode,並生成了資料目錄,獲取到了clusterID。namenode與datanode通訊成功,為什麼還要配置hosts呢?


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/195110/viewspace-1354684/,如需轉載,請註明出處,否則將追究法律責任。

相關文章