報錯信息如下
2017-12-20 12:29:09,161 INFO [main]: retry.RetryInvocationHandler (RetryInvocationHandler.java:invoke(140))
- Exception while invoking getFileInfo of class ClientNamenodeProtocolTranslatorPB over bdata236/192.168.1.236:9000
after 3 fail over attempts. Trying to fail over after sleeping for 5584ms. org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category READ is not supported in state standby at org.apache.hadoop.hdfs.server.namenode.ha.StandbyState.checkOperation(StandbyState.java:87) at org.apache.hadoop.hdfs.server.namenode.NameNode$NameNodeHAContext.checkOperation(NameNode.java:1719)
- 我出現這個問題的原因是兩個namenode都是standby狀態,發現是因為zkfc沒有起來,啟動zkfc就OK了。
進入hadoop/bin目錄下
./hadoop-daemon.sh start zkfc
- 還有可能是因為防火牆問題,關閉即可
service iptables stop (centos6)
systemctl stop firewalld(centos7)