Exception while invoking getStats of class ClientNamenodeProtocolTranslatorPB over 故障分析

来源:互联网 发布:闹钟软件哪个好 编辑:程序博客网 时间:2024/05/23 10:43

在执行 hdfs dfsadmin -report 命令时,出现故障Exception while invoking getStats of class ClientNamenodeProtocolTranslatorPB over ,在查阅log记录时发现

java.net.SocketTimeoutException: Call From clusternode***to clusternode***9000 failed on socket timeout exception: java.net.SocketTim
eoutException: 20000 millis timeout while waiting for channel to be ready for read. ch : java.nio.channels.SocketChannel[connected local=/***
:40878 remote=clusternode***9000]; For more details see:  http://wiki.apache.org/hadoop/SocketTimeout

显然是namenode出现了问题,

分别在两台互为HA、运行namenode进程的设备上运行

./bin/hdfs haadmin -getServiceState nn1

./bin/hdfs haadmin -getServiceState nn1

显示的状态均为standby,找到了产生错误的原因,解决就方便了,执行

haadmin -transitionToActive --forcemanual nn1

强行指定其中一个namenode节点的状态为Active,问题解决,执行hdfs dfsadmin -report可以正常报告节点状态,但是这是什么原因的造成的呢?

分析下来,应该是重启hadoop集群时,直接运行start-all.sh造成,重启集群时应该要根据配置文件hdfs-site.xml和yarn-site.site,尤其是hdfs-site.xml,根据该文件的配置,需要在配置文件中指明节点上先行执行 hadoop-daemon.sh start journalnode,启动JournalNode,然后在namenode节点上启动NameNode,这样就不会出现上面的问题了

阅读全文
0 0