Operation category READ is not supported in state standby(在做Hadoop大作业的时候遇到的问题)学习笔记(1)

        又是码字的一天,今天在做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 scenario that WILL CORRUPT your HDFS namespace, possibly irrecoverably.

It is recommended not to use this flag, but instead to shut down the cluster and disable automatic failover if you prefer to manually manage your HA state.

You may abort safely by answering 'n' or hitting ^C now.

Are you sure you want to continue? (Y or N) 

输入y

21/12/05 19:03:15 WARN ha.HAAdmin: Proceeding with manual HA state management even though automatic failover is enabled for NameNode at hadoop02/192.168.121.135:9000
transitionToActive: Node nn1 is already active.此时nn1就切换为active。

bin/hdfs haadmin -transitionToStandby --forcemanual nn2

You have specified the --forcemanual flag. This flag is dangerous, as it can induce a split-brain scenario that WILL CORRUPT your HDFS namespace, possibly irrecoverably.

It is recommended not to use this flag, but instead to shut down the cluster and disable automatic failover if you prefer to manually manage your HA state.

You may abort safely by answering 'n' or hitting ^C now.

Are you sure you want to continue? (Y or N)

同样也是y

21/12/05 19:03:52 WARN ha.HAAdmin: Proceeding with manual HA state management even though
automatic failover is enabled for NameNode at hadoop02/192.168.121.135:9000

这样就完成了!!!!

这次的学习笔记分享就到这里了,下期再见!

 

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值