Sentinel Redis Cluster configuration

Source: Internet
Author: User
Tags redis cluster install redis

1. Redis Sentinel Feature

Redis Sentinel is a set of distributed systems for managing Redis instances, with 3 main tasks to complete:

1) Monitoring: Continuously monitor whether Redis master or slave instances are running as expected

2) Notification: If the monitored Redis instance is running abnormally, Sentinel will notify the external (person or program) via API

3) Automation failover: If the master instance fails, Sentinel will re-elect the master and initiate automatic failover: Select the slave instance of the slave-priority minimum and promote it to master. Also modify the configuration of the other slave so that its master configuration item points to the new master, and when old master resumes restarting, it is automatically demoted to the slave of the new master. Finally, depending on the configuration, Redis Sentinel will also notify the new master address to the application that is currently accessing Redis.

2. Deployment situation

10.150.21.65 Master

10.150.21.69 slave

10.150.21.66 Sentinel Server

3, Master,slave,sentinel server to install Redis;

4. Execute on slave host

REDIS-CLI slaveof 10.150.21.65 6379;/etc/init.d/redis Stop;/etc/init.d/redis start

5. Configuring Sentinel Server

Vim sentinel.conf

#################### #sentinel. conf #############

Port 26379

Dir "/tmp"

Sentinel Monitor Test1 10.150.21.65 6379 1

Sentinel Config-epoch test1 2

Sentinel Leader-epoch test1 2

Sentinel Known-slave test1 10.150.21.69 6379

Sentinel Current-epoch 2

#################### #sentinel. conf #############

6. Launch Sentinel Server

Redis-server sentinel.conf--sentinel &

7. Sentinel Common Commands

Querying the Master State

Redis-cli-h 10.150.21.66-p 26379 Info Sentinel

To get to the primary IP address

Redis-cli-h 127.0.0.7-p 26379 Info sentinel| Awk-f ', '/status/{print $} ' | Awk-f ' = ' {print $} '

Querying the slave status

Redis-cli-h 127.0.0.1-p 26379 Sentinel Slaves Test1

You can also view real-time information

Watch Redis-cli-h 127.0.0.1-p 26379 Sentinel Slaves Test1


This article is from the "interested people, things become" blog, please be sure to keep this source http://wuxinglai.blog.51cto.com/9136815/1672036

Sentinel Redis Cluster configuration

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.