Support Questions

Find answers, ask questions, and share your expertise

How to point an ambari-agent to 2 ambari-servers?

avatar

Hello,

I'm trying to ensure ambari-server failover. After research on this topic, i found these steps which are implemented by some users to fix this issue as described here:
1) Deploy 2 ambari-server with it database in 2 machine, say primary and backup;
2) Sync data from primary database to backup database(using postgresql streaming sync) when have data updated.
3) Use heartbeat between the 2 ambari-server to discover server_lost event, and make backup server to be primary; and the new backup server stop communicate with ambari-agent
4) Each agent have 2 ambari-server’s address configurations(or negotiate from zookeeper?), once primary server changed, agent should register to new one.
5) Backup web UI can redirect page to primary one. GET method REST API can access both ambari-server.

My questions are:

1- How to point an ambari-agent to 2 ambari-servers? Is it possible to mention multiple hostnames in /etc/ambari-agent/conf/ambari-agent.ini? How can i use Zookeeper to negotiate this?

2- What is the solution to use heartbeat between the 2 ambari-servers? Any suggestion?

Finally, my purpose is to ensure ambari-server failover.So, i's open to any different method that can be useful to reach my goal.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@raouia

Ambari Agent can currently point to Only One Ambari Server at a time. You can see the [server] section of agent file "/etc/ambari-agent/conf/ambari-agent.ini"

Example:

[server]
hostname=ambari1.hortonworks.com

.

Currently it is Manual: All the agents "/etc/ambari-agent/conf/ambari-agent.ini" file need to be manually updated to point to the Failover Ambari Server Hostname and then agents needs to be restarted so that based on the new entry for [server] Ambari Server new Host, the agents can communicate.

.

Although there are some improvement JIRA opened for the same (for future releases): https://issues.apache.org/jira/browse/AMBARI-17126

.

Regarding your queries:

1- How to point an ambari-agent to 2 ambari-servers?

>>>>> "/etc/ambari-agent/conf/ambari-agent.ini" file need to be manually updated to point to the Failover Ambari Server Hostname and then agents needs to be restarted.

2. Is it possible to mention multiple hostnames in /etc/ambari-agent/conf/ambari-agent.ini?

>>>>> No currently you can define only one ambari-server hostname in the ambari-agent.ini file.

3. How can i use Zookeeper to negotiate this?

>>>>> Currently it is not designed. Ambari Server does not use Zookeeper for communication with agents / other ambari servers.

4- What is the solution to use heartbeat between the 2 ambari-servers? Any suggestion?

>>>>>> Ambari Agents sends heartbeat messages to Ambari Server. But currently there is no feature available inside ambari server to send/advertise heartbeat messages to other ambari servers.

.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@raouia

Ambari Agent can currently point to Only One Ambari Server at a time. You can see the [server] section of agent file "/etc/ambari-agent/conf/ambari-agent.ini"

Example:

[server]
hostname=ambari1.hortonworks.com

.

Currently it is Manual: All the agents "/etc/ambari-agent/conf/ambari-agent.ini" file need to be manually updated to point to the Failover Ambari Server Hostname and then agents needs to be restarted so that based on the new entry for [server] Ambari Server new Host, the agents can communicate.

.

Although there are some improvement JIRA opened for the same (for future releases): https://issues.apache.org/jira/browse/AMBARI-17126

.

Regarding your queries:

1- How to point an ambari-agent to 2 ambari-servers?

>>>>> "/etc/ambari-agent/conf/ambari-agent.ini" file need to be manually updated to point to the Failover Ambari Server Hostname and then agents needs to be restarted.

2. Is it possible to mention multiple hostnames in /etc/ambari-agent/conf/ambari-agent.ini?

>>>>> No currently you can define only one ambari-server hostname in the ambari-agent.ini file.

3. How can i use Zookeeper to negotiate this?

>>>>> Currently it is not designed. Ambari Server does not use Zookeeper for communication with agents / other ambari servers.

4- What is the solution to use heartbeat between the 2 ambari-servers? Any suggestion?

>>>>>> Ambari Agents sends heartbeat messages to Ambari Server. But currently there is no feature available inside ambari server to send/advertise heartbeat messages to other ambari servers.

.