Ambari High Availability Setup

This document outlines the process for configuring high availability (HA) for Ambari Server using an active-passive setup. It also includes instructions for optional load balancing of agents with HAProxy.

Prerequisites

  1. Two identically configured Ambari server instances.
  2. A shared external database for both Ambari server instances.
  3. A load balancer (such as HAProxy).

Steps to Setup

Perform the following steps:

1. Set Up Ambari Servers

  • Deploy two Ambari server instances.
  • Ensure both instances have identical configurations, including Ambari property files.
  • Connect both servers to an external database to maintain consistency.
  • Use ambari-server setup command to configure both instances in the same manner.

2. Install and Configure HAProxy

  • If HAProxy is not installed, use sudo yum install haproxy -y.
  • Modify the HAProxy configuration file at /etc/haproxy/haproxy.cfg.
  • Replace existing frontend and backend settings with:
SQL
Copy

In this configuration:

  • ambari_server1 is the primary server.
  • ambari_server2 serves as the backup, receiving traffic only if ambari_server1 is down.
  • The backup designation indicates ambari_server2 is a passive server.

3. Restart HAProxy

Apply the new settings by restarting HAProxy:

Bash
Copy

4. Optional: Configure HAProxy Logging

  • Set up logging by installing rsyslog and configuring logging for HAProxy:
Bash
Copy
  • Check the logs at /var/log/haproxy.log to confirm proper logging.

5. Update Ambari Agent Configuration

  • Direct Ambari agents to connect to the active server using the provided script:
Bash
Copy

Note If Ambari Server is unavailable, use the script to redirect agents to the operational server.

Conclusion

Following these steps ensures the successful implementation of high availability for the Ambari Server with HAProxy, enhancing both availability and reliability of your managed cluster.

Known Limitations

  1. Heartbeat Lost After Failover: If the first Ambari Server goes down, HAProxy will redirect the request to the second Ambari Server, but you may observe "Heartbeat Lost" in the Ambari UI. Use 5. Update Ambari Agent Configuration (Step 5) to address any heartbeat issues post-failover.
  2. Access Denied for Database User: Modify database permissions to allow access from the HA host if you see the following error:

Caused by: java.sql.SQLException: Access denied``for``user 'ambari'@'ambari-ha.adsre.com' (using password: YES)

Solution:

grant all privileges on *.* to 'ambari'@'ambari-ha.adsre.com' indentified by 'bigdata' with grant option ;

  1. No Database Selected: Verify that server.jdbc.url in ambari.properties specifies the correct database name, if you see the following error:

Caused by: java.sql.SQLException: No database selected

Solution:

server.jdbc.url=jdbc:mysql://<database-hostname>:3306/ambari

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated