diff --git "a/2023/05/01/java\344\271\213\346\213\246\346\210\252\345\231\250/index.html" "b/2023/05/01/java\344\271\213\346\213\246\346\210\252\345\231\250/index.html" index 63699ef..2ce7316 100644 --- "a/2023/05/01/java\344\271\213\346\213\246\346\210\252\345\231\250/index.html" +++ "b/2023/05/01/java\344\271\213\346\213\246\346\210\252\345\231\250/index.html" @@ -17,7 +17,7 @@ localSearch: undefined, translate: undefined, noticeOutdate: undefined, - highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false}, + highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500}, copy: { success: '复制成功', error: '复制错误', diff --git "a/2023/05/01/\344\270\223\346\234\211\345\220\215\350\257\215/index.html" "b/2023/05/01/\344\270\223\346\234\211\345\220\215\350\257\215/index.html" index 1206c5c..c906b66 100644 --- "a/2023/05/01/\344\270\223\346\234\211\345\220\215\350\257\215/index.html" +++ "b/2023/05/01/\344\270\223\346\234\211\345\220\215\350\257\215/index.html" @@ -16,7 +16,7 @@ localSearch: undefined, translate: undefined, noticeOutdate: undefined, - highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false}, + highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500}, copy: { success: '复制成功', error: '复制错误', diff --git "a/2023/07/15/\345\273\272\347\253\231/index.html" "b/2023/07/15/\345\273\272\347\253\231/index.html" index 98da11b..96d412b 100644 --- "a/2023/07/15/\345\273\272\347\253\231/index.html" +++ "b/2023/07/15/\345\273\272\347\253\231/index.html" @@ -16,7 +16,7 @@ localSearch: undefined, translate: undefined, noticeOutdate: undefined, - highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false}, + highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500}, copy: { success: '复制成功', error: '复制错误', diff --git "a/2023/07/19/redis\345\237\272\347\241\200/index.html" "b/2023/07/19/redis\345\237\272\347\241\200/index.html" index 546a627..e2cf8f3 100644 --- "a/2023/07/19/redis\345\237\272\347\241\200/index.html" +++ "b/2023/07/19/redis\345\237\272\347\241\200/index.html" @@ -18,7 +18,7 @@ localSearch: undefined, translate: undefined, noticeOutdate: undefined, - highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false}, + highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":500}, copy: { success: '复制成功', error: '复制错误', @@ -343,7 +343,7 @@

引用

1.redis.src.server.h
2.对象机制讲解
3.redis.conf
4. redis命令参考
5. redis设计与实现
6. redis.object.c
7. redis.sds.h
8. redis快速链表
9. redis.quicklist.h
10. redis.intset.h

