Hi All,
I’m trying to create a redis HA cluster with Rancher, I’m almost done but I can’t understand how to customize my haproxy’s config with the rancher loadbalancer service.
I need to enable a public access with a custom haproxy backend.
Here is my backend added inside “Custom haproxy.cfg” in the UI
backend redis_master
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK
server … IP:PORT check inter 1s
==> the bold text is generated automaticaly by rancher and I don’t know how to add the Italic text.
Any ideas ?
Here is my full rancher-compose.yml
version: '2'
services:
redis-master:
scale: 1
start_on_create: true
redis-lb:
start_on_create: true
lb_config:
certs: []
config: "backend redis_master\n\toption tcp-check\n\ttcp-check connect\n\ttcp-check\
\ send PING\\r\\n\n\ttcp-check expect string +PONG\n\ttcp-check send info\\\
\ replication\\r\\n\n\ttcp-check expect string role:master\n\ttcp-check send\
\ QUIT\\r\\n\n\ttcp-check expect string +OK\n default-server inter\
\ 1s\n\nbackend redis_slave\n option tcp-check\n default-server inter\
\ 1s\n\nbackend stats\n mode http\n stats enable\n stats hide-version\n\
\ stats show-node\n stats auth admin:password\n stats uri /haproxy-status"
port_rules:
- backend_name: redis_master
priority: 3
protocol: tcp
service: redis-cluster
source_port: 6377
target_port: 6379
- backend_name: redis_slave
priority: 4
protocol: tcp
service: redis-cluster
source_port: 6378
target_port: 6379
health_check:
healthy_threshold: 2
response_timeout: 2000
port: 42
unhealthy_threshold: 3
interval: 2000
redis-slaves:
start_on_create: true
redis-cluster:
start_on_create: true