Hi,
You can use "SLAVEOF no one" to promote a slave to a master, without
restarting it. The data will not be lost.
Similarly, when the former master comes back online, it needs to
become SLAVEOF the new master - and that will cause the former master
to discard its data and resync against the new master.
The problem of detection and failover indeed requires scripting and is
very problematic in terms of availability. In the future, Redis
Cluster will do the failover automatically. But the problem of
availability will only be partially solved: even the cluster will have
some temporary loss of availability during the switch, albeit brief,
for some portion of the data.
As for flapping, I suggest you avoid flapping by performing an
automatic failover only once, and require manual intervention for
further failovers.
- Teleo
On Nov 18, 6:09 am, "bhavin.t" <
bhavi...@directi.com> wrote:
> Hi all
>
> While the replication guide is fairly clear on how one can achieve
> master-slave replication, what is not clear is how one achieves high
> availability. I wish to confirm my understanding below -
>
> * One can setup redis replication toreplicate from a master to a