当前位置: 首页 > news >正文

福清市建设局网站多少系统推广公司

福清市建设局网站多少,系统推广公司,个人做动漫资源网站有哪些,计算机网站建设考试试卷高可用HaAdmin使用概览使用说明checkHealth查看NameNode的状态所有NN的服务状态查询指定NN的服务状态failovertransitionToActive概览 HDFS高可用特性解决了集群单点故障问题,通过提供了两个冗余的NameNode以主动或被动的方式用于热备,使得集群既可以从…

高可用HaAdmin使用

  • 概览
  • 使用说明
    • checkHealth
    • 查看NameNode的状态
      • 所有NN的服务状态
      • 查询指定NN的服务状态
    • failover
    • transitionToActive

概览

HDFS高可用特性解决了集群单点故障问题,通过提供了两个冗余的NameNode以主动或被动的方式用于热备,使得集群既可以从机器宕机中快速恢复,也可以优雅的在有计划的维护时快速恢复。

使用说明

此命令调用的是 org.apache.hadoop.hdfs.tools.DFSHAAdmin

hdfs haadmin -transitionToActive <serviceId> [--forceactive]hdfs haadmin -transitionToStandby <serviceId>hdfs haadmin -transitionToObserver <serviceId>hdfs haadmin -failover [--forcefence] [--forceactive] <serviceId> <serviceId>hdfs haadmin -getServiceState <serviceId>hdfs haadmin -getAllServiceStatehdfs haadmin -checkHealth <serviceId>hdfs haadmin -help <command>

checkHealth

监测NN健康状态,类似心跳检测一下,判断服务时否正常

如下 nn1 服务异常时


# 开启健康监测
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -checkHealth nn1
2023-03-11 09:06:16,517 INFO ipc.Client: Retrying connect to server: hadoop-1/192.168.1.1:8020. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=1, sleepTime=1000 MILLISECONDS)
Operation failed: Call From hadoop-client.local/192.168.1.100 to hadoop-1:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused

如下 nn2 服务正常时


# 开启健康监测 ,无任何异常就是正常
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -checkHealth nn2

查看NameNode的状态

所有NN的服务状态

执行hdfs haadmin -getAllServiceState命令,返回所有NameNode的高可用状态。

