Ambari配置namenode HA

  • ​ NameNode High Availability配置
  1. Ambari ui, 选择Services > HDFS > Summary.
  2. 点击 Service Actions, 点击 Enable NameNode HA.
  3.  Get Started 页面中, 输入一个 Nameservice ID然后点 Next.

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/getstartedHA_2x.png

  • HA配置完后,就不用NameNode全域名而是用Nameservice ID
  •  Select Hosts 页面,选择一个主机作为额外的NameNode,和几个主机作为JournalNodes,然后点击Next

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/selecthostha_2x.png

  • Review 页面,确定你选择的主机然后点击Next:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/reviewha_2x.png

  •  Next: Manual Steps Required: Create Checkpoint on NameNode 页面,根据提示登录指定机器按顺序手动执行命令:

sudo su –l hdfs –c ‘hdfs dfsadmin –safemode enter’ 

sudo su –l hdfs –c ‘hdfs dfsadmin –saveNamespace’然后点击Next

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/checkpointsHA_2x.png

  • Configure Components页面,等所有步骤完成后,点击Next

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/configurecomponentsHA_2x.png

  •  Manual Steps Required: Initialize JournalNodes 页面 根据提示登录指定机器上执行命令:sudo su –l hdfs –c ‘hdfs namenode -initializeSharedEdits’ Next:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/initializejournalnodesHA_2x.png

  • 以上步骤完成后点击Next.
  • Start Components 页面, 等所有步骤完成后点击Next:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/startcomponentsHA_2x.png

  • Manual Steps Required: Initialize NameNode HA Metadata页面 : 去指定机器执行页面上的命令,然后点击 Next.

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/initializemetadataHA_2x.png

完成后 OK 确定

  •  Finalize HA Setup 页面, 等所有步骤执行完之后点击 Done完成配置.

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-operations/content/figures/5/figures/finalizeHA_2x.png