How to setup High Availability for Ambari server?

目前,Ambari 项目本身并没有提供HA支持或方案,以下所描述的内容均来自于网上用户给出的实现及方案。
该特性可能会在 Ambari 2.4 或 2.5 版本得到支持, 这主要依赖于社区的开发路径和方向。

High availability for Ambari Server can be achieved by enabling a rapid failover mechanism (an active-passive setup)
through an external monitoring tool e.g. Upstart, Supervisor or some other Daemon tool.

Customers deploys two (2) Ambari servers configured exactly same having same Ambari property files.
One of the server is kept active while the other is stopped.

The responsibilities of the external monitoring service are:

  • Ensure there is only one active instance of Ambari Server
  • Monitor the active instance and if it’s down then make a decision to
    either bring the same instance back up or the replacement instance
  • Ensure that the agents are re-configured to communicate with the active Ambari Server instance

Requirements for HA

  • The Ambari DB must be an external DB instance (do not use embedded postgres)
  • Both Ambari Server instances must be configured similarly (options available via ambari-server setup command)
  • Appropriate load-balancer setup to route client requests to the active Ambari Server instance

At this point there is no plan to inherently support an active-passive deployment.
There are some work-items to make it easier to have an external logic enable failover
such as configuring Ambari Agents to take a list of hostnames for the servers and select the active one to auto-register.

Instead of using an external monitoring tool such as Upstart or Supervisor,
I would recommend using a cluster software solution.

In the past, I have used (not for Hadoop) with good success the Pacemaker software (Clusterlabs).
It not only detects some failure, but also automatically raises up the standby daemon,
can handle dependencies (first recovering the database, then the application), define some fencing,
do placement policies (avoiding having the database and the application on the same node for instance)…

Links: