当前位置:网站首页>Redis uses sentinel master-slave switching. What should the program do?
Redis uses sentinel master-slave switching. What should the program do?
2022-06-28 07:55:00 【star++】
summary
The sentry passed the surveillance master, If you find that master Failed to reply to heartbeat package , Then it will be judged as subjective offline , The Sentinels who voted more than half believed that master Subjective offline , Then confirm as master Objective offline , Then one of the Sentinels will be selected as leader, To do master Switch jobs . Switched the new master, Notify the client to connect to the new master. So here comes the question , How does the program know about the new master What's the address ? Do you need to make any changes in the application ?
Introduce dependencies
//springboot Project integration redis
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
Increase the configuration
//1. Configuration is no longer directly configured redis Node address , Instead, configure the sentinel address
//2.master Offline judgment , And choose a new master The sentry is the clearest , So just keep communicating with the sentry
//3. It is still directly used in the program RedisTemplate
spring:
redis:
// Sentinel configuration
sentinel:边栏推荐
- Software design of power control board
- es数据导出csv文件
- SOC timer and interrupt configuration
- 22/02/15 study notes
- Study notes 22/1/11
- 8 figures | analyze Eureka's first synchronization registry
- Section VII starting principle and configuration of zynq
- Airflow2.1.1 summary of the pits stepped on in actual combat!!
- Unity UI shadow component
- 同花顺注册开户靠谱吗?安全吗?
猜你喜欢

Leetcode learning records

asp. Net upload image path and image name

ES6 use of return in arrow function

剑指Offer||:链表(简单)

Section Xi. Axi of zynq_ Use of DMA

SOC serial port configuration

sql主從複制搭建

Airflow2.x distributed deployment DAG execution failure log cannot be obtained normally

【尚品汇】项目笔记

Online WPS tool
随机推荐
asp. Net registration page
sql主從複制搭建
Online WPS tool
Redis one master multi slave cluster setup
Airflow2.1.1 ultra detailed installation document
Ambari (IX) --- use expect to realize no interaction in ambri server setup phase (valid for personal test)
【js】-【节流、防抖函数】
Is it safe to open an account on Dongfang fortune
HJ explicit random number
Study notes 22/1/10
Hj21 simple password
Software design of resistance test board
Implementation of commit message standardized control in large projects
SOC serial port configuration
Airflow2.x distributed deployment DAG execution failure log cannot be obtained normally
基金的投资交易与结算
卸载重装最新版mysql数据库亲测有效
flex布局
异或的应用。(提取出数字中最右侧的1,面试中经常用的到)
Design of DSP image data stream