# Internal LB for HA rancher server

**URL:** <https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306>\
**Category:** Rancher 1.x\
**Created:** [September 11, 2017, 6:43am UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306 "2017-09-11T06:43:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parth6288](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/parth6288/32/2822_2.png) [@Parth6288](https://forums.suse.com/u/Parth6288)\
**Post date:** [September 11, 2017, 6:43am UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306/1 "2017-09-11T06:43:09Z")

</div>

I am setting up a 2 node HA rancher server following the documents at [http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/#multi-nodes.The](http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/#multi-nodes.The) doc mentions using an external LB however i want to set up an internal LB in the datacenter, How can this be accomplished? Will HAproxy work for this?

Thanks.

---

<div class="post-metadata">

**Author:** ![michael-x](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/michael-x/32/4973_2.png) [@michael-x](https://forums.suse.com/u/michael-x)\
**Post date:** [September 11, 2017, 7:53am UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306/2 "2017-09-11T07:53:40Z")

</div>

External here more likely refers to the fact that you should not use a proxy managed within the rancher environment, like the internal HA proxy service that you can configure for your applications (see [Adding a Load Balancer](http://rancher.com/docs/rancher/v1.6/en/cattle/adding-load-balancers/#adding-a-load-balancer-in-the-ui)). If your load balancer was offline it would be difficult getting it online again, if you can’t get to rancher, because the load balancer is offline.

Any decent load balancer managed outside of your rancher environment should be fine.

---

<div class="post-metadata">

**Author:** ![Parth6288](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/parth6288/32/2822_2.png) [@Parth6288](https://forums.suse.com/u/Parth6288)\
**Post date:** [September 11, 2017, 1:53pm UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306/3 "2017-09-11T13:53:58Z")

</div>

Thanks, @michael-x. I tried creating a LB using haproxy. However i am unable to access the rancher server using the LB ip. attached is the haconfig file and the rancher server setup command.  
Haproxy file : [global maxconn 4096 ssl-server-verify nonedefaults mode tcp bala - Pastebin.com](https://pastebin.com/uZ82g5XA)  
docker command to set up haproxy :

> docker run -d --name haproxy\_new -v /root/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro -v /root/rancher.pem:/etc/haproxy/certificate.pem:ro haproxy:1.7

docker command to set up Rancher server:

> docker run -d --restart=unless-stopped -p 443:8080 -p 9345:9345 rancher/server:latest --db-host db\_name --db-port 3306 --db-user cattle --db-pass password --db-name cattle --advertise-address 10.5.52.189 --advertise-http-port 443

The servers are created successfully in the cluster and also able to access using individual ip, however unable to access it using LB ip.  
2017-09-11 13:29:08,944 INFO [pool-3-thread-1] [ConsoleStatus] Cluster membership changed [rancherserver1:9345, rancherserver2:9345]

 ![rancherserver](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/0/0a3abf597f5406de8bf6800a340709a3791138b9.PNG)

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [September 11, 2017, 3:36pm UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306/4 "2017-09-11T15:36:56Z")

</div>

The backends shouldn’t have `ssl`. You’re telling HAProxy to open a SSL connection to the plain http 8080 port (and remapping that to 443, which is OK but confusing).

---

<div class="post-metadata">

**Author:** ![Parth6288](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/parth6288/32/2822_2.png) [@Parth6288](https://forums.suse.com/u/Parth6288)\
**Post date:** [September 12, 2017, 4:48am UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306/5 "2017-09-12T04:48:29Z")

</div>

@vincent I removed the ssl from backend servers and made it to listen to port 80 exposing it to 8080 in the backend. Still no go.

haproxy : [global maxconn 4096 ssl-server-verify nonedefaults mode tcp bala - Pastebin.com](https://pastebin.com/7HDRsyWa)

docker command :

> docker run -d --restart=unless-stopped -p 8080:8080 -p 9345:9345 rancher/server:latest --db-host 10.5.52.172 --db-port 3306 --db-user cattle --db-pass password --db-name cattle --advertise-address 10.5.52.189

HaProxy logs:

> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES  
> 777804f7eb42 haproxy:1.7 “/docker-entrypoint.s” 3 seconds ago Up 2 seconds 0.0.0.0:8080-\>80/tcp haproxy\_new  
> root@haproxy:~# docker logs -f 777804f7eb42  
> \<7\>haproxy-systemd-wrapper: executing /usr/local/sbin/haproxy -p /run/haproxy.pid -f /usr/local/etc/haproxy/haproxy.cfg -Ds  
> [WARNING] 254/044500 (6) : config : ‘option forwardfor’ ignored for frontend ‘http-in’ as it requires HTTP mode.  
> [WARNING] 254/044500 (6) : config : ‘option forwardfor’ ignored for backend ‘rancher\_servers’ as it requires HTTP mode.

---

<div class="post-metadata">

**Author:** ![Parth6288](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/parth6288/32/2822_2.png) [@Parth6288](https://forums.suse.com/u/Parth6288)\
**Post date:** [September 12, 2017, 7:48am UTC](https://forums.suse.com/t/internal-lb-for-ha-rancher-server/7306/6 "2017-09-12T07:48:14Z")

</div>

I was able to get it working with above mentioned configuration. Thanks.
