'Too many pub sub connection in redis sentinel

I have 5 cmdb servers, Where I installed redis server. (1 is master is remaining 4 are replicas), To achieve High availability I installed 5 sentinel nodes on different middleware servers and monitors the master redis server. redis version 6.2

I have max client limit as 10000 connections. But for some reason sentinel node opening too many pubpsub connections with other sentinel nodes and running out of client limit. Why so many pubsub connections are getting created.

Among 5 sentinal nodes only one node is able to access and remaining nodes throwing -----error "Max client limit reached".

Please check the output of working sentinel node
----------------------------------------------------------------
127.0.0.1:26379> info clients
# Clients
connected_clients:1119
cluster_connections:0
maxclients:10000
client_recent_max_input_buffer:32
client_recent_max_output_buffer:0
blocked_clients:0
tracking_clients:0
clients_in_timeout_table:0

--------------------------------------------------
output of max client limit reached sentinel node
127.0.0.1:26379> info clients
Error: Connection reset by peer
127.0.0.1:26379> info clients
ERR max number of clients reached
127.0.0.1:26379>

--------------------------------------------------------

Sample output of "client list" command in working sentinel node

id=264830 addr=x.x.x.x:5543 laddr=x.x.x.x:26379 fd=839 name= age=2327 idle=2327 flags=P db=0 sub=1 psub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 obl=0 oll=0 omem=0 tot-mem=20504 events=r cmd=subscribe user=default redir=-1

id=267063 addr=x.x.x.x:20618 laddr=x.x.x.x:26379 fd=935 name= age=2065 idle=2065 flags=P db=0 sub=1 psub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 obl=0 oll=0 omem=0 tot-mem=20504 events=r cmd=subscribe user=default redir=-1

id=264831 addr=x.x.x.x:46830 laddr=x.x.x.x:26379 fd=840 name= age=2327 idle=2327 flags=P db=0 sub=1 psub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 obl=0 oll=0 omem=0 tot-mem=20504 events=r cmd=subscribe user=default redir=-1

Please help how to prevent too many pub sub connections between sentinel nodes, Because of this applications failing to connect with redis server.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source