设为首页 加入收藏

TOP

HDFS查看异常:Operation category READ is not supported in state standby. Visit
2018-11-22 16:21:40 】 浏览:779
Tags:HDFS 查看 异常 Operation category READ not supported state standby. Visit
版权声明:原创文章,欢迎转载,转载请注明出处 https://blog.csdn.net/zhangshenghang/article/details/82840602

跨集群访问hdfs失败

$ hdfs dfs -ls hdfs://test:8020/hbase
ls: Operation category READ is not supported in state standby. Visit https://s.apache.org/sbnn-error

意思是namenode不可用,查看namenode状态

hdfs-site.xml
  <property>
    <name>dfs.ha.namenodes.nameservice1</name>
    <value>namenode223,namenode47</value>
  </property>

使用命令查看namenode状态,发现主NameNode是在运行的。

$hdfs haadmin -getServiceState namenode223                        
active

此时如果查看namenode是standby模式可以使用以下命令前置切换主备

hdfs haadmin -transitionToActive --forcemanual namenode47

找了半天才发现test:8020是之前的namenode,后来NameNode被我迁移了,换成test2:8020,ok。

总结几个命令,日常维护时使用:

#切换NameNode(强制切换主备),前提是目前在用的NameNode是standby状态,否则失败
hdfs haadmin -transitionToActive --forcemanual namenode47

#查看NameNode运行状态
hdfs haadmin -getServiceState namenode223              

更多查看
$ hdfs haadmin -help
Usage: DFSHAAdmin [-ns <nameserviceId>]
    [-transitionToActive <serviceId> [--forceactive]]
    [-transitionToStandby <serviceId>]
    [-failover [--forcefence] [--forceactive] <serviceId> <serviceId>]
    [-getServiceState <serviceId>]
    [-checkHealth <serviceId>]
    [-help <command>]

Generic options supported are
-conf <configuration file>     specify an application configuration file
-D <property=value>            use value for given property
-fs <local|namenode:port>      specify a namenode
-jt <local|resourcemanager:port>    specify a ResourceManager
-files <comma separated list of files>    specify comma separated files to be copied to the map reduce cluster
-libjars <comma separated list of jars>    specify comma separated jar files to include in the classpath.
-archives <comma separated list of archives>    specify comma separated archives to be unarchived on the compute machines.

The general command line syntax is
bin/hadoop command [genericOptions] [commandOptions]

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇eclipse中连接不上hdfs,显示refu.. 下一篇java实现对HDFS增删改查(CRUD)..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目