-
文章作者: mqray
文章链接: https://mqrayblog.cn/2023/07/19/redis基础/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 mqray's blog

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
目录
  1. 1. 引言
  2. 2. 哨兵机制
    1. 2.1. 如何理解哨兵?
    2. 2.2. 如何感知主服务器故障?
      1. 2.2.1. 主观下线
      2. 2.2.2. 客观下线
    3. 2.3. 如何进行故障恢复
      1. 2.3.1. 如何选取leader sentinel
      2. 2.3.2. 选取新的主服务器
      3. 2.3.3. 剩从切换新主
      4. 2.3.4. 结合源码对应 故障转移状态
        1. 2.3.4.1. 旧主变新从
  3. 3. 源码解读
    1. 3.1. main函数中启动sentinel
      1. 3.1.1. main checkForSentinelMode
      2. 3.1.2. main initSentinelConfig
      3. 3.1.3. main initSentinel
      4. 3.1.4. main -> loadSentinelConfigFromQueue
        1. 3.1.4.1. loadSentinelConfigFromQueue -> sentinelHandleConfiguration
          1. 3.1.4.1.1. sentinelHandleConfiguration -> createSentinelRedisInstance
    2. 3.2. main -> sentinelCheckConfigFile
    3. 3.3. main -> sentinelIsRunning
      1. 3.3.1. sentinelIsRunning -> sentinelGenerateInitialMonitorEvents
    4. 3.4. serverCron
      1. 3.4.1. serverCron -> sentinelTimer
      2. 3.4.2. sentinelTimer -> sentinelCheckTiltCondition
      3. 3.4.3. sentinelTimer -> sentinelHandleDictOfRedisInstances
        1. 3.4.3.1. sentinelHandleDictOfRedisInstances -> sentinelHandleRedisInstance
          1. 3.4.3.1.1. sentinelHandleRedisInstance -> sentinelReconnectInstance
          2. 3.4.3.1.2. sentinelHandleRedisInstance -> sentinelSendPeriodicCommands
      4. 3.4.4. sentinelTimer -> sentinelRunPendingScripts
        1. 3.4.4.1. sentinelTimer -> sentinelCollectTerminatedScripts
        2. 3.4.4.2. sentinelTimer -> sentinelKillTimedoutScripts
    5. 3.5. sentinel 创建过程
      1. 3.5.1. 启动并初始化sentinel
      2. 3.5.2. 初始化服务器
      3. 3.5.3. 初始化 sentinel状态
      4. 3.5.4. 初始化sentinel状态和masters属性
      5. 3.5.5. 创建连向主服务器的网络连接
    6. 3.6. sentinel、server之间如何通信?
      1. 3.6.1. 通信过程中的命令?
      2. 3.6.2. sentinel如何应对脑裂?
      3. 3.6.3. 什么是TILT mode?
    7. 3.7. 故障恢复
      1. 3.7.1. 如何检测主观下线
      2. 3.7.2. 如何检测客观下线
        1. 3.7.2.1. sentinelFailoverStateMachine
        2. 3.7.2.2. sentinelAskMasterStateToOtherSentinels
        3. 3.7.2.3. sentinelHandleDictOfRedisInstances -> sentinelFailoverSwitchToPromotedSlave
  4. 4. 引用
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
目录
  1. 1. 引言
  2. 2. 哨兵机制
    1. 2.1. 如何理解哨兵?
    2. 2.2. 如何感知主服务器故障?
      1. 2.2.1. 主观下线
      2. 2.2.2. 客观下线
    3. 2.3. 如何进行故障恢复
      1. 2.3.1. 如何选取leader sentinel
      2. 2.3.2. 选取新的主服务器
      3. 2.3.3. 剩从切换新主
      4. 2.3.4. 结合源码对应 故障转移状态
        1. 2.3.4.1. 旧主变新从
  3. 3. 源码解读
    1. 3.1. main函数中启动sentinel
      1. 3.1.1. main checkForSentinelMode
      2. 3.1.2. main initSentinelConfig
      3. 3.1.3. main initSentinel
      4. 3.1.4. main -> loadSentinelConfigFromQueue
        1. 3.1.4.1. loadSentinelConfigFromQueue -> sentinelHandleConfiguration
          1. 3.1.4.1.1. sentinelHandleConfiguration -> createSentinelRedisInstance
    2. 3.2. main -> sentinelCheckConfigFile
    3. 3.3. main -> sentinelIsRunning
      1. 3.3.1. sentinelIsRunning -> sentinelGenerateInitialMonitorEvents
    4. 3.4. serverCron
      1. 3.4.1. serverCron -> sentinelTimer
      2. 3.4.2. sentinelTimer -> sentinelCheckTiltCondition
      3. 3.4.3. sentinelTimer -> sentinelHandleDictOfRedisInstances
        1. 3.4.3.1. sentinelHandleDictOfRedisInstances -> sentinelHandleRedisInstance
          1. 3.4.3.1.1. sentinelHandleRedisInstance -> sentinelReconnectInstance
          2. 3.4.3.1.2. sentinelHandleRedisInstance -> sentinelSendPeriodicCommands
      4. 3.4.4. sentinelTimer -> sentinelRunPendingScripts
        1. 3.4.4.1. sentinelTimer -> sentinelCollectTerminatedScripts
        2. 3.4.4.2. sentinelTimer -> sentinelKillTimedoutScripts
    5. 3.5. sentinel 创建过程
      1. 3.5.1. 启动并初始化sentinel
      2. 3.5.2. 初始化服务器
      3. 3.5.3. 初始化 sentinel状态
      4. 3.5.4. 初始化sentinel状态和masters属性
      5. 3.5.5. 创建连向主服务器的网络连接
    6. 3.6. sentinel、server之间如何通信?
      1. 3.6.1. 通信过程中的命令?
      2. 3.6.2. sentinel如何应对脑裂?
      3. 3.6.3. 什么是TILT mode?
    7. 3.7. 故障恢复
      1. 3.7.1. 如何检测主观下线
      2. 3.7.2. 如何检测客观下线
        1. 3.7.2.1. sentinelFailoverStateMachine
        2. 3.7.2.2. sentinelAskMasterStateToOtherSentinels
        3. 3.7.2.3. sentinelHandleDictOfRedisInstances -> sentinelFailoverSwitchToPromotedSlave
  4. 4. 引用
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章

评论
avatar
mqray
明日复明日,明日何其多?
Follow Me
公告
This is my Blog
最新文章