环境:
ambari2.7.2,Hadoop3.1,hive3.0
配置过程
主要参考:http://www.louisvv.com/archives/1490.html 没什么难度,按照提示做基本没什么问题,数据也不会丢失。
注意:配置过程需要仔细看每一个步骤的提示,不同的命令是在不同的机器上执行的
配置之后需要配套操作
- 之前使用的配置文件都要同样替换,如hdfs-site.xml、yarn-site.xml、core-site.xml、mapre-site.xml。
- 之前读取hdfs如果写了hdfs://bigdata:8020/这种路径的话,需要改为hdfs://nameservice1/
- hivemetaStore中已经存在的表会记录hdfs路径,也需要按照步骤2中修改。
update serde_params set PARAM_VALUE=REPLACE(PARAM_VALUE,'hdfs://bigdata1:8020/','hdfs://nameservice1/') where PARAM_KEY = 'path'
注意: 执行任何sql之前一定先备份备份!!!!切记!!
否则都会出现如下错误,错误也很好理解,说不能从standby节点读取数据:
Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.ipc.StandbyException): Operation category READ is not supported in state standby. Visit https://s.apache.org/sbnn-error
at org.apache.hadoop.hdfs.server.namenode.ha.StandbyState.checkOperation(StandbyState.java:88)
at org.apache.hadoop.hdfs.server.namenode.NameNode$NameNodeHAContext.checkOperation(NameNode.java:1951)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkOperation(FSNamesystem.java:1427)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getListing(FSNamesystem.java:3781)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getListing(NameNodeRpcServer.java:1141)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getListing(ClientNamenodeProtocolServerSideTranslatorPB.java:719)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:524)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1025)
at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:876)
at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:822)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2682)
本文固定链接:杨晨辉的个人博客 » 配置hadoop集群Namenode HA后续操作。
本站内容除特别标注外均为原创,欢迎转载,但请保留出处!