Usually launching two nodes is never a good idea, because it should have a split-brain problem: when the network between two nodes does not work for a minute or two, two nodes will inevitably think that each other is offline and will promote / keep yourself a host and start accepting requests from other services. Then a fragmented brain occurs.
And if everything is okay with this possible situation, you can study the master-slave setting using a script file and an HA service, such as a pacemaker or keepalived.
Typically, you should tell the cluster manager through a predefined rule that when two machines join a split state of the brain, which one is your preferred master.
When the wizard is selected, execute the script and basically run slaveof no one yourself and execute slaveof <new-master-ip> <port> on another node.
You can take one more step in your script file and try to combine the two data sets together, but whether this is achievable or not depends entirely on how you arranged your data in Redis and how long you are ready to wait for all data to synchronize.
I did it myself before going through a pacemaker + corosync.
Redisson_RuiGu
source share