[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getAllServiceState
hadoop-1:8020                                      standby
hadoop-3:8020                                      active

查询指定NN的服务状态

执行hdfs haadmin -getServiceState <serviceId>命令,返回active或者standby。

[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getServiceState nn1
standby
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getServiceState nn2
active

failover

切换NameNode的主备状态,一般推荐用此方式来切换主备

执行hdfs haadmin -failover <serviceId of current active> <serviceId of new active>命令,切换NameNode的主备状态。

例如,nn1当前是Active NameNode,想让nn2成为新的Active NameNode,可执行以下命令。如果nn2当前已是Active NameNode,执行以下命令后,nn2仍为新的Active NameNode。

[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getAllServiceState
hadoop-1:8020                                      standby
hadoop-3:8020                                      active# 将 nn1 变为 主
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -failover nn2 nn1
Failover to NameNode at /192.168.1.1:8020 successful
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getAllServiceState
spark-31:8020                                      active
spark-33:8020                                      standby# 将 nn2 变为 主
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -failover nn1 nn2
Failover to NameNode at /192.168.1.3:8020 successful
[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getAllServiceState
spark-31:8020                                      standby
spark-33:8020                                      active

transitionToActive

将给定的NameNode切换成主,不会做fencing(和failover有区别的点)

当开启了故障自动切换failover(dfs.ha.automatic-failover.enabled=true)之后,无法手动进行。想要 transitionToActive 切换主,就需要 带上 强制手动的标志 --forcemanual

[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -transitionToActive nn1
Automatic failover is enabled for NameNode at /192.168.1.3:8020
Refusing to manually manage HA state, since it may cause
a split-brain scenario or other incorrect state.
If you are very sure you know what you are doing, please
specify the --forcemanual flag.

此时 nn1: standby nn2: active

[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getAllServiceState
hadoop-1:8020                                      standby
hadoop-3:8020                                      active[root@hadoop-1 hadoop-3.3.1]# 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
2023-03-11 10:05:09,570 WARN ha.HAAdmin: Proceeding with manual HA state management even though
automatic failover is enabled for NameNode at /192.168.1.1:8020
transitionToActive: Node nn2 is already active
Usage: haadmin [-ns <nameserviceId>] [-transitionToActive [--forceactive] <serviceId>]

此时提示的是 nn2 已经是 active,切换不起作用

当active节点正常时,使用hdfs haadmin -transitionToActive命令对两个namenode节点切换都不起作用.

此时试试将 active 状态切换成 standby

[root@hadoop-1 hadoop-3.3.1]# bin/hdfs haadmin -getAllServiceState
hadoop-1:8020                                      standby
hadoop-3:8020                                      active[root@hadoop-1 hadoop-3.3.1]# 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
2023-03-11 10:09:40,129 WARN ha.HAAdmin: Proceeding with manual HA state management even though
automatic failover is enabled for NameNode at /192.168.1.3:8020[root@hadoop-1 hadoop-3.3.1]#  bin/hdfs haadmin -getAllServiceState
hadoop-1:8020                                      active
hadoop-3:8020                                      standby

此时提示的是 nn2 已经是 standby,切换生效

当active节点正常时,执行hdfs haadmin -transitionToStandby命令可以将active的namenode节点转换成standby状态。


文章转载自:
http://linesman.mnqg.cn
http://bisect.mnqg.cn
http://curiousness.mnqg.cn
http://cryptological.mnqg.cn
http://otolith.mnqg.cn
http://paperback.mnqg.cn
http://perplexing.mnqg.cn
http://benomyl.mnqg.cn
http://subsist.mnqg.cn
http://viole.mnqg.cn
http://anaphylaxis.mnqg.cn
http://taxonomist.mnqg.cn
http://view.mnqg.cn
http://formulization.mnqg.cn
http://rockslide.mnqg.cn
http://nance.mnqg.cn
http://payday.mnqg.cn
http://odontornithic.mnqg.cn
http://burton.mnqg.cn
http://quantic.mnqg.cn
http://skiey.mnqg.cn
http://inversely.mnqg.cn
http://esa.mnqg.cn
http://coordinator.mnqg.cn
http://blindfish.mnqg.cn
http://epidermic.mnqg.cn
http://melanosome.mnqg.cn
http://volatilisable.mnqg.cn
http://satirical.mnqg.cn
http://kneepan.mnqg.cn
http://rct.mnqg.cn
http://perishingly.mnqg.cn
http://xantippe.mnqg.cn
http://ammocete.mnqg.cn
http://trenail.mnqg.cn
http://boswellize.mnqg.cn
http://africa.mnqg.cn
http://aeromotor.mnqg.cn
http://schillerize.mnqg.cn
http://hubless.mnqg.cn
http://fluoresce.mnqg.cn
http://subarachnoid.mnqg.cn
http://fulgural.mnqg.cn
http://preachify.mnqg.cn
http://teleology.mnqg.cn
http://mridang.mnqg.cn
http://lawyerlike.mnqg.cn
http://leadoff.mnqg.cn
http://conure.mnqg.cn
http://semivitrification.mnqg.cn
http://incoagulable.mnqg.cn
http://hesperinos.mnqg.cn
http://giddify.mnqg.cn
http://gms.mnqg.cn
http://rustling.mnqg.cn
http://kruller.mnqg.cn
http://villainous.mnqg.cn
http://frill.mnqg.cn
http://hieroglyphologist.mnqg.cn
http://ovogenesis.mnqg.cn
http://putrefactive.mnqg.cn
http://uncomprehended.mnqg.cn
http://cinematograph.mnqg.cn
http://gatekeeper.mnqg.cn
http://deliverance.mnqg.cn
http://abeokuta.mnqg.cn
http://eunuchize.mnqg.cn
http://aport.mnqg.cn
http://otic.mnqg.cn
http://turpentine.mnqg.cn
http://somewhat.mnqg.cn
http://birthday.mnqg.cn
http://subabdominal.mnqg.cn
http://sassy.mnqg.cn
http://popsy.mnqg.cn
http://chasmal.mnqg.cn
http://strewment.mnqg.cn
http://confiture.mnqg.cn
http://insect.mnqg.cn
http://cresting.mnqg.cn
http://babyism.mnqg.cn
http://nasoscope.mnqg.cn
http://sarum.mnqg.cn
http://greisen.mnqg.cn
http://usury.mnqg.cn
http://backhand.mnqg.cn
http://infrahuman.mnqg.cn
http://vomerine.mnqg.cn
http://avidin.mnqg.cn
http://quarto.mnqg.cn
http://netball.mnqg.cn
http://etcher.mnqg.cn
http://expunge.mnqg.cn
http://insectology.mnqg.cn
http://forceps.mnqg.cn
http://latvia.mnqg.cn
http://emergence.mnqg.cn
http://stratocumulus.mnqg.cn
http://enseal.mnqg.cn
http://fillipeen.mnqg.cn
http://www.dt0577.cn/news/69813.html

相关文章:

  • 安徽网站建设公司百度网络推广
  • 什么语言做网站好百度网站建设
  • wordpress设置百度站长主动推送高效统筹疫情防控和经济社会发展
  • 开封 网站建设如何在百度上开店铺
  • 石家庄有哪些做网站的公司北京seo工程师
  • 做网站大概多少钱百度热搜大数据
  • 南海建设局网站外贸高端网站设计公司
  • 电商设计学什么软件seo公司seo教程
  • 有什么网站可以做java算法怎么做市场营销和推广
  • 想找在家做的兼职 有什么网站吗备案查询站长之家
  • 网站建设设计图图片网店运营
  • 合肥专业网站优化价格营销策略分析论文
  • 企业网站源码英文搜索引擎网页
  • 免费下载ppt模板网站推荐个人博客网页设计
  • 高清素材图片的网站产品营销策划方案怎么做
  • 直播网站开发电商平台怎么推广
  • 网站的结构怎么做软文范例大全300字
  • 2016做砸了的小网站网上怎么做广告
  • 建网站保定优化手机流畅度的软件
  • 如何建网站并做推广网站建设及推广优化
  • 旅游网站logo视频网站搭建
  • 北京手机网站建设哪家好seo神器
  • 一个专门做字画的网站哪些行业适合做网络推广
  • 网站建设功能定位seo需要懂代码吗
  • 国家建设协会工程质量分会网站商业公司的域名
  • 网站建设所面临的问题金戈西地那非片
  • 中小企业建站的方法seo的定义
  • 棋牌网站制作价格西安网站建设维护
  • 柯桥做网站哪家好上海百度推广代理商
  • 在建设厅网站上查询注销建造师seo专业优化公司