Windows Configuration Redis Sentinel

Source: Internet
Author: User
Tags failover

Redis Master-Slave mode must have a single point of issue, so Redis's sentinel mechanism is to compensate for this problem, next we configure the Redis sentinel in the Windows environment.

1. Download the Windows version of Redis address: https://github.com/MicrosoftArchive/redis/releases

2. Extract to Directory, 6379 master, 6380 6381slave

3.redis Master-Slave configuration

3.1 Master File Configuration redis.windows.conf

Port 6379

3.2 6380 Slave file configuration redis.windows.conf

Port 6380

slaveof 127.0.0.1 6379

3.3 6381 Slave file configuration redis.windows.conf

Port 6381

slaveof 127.0.0.1 6379

4.redis Sentinel Configuration

Create a text sentinel.conf file in each Redis directory

4.1 Master 6379 's sentinel.conf file is configured as follows


#当前Sentinel服务运行的端口port 26379#master#sentinel to monitor a master Redis instance named MyMaster, which has the IP address of the native address 127.0.0.1 and the port number 6379,# This master instance is judged to be invalid at least 2 sentinel process consent, as long as the number of Sentinel is agreed to not meet the target, automatic failover will not execute Sentinel Monitor master 127.0.0.1 6381 # Specifies the number of milliseconds that Sentinel considers the Redis instance to be invalidated. When an instance has not returned a ping at that time, or if an error is returned directly, Sentinel marks the instance as a subjective downline. #只有一个 Sentinel Process to mark an instance as subjective offline does not necessarily cause an automatic failover of the instance: only if a sufficient number of Sentinel have marked an instance as a subjective downline, the instance will be marked as objective offline, and automatic failover will perform Sentinel Down-after-milliseconds Master 5000# Specifies the maximum number of times a failover can be performed from a Redis instance while synchronizing a new primary instance, and the smaller the number is, the longer the synchronization takes, in cases where there are more instances of the Redis instance. The longer it takes to complete a failover Sentinel Config-epoch master 12# If the failover operation failed to complete within that time (MS), the failover failed Sentinel Leader-epoch Master 13

4.2 sentinel.conf file configuration in slave 6380

Port 26479

#slave1

Sentinel Monitor Master 127.0.0.1 6381 1

Sentinel Down-after-milliseconds Master 5000

Sentinel Config-epoch Master 12

Sentinel Leader-epoch Master 13


4.3 sentinel.conf file configuration in slave 6381

Port 26579

#slave2

Sentinel Monitor Master 127.0.0.1 6381 1

Sentinel Down-after-milliseconds Master 5000

Sentinel Config-epoch Master 12

Sentinel Leader-epoch Master 13

5. Start the Redis service

Redis-server.exe redis.windows.conf--master

Redis-server.exe redis.windows.conf--slave

Redis-server.exe redis.windows.conf--slave

6. Test Redis Service




7. Launch Sentinel Service

Redis-server.exe sentinel.conf--sentinel






Windows Configuration Redis Sentinel

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.