Let's we have 3 sentinels, which monitor 2 master, i.e SENTINEL masters returns something like this:

sentinel monitor master1 8.8.8.8 6379 2
sentinel monitor master2 1.1.1.1 6379 2
....

If I start replica for master2, sentinels do not auto discovery it. I suppose, that reason is, sentinels don't what master is connected with this slave.

I know one worked solution. We can explicitly add slave to the config, like this:

sentinel monitor master1 8.8.8.8 6379 2
sentinel monitor master2 1.1.1.1 6379 2

sentinel known-replica master2 2.2.2.2 6379
....

After it, we can execute SENTINEL failover master2, so configs on another sentinels were updated automatically.

Probably, my case is not a redis bug, but documentation bug - https://redis.io/topics/sentinel

Similarly you don't need to configure what is the list of the replicas attached to a master, as Sentinel will auto discover this list querying Redis.

Comment From: hwware

Hello @Hixon10, if you configure sentinel with master correctly, Sentinel will get INFO reply from master which it monitors every 10s by default. therefore if replica was configured correctly for master2,for example, sentinel should automatically discover it by receiving master2's INFO reply message, I guess the reason you did not see is you did not wait for enough time(maybe less than 10s when you run "sentinel slaves master2" command). you can try again and let me know if you have further questions. thanks

Comment From: Hixon10

@hwware hello, maybe I have started redis replica with wrong parameters. Should I start redis replica with https://redis.io/commands/slaveof ? I thought, it is not needed for redis sentinel cluster.

Comment From: hwware

hello @Hixon10 , yes, you need to use slaveof command to replicate with the master node at the first time, if you did not configure known-replica in sentinel conf. however if sentinel already remembers it after it got INFO reply from master,it will automatically save this info into the sentinel conf. and then you restart slave nodes, sentinel will automatically send slaveof command to the replica.

Comment From: Hixon10

Ok, thank you.