Hadoop中Namenode的HA查询和切换

三台小型hadoop集群,上星期公司机房停电了,这次上去start了集群,但是发现start之后无法工作了。

查看了jps发现该有的进程都有了,敲入 hadoop fs -ls /

报错内容如下:

org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category READ is not supported in state standby

然后用命令查看namenode的状态(两台namenode,主机名为ut07,ut08)

hdfs haadmin -getServiceState ut07

显示结果为:standby,同样查看ut08也是显示standby

所以当前集群中,两台namenode都处于standby,不支持操作。

使用如下命令,将ut07强制切为active

hdfs haadmin -transitionToActive --forcemanual ut07

再次查看ut07的状态,发现已经更改为active了

猜你喜欢

转载自blog.csdn.net/yangbosos/article/details/88706721
今日推荐