# Has anyone implemented APM Server in high availability?

**URL:** <https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894>\
**Category:** APM\
**Tags:** server\
**Created:** [July 28, 2020, 11:29am UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894 "2020-07-28T11:29:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhun4m](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jhun4m](https://discuss.elastic.co/u/jhun4m)\
**Post date:** [July 28, 2020, 11:29am UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/1 "2020-07-28T11:29:24Z")

</div>

The idea is to deploy 2 APM server(Primary and secondary), one Elastic cluster for output, and the agents will send the events to one of those APM server.

Not sure if i need to put a proxy/load balancer and where?. (traffic from agents or traffic to elastic cluster).

As the APM Agents config file, can be configured to a list of APM Server.

indices on elastic cluster will be duplicated as there are 2 APM Server?

I'm having this doubt as there is a lack of documentation for deploying High Availability.

Any Idea?

Thank you !!!.

---

<div class="post-metadata">

**Author:** ![Peter\_Steenbergen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_steenbergen/32/22888_2.png) [@Peter\_Steenbergen](https://discuss.elastic.co/u/Peter_Steenbergen)\
**Post date:** [July 28, 2020, 11:44am UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/2 "2020-07-28T11:44:10Z")

</div>

In the documentation I have read somewhere that setting up HA for APM server is to setup multiple APM servers and put a load-balancer in front of those.

You could ping the active APM port to see if the node is active as a check to keep that node active behind your load-balancer.

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [July 28, 2020, 12:02pm UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/3 "2020-07-28T12:02:35Z")

</div>

> In the documentation I have read somewhere that setting up HA for APM server is to setup multiple APM servers and put a load-balancer in front of those.

Perhaps here: [High Availability | APM User Guide [8.11] | Elastic](https://www.elastic.co/guide/en/apm/server/current/high-availability.html) 🙂

@jhun4m welcome to the forum. As Peter says, you can use a regular load balancer in front of multiple APM Servers. Agents can also be configured with a list of servers, and they will failover in case a server becomes inaccessible or unresponsive. The latter approach will not load-balance data over the multiple servers, so it depends on whether you really want active-passive or active-active HA.

> Has anyone implemented APM Server in high availability?

Yes, the APM Server that comes as part of [Elasticsearch Service](https://cloud.elastic.co) will be run in an HA mode when you configure multiple availability zones, and/or multiple instances.

> indices on elastic cluster will be duplicated as there are 2 APM Server?

Not as long as you use the default index template configuration in apm-server.yml, and have the same versions of apm-server. (By default the index pattern includes the server version.)

---

<div class="post-metadata">

**Author:** ![jhun4m](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jhun4m](https://discuss.elastic.co/u/jhun4m)\
**Post date:** [July 28, 2020, 12:30pm UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/4 "2020-07-28T12:30:45Z")

</div>

Thanks for your reply, I'll take a look at it.

---

<div class="post-metadata">

**Author:** ![jhun4m](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jhun4m](https://discuss.elastic.co/u/jhun4m)\
**Post date:** [July 28, 2020, 12:53pm UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/5 "2020-07-28T12:53:16Z")

</div>

Thank you for your reply,

I was thinking in a Active-passive HA, for this to work it is necessary to put a load balancer, no option like creating a elasticsearch cluster that can assign a role for each instance.

> [@axw](#):
>
> Not as long as you use the default index template configuration in apm-server.yml, and have the same versions of apm-server. (By default the index pattern includes the server version.)

Using a custom index that is defined in apm-server.yml, e.g. "custom-index-%{[observer.version]}"?

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [July 29, 2020, 1:03am UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/6 "2020-07-29T01:03:23Z")

</div>

> [@jhun4m](#):
>
> Using a custom index that is defined in apm-server.yml, e.g. "custom-index-%{[observer.version]}"?

That would be fine. I meant that if you changed it to something that varied across the servers, then it would create separate indices. If each server has the exact same configuration, you would not end up with duplicated indices.

---

<div class="post-metadata">

**Author:** ![jhun4m](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jhun4m](https://discuss.elastic.co/u/jhun4m)\
**Post date:** [July 29, 2020, 11:45am UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/7 "2020-07-29T11:45:32Z")

</div>

Thank you, i'll try it on lab.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 19, 2020, 7:45am UTC](https://discuss.elastic.co/t/has-anyone-implemented-apm-server-in-high-availability/242894/8 "2020-08-19T07:45:36Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
