The problem/use-case that the feature addresses
A description of the problem that the feature will solve, or the use-case with which the feature will be used. I use redis sentinel to solve redis HA。 - In AWS Region A, I have 3 redis instance M1, R1, R2. M1 --> R1 、 M1 --> R2 sync through private network - In AWS Region A, I have 3 sentinel instance S1, S2, S3 - In AWS Region B, I have another redis instance R3, M1 --> R3 sync through public network。(R3 can connect to M1 through public network)
- although I config 'replica-announced=no' in R3,because S1/S2/S3 can't connect R3 through public network, it not work as expected.
- If I close R3 firewall to let S1/S2/S3 can connect R3 through public network, when M1,R1,R2 trigger failover, R3 config will be rewrite by S1/S2/S3, and the config 'replicaof masterPublicIP 6379' will change to 'replicaof masterPrivateIP 6379',so the M1 --> R3 sync will block.
Description of the feature add a config in redis or sentinel , let sentinel don't rewrite a replication config when failover.
Comment From: moticless
Since R3 is required to access indirectly to M1, then all your instances cannot publish their default internal IP but the accessible/public one. This is achieved via the following two options:
replica-announce-ip 5.5.5.5
replica-announce-port 1234
You can also specify hostname instead of IP.
Please see here docker-compose examples to such configuration.
Comment From: huntkalio
@moticless If I use "replica-announce-ip" in M1, R1, R2; all of them will sync through public network, but I only wan't M1 --> R3 through public network; M1 --> R1 、 M1 --> R2 sync through private network
Comment From: moticless
Redis support only announcement of a single address to its clients. In order to have proper access across regions, it need to announce its public network.
I don't think such feature request of publishing public and private hostname goanna be prioritized (@yossigo ?).
If you still want such configuration, maybe you should look for your answer elsewhere with various available cross-region NAT solutions.