# Suporte para Redis Sentinel

**URL:** <https://meta.discourse.org/t/support-for-redis-sentinel/163608>\
**Category:** Development\
**Created:** [10 Setembro , 2020 12:09 UTC](https://meta.discourse.org/t/support-for-redis-sentinel/163608 "2020-09-10T12:09:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [10 Setembro , 2020 14:35 UTC](https://meta.discourse.org/t/support-for-redis-sentinel/163608/2 "2020-09-10T14:35:10Z")

</div>

Acho que isso nunca funcionou.

Basta separar a preocupação do HA Redis do Discourse e usar o HAProxy para direcionar ao master ou slave.

Configuração de exemplo (master na porta 6379, slave na porta 6380)

```
listen redis_master
  bind 127.0.0.1:6379
  timeout client 30h
  timeout server 30h
  option tcp-check
  tcp-check connect
  tcp-check send AUTH\ *redis_password*\r\n
  tcp-check expect string +OK
  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 redis_data_0 10.10.10.10:6379 check inter 1s
  server redis_data_1 10.10.10.11:6379 check inter 1s

listen redis_slave
  bind 127.0.0.1:6380
  timeout client 30h
  timeout server 30h
  option tcp-check
  tcp-check connect
  tcp-check send AUTH\ *redis_password*\r\n
  tcp-check expect string +OK
  tcp-check send PING\r\n
  tcp-check expect string +PONG
  tcp-check send info\ replication\r\n
  tcp-check expect string role:slave
  tcp-check send QUIT\r\n
  tcp-check expect string +OK
  server redis_data_0 10.10.10.10:6379 check inter 1s
  server redis_data_1 10.10.10.11:6379 check inter 1s

```

---

_[View the full topic](https://meta.discourse.org/t/support-for-redis-sentinel/163608)._
