又是码字的一天,今天在做Hadoop项目的时候发现了这样的一个问题,问题如下图所示。
这个Operation category READ is not supported in state standby中文翻译为在待机状态下不支持读取操作类别,原因就是你的Hadoop长时间没有运行,虚拟机息屏会自动将Hadoop切换为待机状态,原理和window系统的待机是同样的原理。所以只需要将虚拟机的Hadoop中的ServicesState的nn1由原来的standby模式切换为active模式,将nn2中的active模式切换为standby模式就可以了。
bin/hdfs haadmin -getServiceState nn1
待机状态下nn1显示为standby
bin/hdfs haadmin -getServiceState nn2
待机状态下nn2显示为active
通过如下命令将nn1、nn2进行切换就可以了
bin//hdfs haadmin -transitionToActive --forcemanual nn1
You have specified the --forcemanual flag. This flag is dangerous, as it can induce a split-brain scenari