# Loadbalancing external mysql cluster nodes

**URL:** <https://forums.suse.com/t/loadbalancing-external-mysql-cluster-nodes/5880>\
**Category:** Rancher 1.x\
**Created:** [March 18, 2017, 6:32pm UTC](https://forums.suse.com/t/loadbalancing-external-mysql-cluster-nodes/5880 "2017-03-18T18:32:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frintrop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/frintrop/32/1119_2.png) [@frintrop](https://forums.suse.com/u/frintrop)\
**Post date:** [March 18, 2017, 6:32pm UTC](https://forums.suse.com/t/loadbalancing-external-mysql-cluster-nodes/5880/1 "2017-03-18T18:32:35Z")

</div>

Hi, i have a “design” question.  
We have an external mysql cluster with x-nodes. I have configured one external-service in a stack with all ips of the nodes. also i configured service check ( http ) for all nodes. ( this service checks are working correct for each node)

As i want to exchange our hardware loadbalancer cluster as point of failure, i have added a rancher loadbalancer to the stack linked with the external-service mentioned above as only source destination.

a) does loadbalancing over external service works correctly, if all ips configured in on external service ?  
b) for testing i have stopped all mysql nodes, but i don´t see in rancher any warning ? must be the stack shown unhealthy ?

my stack config:

```
version: '2'
services:
  lb-mysql-cluster-2:
    image: rancher/lb-service-haproxy:v0.6.2
    ports:
    - 3307:3307/tcp
    labels:
      io.rancher.container.agent.role: environmentAdmin
      io.rancher.container.create_agent: 'true'
      io.rancher.scheduler.global: 'true'
  lb-mysql-cluster-1:
    image: rancher/lb-service-haproxy:v0.6.2
    ports:
    - 3306:3306/tcp
    labels:
      io.rancher.container.agent.role: environmentAdmin
      io.rancher.container.create_agent: 'true'
      io.rancher.scheduler.global: 'true'
  mysql-cluster-1:
    image: rancher/external-service
  mysql-cluster-2:
    image: rancher/external-service

```

> version: ‘2’  
> services:  
> lb-mysql-cluster-2:  
> start\_on\_create: true  
> lb\_config:  
> certs:   
> port\_rules:  
> - priority: 1  
> protocol: tcp  
> service: mysql-cluster-2  
> source\_port: 3307  
> target\_port: 3306  
> health\_check:  
> healthy\_threshold: 2  
> response\_timeout: 2000  
> port: 42  
> unhealthy\_threshold: 3  
> interval: 2000  
> lb-mysql-cluster-1:  
> start\_on\_create: true  
> lb\_config:  
> certs:   
> port\_rules:  
> - priority: 1  
> protocol: tcp  
> service: mysql-cluster-1  
> source\_port: 3306  
> target\_port: 3306  
> health\_check:  
> response\_timeout: 2000  
> healthy\_threshold: 2  
> port: 42  
> unhealthy\_threshold: 3  
> interval: 2000  
> mysql-cluster-1:  
> external\_ips:  
> - 10.100.0.x1  
> - 10.100.0.x2  
> - 10.100.0.x2  
> - 10.100.0.x3  
> start\_on\_create: true  
> health\_check:  
> response\_timeout: 2000  
> healthy\_threshold: 2  
> port: 9200  
> unhealthy\_threshold: 1  
> initializing\_timeout: 60000  
> interval: 2000  
> strategy: recreate  
> request\_line: GET “/” “HTTP/1.0”  
> reinitializing\_timeout: 60000  
> mysql-cluster-2:  
> external\_ips:  
> - 10.110.0.x1  
> - 10.110.0.x2  
> - 10.110.0.x3  
> start\_on\_create: true  
> health\_check:  
> healthy\_threshold: 2  
> response\_timeout: 2000  
> port: 9200  
> unhealthy\_threshold: 1  
> initializing\_timeout: 60000  
> interval: 2000  
> strategy: recreate  
> request\_line: GET “/” “HTTP/1.0”  
> reinitializing\_timeout: 60000
