Setting up a Redis cluster with two nodes involves the following steps:
redis.conf file for each instance. Set the
cluster-enabled option to
yes, specify a
cluster-config-file, and provide a
redis-cli utility to create the cluster. Consider the IP addresses are
192.168.1.2 and they are both running Redis on port
redis-cli utility will propose a configuration. Accept it.
Please note that Redis cluster requires at least three master nodes for robust failover and distributed storage. A cluster with only two nodes does not guarantee high availability. It's better to use a setup with at least three nodes if you want high availability and partition tolerance.