How it works...
In step 1, we prepared a configuration file for the Redis Sentinel processes. There is a sample sentinel.conf file in the Redis source code package, so in this example we just made changes on top of it. As mentioned, Redis Sentinel is a guard process for Redis data servers, therefore it has to listen to a different port than the data server's port. The default port for Redis Sentinel is 26379. To add a new master server to the Sentinel for monitoring, we can add a line to the configuration file in the format of sentinel monitor <master-name> <ip> <port> <quorum>.
In this example, sentinel monitor mymaster 192.168.0.31 6379 2 means the Sentinel is going to monitor the master server on 192.168.0.31:6379, which is named mymaster ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access