# Elastic Load Balancer as Target Host

**URL:** <https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [April 11, 2019, 6:27am UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328 "2019-04-11T06:27:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocksnslopes](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@rocksnslopes](https://discuss.elastic.co/u/rocksnslopes)\
**Post date:** [April 11, 2019, 6:27am UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/1 "2019-04-11T06:27:54Z")

</div>

Hi -

I have various scenarios I would like to benchmark using different instance classes with varying node counts. It would be rather cumbersome to specify each node's IP address in the target-hosts param. I instead would like to specify the load balancer IP. I attempted to do this, but received:

[ERROR] Cannot race. Error in race control (ConnectionError(\<urllib3.connection.HTTPConnection object at 0x7f4a9247a080\>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(\<urllib3.connection.HTTPConnection object at 0x7f4a9247a080\>: Failed to establish a new connection: [Errno 111] Connection refused))

Is it possible to configure either rally or load balancer to accomplish this? Of course I'm also using --pipeline=benchmark-only

If I'm forced to specify the individual node IPs, is there a limit to the parameter string length?

Thank you!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 11, 2019, 7:10am UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/2 "2019-04-11T07:10:20Z")

</div>

If the load balancer is correctly configured it should work fine. Can you share some additional details?

---

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [April 11, 2019, 7:14am UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/3 "2019-04-11T07:14:30Z")

</div>

Hello,

> [@rocksnslopes](#):
>
> It would be rather cumbersome to specify each node's IP address in the target-hosts param.

`--target-hosts` can also reference a json file, see [the docs here](https://esrally.readthedocs.io/en/stable/command_line_reference.html?highlight=target-hosts#id1) and you can maintain this easily. For just one cluster you only need to specify the "default" key e.g.:

```auto
{
  "default": ["127.0.0.1:39201"]
}

```

There should be no problem with limits to the array.

re: testing behind a load balancer: as @Christian_Dahlqvist said, are you sure your load balancer works correctly? This [discuss topic](https://discuss.elastic.co/t/any-limitations-with-distributed-load-drivers/107939/6) may also be useful to read.

Dimitris

---

<div class="post-metadata">

**Author:** ![rocksnslopes](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@rocksnslopes](https://discuss.elastic.co/u/rocksnslopes)\
**Post date:** [April 11, 2019, 7:51am UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/4 "2019-04-11T07:51:34Z")

</div>

Hi, thanks for the responses. I will read through the topic @dliappis, also good to know about the json option. As far as more information, it is a stack setup by a previous team which I assume is working, since it is being used. From the looks of it, the security group allows for all internal ip's and ports 80 and 9200 are open, this particular one is managing about 10 data nodes.

|Load Balancer Protocol = HTTP|Load Balancer Port = 80 |Instance Protocol = HTTP|Instance Port = 9200|Cipher = N/A |SSL Certificate = N/A|

Please let me know what other information may be useful. I also tried hitting port 80 instead of 9200, got the same results. I have no problems when hitting the individual data nodes, just the load balancer, so I'm assuming there's a configuration issue somewhere on the load balancer.

Additionally, verified I am able to perform basic curl statements to both the nodes as well as the load balancer.

---

<div class="post-metadata">

**Author:** ![rocksnslopes](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@rocksnslopes](https://discuss.elastic.co/u/rocksnslopes)\
**Post date:** [April 11, 2019, 5:20pm UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/5 "2019-04-11T17:20:08Z")

</div>

Figured it out, needed to add a TCP listener protocol to the load balancer for rally.

---

<div class="post-metadata">

**Author:** ![rocksnslopes](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@rocksnslopes](https://discuss.elastic.co/u/rocksnslopes)\
**Post date:** [April 12, 2019, 4:27pm UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/6 "2019-04-12T16:27:59Z")

</div>

Is there a way to have rally benchmark over HTTP instead of TCP? Would like to mimic our current application protocol and see HTTP code metrics on the EC2 side.

---

<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:** [May 10, 2019, 4:28pm UTC](https://discuss.elastic.co/t/elastic-load-balancer-as-target-host/176328/7 "2019-05-10T16:28:02Z")

</div>

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