Operation category READ is not supported in state standby 故障解决

在执行 hive 命令时,报错信息如下

Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category READ is not supported in state standby

初步判断是由于HA节点中处于standby状态造成的异常

执行

$./hdfs haadmin -getServiceState namenode1                                                                                                                                                                
standby                                                               
$./hdfs haadmin -getServiceState namenode2
standby   

两个互为HA的namenode节点均处于standby 状态,随后执行

$/hdfs haadmin -transitionToActive --forcemanual namenode1 

强行手工将namenode1状态转换为active

执行 hive,工作正常,故障解决