The fault performance

When there are only two sentinels, business components cannot switch to the new master when the Sentinel-mode Redis master node is down

The cause of the problem

The Redis sentry still considers the old master master node and does not trigger failover

Fault Location

Sentinel cluster deployment mode:

One master, one slave, three sentinels

Sentinel initial configuration items:

For sentinel Monitor, the number of votes is 2, which means that two sentinels must think that the master node is offline. In other words, only when the two master nodes think that the subjective offline (sDOWN) can trigger the objective offline (ODOWN).

To solve the process

1. The background and the specified log file to start the sentry/usr/bin/redis – sentinel/etc/redis – sentinel. Conf > / data/thirdAssembly/redis/log / 17000/17000. The log > &1 &, See the log

2. Logs show that the sentry status of machine 139 cannot be correctly determined

The following error message is displayed on Telnet 139:

-DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
Connection closed by foreign host.
Copy the code

Analysis:

This indicates that the protection mode is enabled for 139. When the protection mode is enabled, only the local computer can be connected by default

Cause location:

More than 2 sentries set up believe that the master is down, but the current situation is that one of them is down, and one of the other two is in protection mode. The subjective state cannot be obtained, so the master/slave switchover cannot be triggered

Fault recovery

Add to the sentinel configuration item on machine 139

protected-mode no
Copy the code

Try it again. OK

Original is not easy, feel good please like ~