{"id":33675,"date":"2024-01-20T13:08:06","date_gmt":"2023-02-13T08:26:08","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/"},"modified":"2024-05-04T19:15:53","modified_gmt":"2024-05-04T11:15:53","slug":"%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/","title":{"rendered":"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5"},"content":{"rendered":"<p>Redis Sentinel\u662f\u4e00\u79cd\u9ad8\u53ef\u7528\u6027\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5230\u4e3b\u670d\u52a1\u5668\u7684\u6545\u969c\uff0c\u5e76\u52a8\u6001\u5730\u5c06\u590d\u5236\u54c1\u5347\u7ea7\u4e3a\u4e3b\u670d\u52a1\u5668\u3002\u672c\u6587\u5c06\u89e3\u91ca\u5f53\u4e3b\u670d\u52a1\u5668\u5d29\u6e83\u65f6\u7684\u64cd\u4f5c\u3002\u6211\u4eec\u5c06\u4ecb\u7ecd\u4e3b\u670d\u52a1\u5668\u7684redis-server\u8fdb\u7a0b\u5d29\u6e83\u7684\u60c5\u51b5\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/1-0.jpeg\" alt=\"Redis Sentinel Diagram-masterdown.jpg\" \/><\/div>\n<h1>\u51c6\u5907Redis Sentinel<\/h1>\n<p>\u51c6\u5907 Redis Sentinel \u7684\u914d\u7f6e\u3002\u4f7f\u7528 Akamai \u516c\u53f8\u63d0\u4f9b\u7684\u73af\u5883\uff0c\u6b63\u5982\u4e0b\u8ff0\u6587\u7ae0\u6240\u8ff0\u3002<\/p>\n<p>&nbsp;<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/5-0.jpeg\" alt=\"Redis Sentinel Diagram-normal.jpg\" \/><\/div>\n<h1>\u8bf7\u786e\u8ba4Redis Sentinel\u7684\u7248\u672c<\/h1>\n<pre class=\"post-pre\"><code>redissentinel-tokyo1:\/etc\/redis# redis-server --version\r\nRedis server v=7.0.11 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=3af367a78d5e21e9\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>redissentinel-tokyo1:\/etc\/redis# redis-sentinel --version\r\nRedis server v=7.0.11 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=3af367a78d5e21e9\r\n<\/code><\/pre>\n<h1>\u505c\u6b62\u4e3b\u670d\u52a1\u5668\u3002<\/h1>\n<p>\u6211\u4eec\u5c06\u9a8c\u8bc1\u5f53\u8ba1\u5212\u505c\u6b62\u4e3b\u670d\u52a1\u5668\u65f6\u7684\u64cd\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code>systemctl stop redis-server\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/12-0.jpeg\" alt=\"Redis Sentinel Diagram-masterdown.jpg\" \/><\/div>\n<p>Redis\u670d\u52a1\u5668\u5df2\u505c\u6b62\uff0c\u4f46Redis Sentinel\u4ecd\u5728\u8fd0\u884c\u3002<\/p>\n<h1>\u5e08\u5085\u7684\u66f4\u66ff\u8fc7\u7a0b<\/h1>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/15-0.jpeg\" alt=\"Redis Sentinel Diagram-masterchange.jpg\" \/><\/div>\n<p>\u901a\u8fc7\u67e5\u770b\u6bcf\u4e2a\u670d\u52a1\u5668\u7684\u65e5\u5fd7\u6765\u786e\u8ba4\u4e3b\u670d\u52a1\u5668\u7684\u53d8\u5316\u65b9\u5f0f\u3002<\/p>\n<h2>Redis_1 (\u505c\u6b62\u4e3b\u670d\u52a1\u5668)<\/h2>\n<p>\u8ba9\u6211\u4eec\u6765\u67e5\u770b\u5f53 Redis \u670d\u52a1\u5668\u505c\u6b62\u65f6\u7684\u65e5\u5fd7\u8bb0\u5f55\u3002<\/p>\n<h3>\/\u53d8\u91cf\/\u65e5\u5fd7\/Redis\/Redis.log<\/h3>\n<pre class=\"post-pre\"><code>21223:signal-handler (1688124943) Received SIGTERM scheduling shutdown...\r\n21223:signal-handler (1688124943) Received SIGTERM scheduling shutdown...\r\n21223:M 30 Jun 2023 11:35:43.835 # User requested shutdown...\r\n21223:M 30 Jun 2023 11:35:43.836 * Waiting for replicas before shutting down.\r\n21223:M 30 Jun 2023 11:35:44.743 * 2 of 2 replicas are in sync when shutting down.\r\n21223:M 30 Jun 2023 11:35:44.743 * Saving the final RDB snapshot before exiting.\r\n21223:M 30 Jun 2023 11:35:44.747 * DB saved on disk\r\n21223:M 30 Jun 2023 11:35:44.747 * Removing the pid file.\r\n21223:M 30 Jun 2023 11:35:44.747 # Redis is now ready to exit, bye bye...\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">TERM \u306e\u30b7\u30b0\u30ca\u30eb\u3092\u53d7\u3051\u53d6\u3063\u3066\u3044\u307e\u3059\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">shutdown \u3059\u308b\u3068\u304d\u306b\u3001\uff12\u3064\u306e\u30ec\u30d7\u30ea\u30ab\u304c\u540c\u671f\u3057\u3066\u3044\u307e\u3059\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30c7\u30fc\u30bf\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u3066\u3044\u308b\u3002\u30d5\u30a1\u30a4\u30eb\u306f \/var\/lib\/redis\/dump.rdb \u306b\u306a\u308a\u307e\u3059\u3002<\/ul>\n<h3>\/var\/log\/redis\/sentinel.log \u53ef\u80fd\u7684\u4e2d\u6587\u7ffb\u8bd1\u9009\u9879\uff1a<br \/>\n\/\u53d8\u91cf\/\u65e5\u5fd7\/redis\/\u54e8\u5175.log<\/h3>\n<pre class=\"post-pre\"><code>21283:X 30 Jun 2023 11:36:13.904 # +sdown master mymaster 192.168.198.87 6379\r\n21283:X 30 Jun 2023 11:36:14.931 * Sentinel new configuration saved on disk\r\n21283:X 30 Jun 2023 11:36:14.931 # +new-epoch 1\r\n21283:X 30 Jun 2023 11:36:14.933 * Sentinel new configuration saved on disk\r\n21283:X 30 Jun 2023 11:36:14.933 # +vote-for-leader 1c87ce18ee98b4373cf3d26826893e7fedc29d88 1\r\n21283:X 30 Jun 2023 11:36:15.002 # +odown master mymaster 192.168.198.87 6379 #quorum 2\/2\r\n21283:X 30 Jun 2023 11:36:15.003 # Next failover delay: I will not start a failover before Fri Jun 30 11:42:15 2023\r\n21283:X 30 Jun 2023 11:36:16.195 # +config-update-from sentinel 1c87ce18ee98b4373cf3d26826893e7fedc29d88 192.168.198.103 26379 @ mymaster 192.168.198.87 6379\r\n21283:X 30 Jun 2023 11:36:16.196 # +switch-master mymaster 192.168.198.87 6379 192.168.198.103 6379\r\n21283:X 30 Jun 2023 11:36:16.197 * +slave slave 192.168.198.112:6379 192.168.198.112 6379 @ mymaster 192.168.198.103 6379\r\n21283:X 30 Jun 2023 11:36:16.197 * +slave slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n21283:X 30 Jun 2023 11:36:16.202 * Sentinel new configuration saved on disk\r\n<\/code><\/pre>\n<p>11:36:13.904 \u306e\u6642\u9593\u306b 192.168.198.87 (redissentinel-tokyo1) \u306e\u30c0\u30a6\u30f3\u3092\u691c\u77e5\u3057\u3066\u3044\u308b\u3002\u3053\u306e\u6642\u9593\u306f redis-server \u304c SIGTERM \u3092\u53d7\u3051\u53d6\u3063\u305f 11:35:43.835 \u304b\u3089\u7d04 30 \u79d2\u5f8c\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nsentinel.conf \u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u3066\u3044\u308b\u3002\u30de\u30b9\u30bf\u30fc\u3068\u30ec\u30d7\u30ea\u30ab\u306e\u72b6\u614b\u3092\u30b3\u30f3\u30d5\u30a3\u30b0\u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u9332\u3057\u3066\u66f8\u304d\u63db\u3048\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30de\u30b9\u30bf\u30fc\u30b5\u30fc\u30d0\u304c\u30c0\u30a6\u30f3\u3057\u305f\u3053\u3068\u3092\u591a\u6570\u6c7a\u3067\u6c7a\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n6 \u5206\u9593\u306e\u9593\u306f\u6b21\u306e\u30d5\u30a7\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc\u304c\u8d77\u304d\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<br \/>\n\u30de\u30b9\u30bf\u30fc\u3092 192.168.198.103 (redissentinel-tokyo2) \u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>192.168.198.112 (redissentinel-tokyo3) \u3092\u30ec\u30d7\u30ea\u30ab\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>192.168.198.87 (redissentinel-tokyo1) \u3092\u30ec\u30d7\u30ea\u30ab\u3068\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<br \/>\nsentinel.conf \u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u3066\u3044\u308b\u3002<\/p>\n<h2>Redis_2\uff08\u4ece\u526f\u672c\u5347\u7ea7\u4e3a\u4e3b\u8282\u70b9\uff09<\/h2>\n<h3>\/var\/log\/redis\/redis.log &#8211; Redis\u7684\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84<\/h3>\n<pre class=\"post-pre\"><code>17497:S 30 Jun 2023 11:36:14.899 * MASTER &lt;-&gt; REPLICA sync started\r\n17497:S 30 Jun 2023 11:36:14.900 # Error condition on socket for SYNC: (null)\r\n17497:M 30 Jun 2023 11:36:15.137 * Discarding previously cached master state.\r\n17497:M 30 Jun 2023 11:36:15.137 # Setting secondary replication ID to fac9e97e4769636aa327dbdf17c54bbfe8e2a5dc, valid up to offset: 16450434. New replication ID is 4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a\r\n17497:M 30 Jun 2023 11:36:15.137 * MASTER MODE enabled (user request from 'id=8 addr=192.168.198.103:60290 laddr=192.168.198.103:6379 fd=12 name=sentinel-1c87ce18-cmd age=77344 idle=0 flags=x db=0 sub=0 psub=0 ssub=0 multi=4 qbuf=188 qbuf-free=20286 argv-mem=4 multi-mem=169 rbs=4096 rbp=2048 obl=45 oll=0 omem=0 tot-mem=25637 events=r cmd=exec user=default redir=-1 resp=2')\r\n17497:M 30 Jun 2023 11:36:15.152 # CONFIG REWRITE executed with success.\r\n17497:M 30 Jun 2023 11:36:16.372 * Replica 192.168.198.112:6379 asks for synchronization\r\n17497:M 30 Jun 2023 11:36:16.373 * Partial resynchronization request from 192.168.198.112:6379 accepted. Sending 312 bytes of backlog starting from offset 16450434.\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u3068\u306e SYNC \u306e\u5931\u6557\u3092\u691c\u77e5\u3057\u3066\u3044\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u306b\u6607\u683c\u3057\u3066\u3044\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">CONFIG REWRITE \u3092\u5b9f\u884c\u3057\u3066\u3044\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>192.168.198.112 (redissentinel-tokyo3) \u306b SYNC \u3092\u4f9d\u983c\u3057\u3066\u3044\u308b\u3002<\/p>\n<h3>\/\u53d8\u91cf\/\u65e5\u5fd7\/\u96f7\u8482\u65af\/\u54e8\u5175\/\u65e5\u5fd7<\/h3>\n<pre class=\"post-pre\"><code>17725:X 30 Jun 2023 11:36:14.820 # +sdown master mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:14.921 # +odown master mymaster 192.168.198.87 6379 #quorum 2\/2\r\n17725:X 30 Jun 2023 11:36:14.921 # +new-epoch 1\r\n17725:X 30 Jun 2023 11:36:14.922 # +try-failover master mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:14.924 * Sentinel new configuration saved on disk\r\n17725:X 30 Jun 2023 11:36:14.924 # +vote-for-leader 1c87ce18ee98b4373cf3d26826893e7fedc29d88 1\r\n17725:X 30 Jun 2023 11:36:14.934 # b2987056e452e83d9dbf86321430f0e05e6f701c voted for 1c87ce18ee98b4373cf3d26826893e7fedc29d88 1\r\n17725:X 30 Jun 2023 11:36:14.941 # 79552dceee192b3e37e9bc97ef783d11b7056436 voted for 1c87ce18ee98b4373cf3d26826893e7fedc29d88 1\r\n17725:X 30 Jun 2023 11:36:15.015 # +elected-leader master mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:15.016 # +failover-state-select-slave master mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:15.072 # +selected-slave slave 192.168.198.103:6379 192.168.198.103 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:15.072 * +failover-state-send-slaveof-noone slave 192.168.198.103:6379 192.168.198.103 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:15.136 * +failover-state-wait-promotion slave 192.168.198.103:6379 192.168.198.103 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.184 * Sentinel new configuration saved on disk\r\n17725:X 30 Jun 2023 11:36:16.185 # +promoted-slave slave 192.168.198.103:6379 192.168.198.103 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.185 # +failover-state-reconf-slaves master mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.193 * +slave-reconf-sent slave 192.168.198.112:6379 192.168.198.112 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.424 * +slave-reconf-inprog slave 192.168.198.112:6379 192.168.198.112 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.425 * +slave-reconf-done slave 192.168.198.112:6379 192.168.198.112 6379 @ mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.500 # +failover-end master mymaster 192.168.198.87 6379\r\n17725:X 30 Jun 2023 11:36:16.501 # +switch-master mymaster 192.168.198.87 6379 192.168.198.103 6379\r\n17725:X 30 Jun 2023 11:36:16.502 * +slave slave 192.168.198.112:6379 192.168.198.112 6379 @ mymaster 192.168.198.103 6379\r\n17725:X 30 Jun 2023 11:36:16.502 * +slave slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n17725:X 30 Jun 2023 11:36:16.507 * Sentinel new configuration saved on disk\r\n17725:X 30 Jun 2023 11:36:46.593 # +sdown slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n<\/code><\/pre>\n<p>11:36:14.820 \u306b \u30de\u30b9\u30bf\u30fc\u3067\u3042\u308b192.168.198.87 (redissentinel-tokyo1) \u306e\u30c0\u30a6\u30f3\u3092\u691c\u77e5\u3057\u3066\u3044\u308b\u3002<br \/>\n\u4f55\u5ea6\u3082\u78ba\u8a8d\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u3002<br \/>\n\u6700\u7d42\u7684\u306b\u3001192.168.198.103 (redissentinel-tokyo2) \u3092\u30de\u30b9\u30bf\u30fc\u3068\u3057\u3066\u9078\u51fa\u3057\u3066\u3044\u308b\u3002<br \/>\nSentinel \u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>192.168.198.87 (redissentinel-tokyo1) \u306f\u30ec\u30d7\u30ea\u30ab\u3068\u3057\u3066\u30c0\u30a6\u30f3\u3092\u691c\u77e5\u3057\u3066\u3044\u308b\u3002<\/p>\n<h2>Redis_3 (\u590d\u5236\u54c1 -&gt; \u590d\u5236\u54c1)<\/h2>\n<h3>\/\u53d8\u91cf\/\u65e5\u5fd7\/redis\/redis.log<\/h3>\n<pre class=\"post-pre\"><code>17366:S 30 Jun 2023 11:36:14.343 # Error condition on socket for SYNC: (null)\r\n17366:S 30 Jun 2023 11:36:15.349 * Connecting to MASTER 192.168.198.87:6379\r\n17366:S 30 Jun 2023 11:36:15.349 * MASTER &lt;-&gt; REPLICA sync started\r\n17366:S 30 Jun 2023 11:36:15.349 # Error condition on socket for SYNC: (null)\r\n17366:S 30 Jun 2023 11:36:16.193 * Connecting to MASTER 192.168.198.103:6379\r\n17366:S 30 Jun 2023 11:36:16.194 * MASTER &lt;-&gt; REPLICA sync started\r\n17366:S 30 Jun 2023 11:36:16.194 * REPLICAOF 192.168.198.103:6379 enabled (user request from 'id=7 addr=192.168.198.103:33152 laddr=192.168.198.112:6379 fd=12 name=sentinel-1c87ce18-cmd age=77345 idle=0 flags=x db=0 sub=0 psub=0 ssub=0 multi=4 qbuf=348 qbuf-free=20126 argv-mem=4 multi-mem=183 rbs=8192 rbp=4096 obl=45 oll=0 omem=0 tot-mem=29747 events=r cmd=exec user=default redir=-1 resp=2')\r\n17366:S 30 Jun 2023 11:36:16.219 # CONFIG REWRITE executed with success.\r\n17366:S 30 Jun 2023 11:36:16.345 * Non blocking connect for SYNC fired the event.\r\n17366:S 30 Jun 2023 11:36:16.356 * Master replied to PING, replication can continue...\r\n17366:S 30 Jun 2023 11:36:16.370 * Trying a partial resynchronization (request fac9e97e4769636aa327dbdf17c54bbfe8e2a5dc:16450434).\r\n17366:S 30 Jun 2023 11:36:16.372 * Successful partial resynchronization with master.\r\n17366:S 30 Jun 2023 11:36:16.372 # Master replication ID changed to 4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a\r\n17366:S 30 Jun 2023 11:36:16.372 * MASTER &lt;-&gt; REPLICA sync: Master accepted a Partial Resynchronization.\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">SYNC \u306e\u5931\u6557\u3092\u691c\u77e5\u3057\u3066\u3044\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>192.168.198.103 (redissentinel-tokyo2) \u3092\u30de\u30b9\u30bf\u30fc\u3068\u898b\u306a\u3057\u540c\u671f\u3092\u3057\u3066\u3044\u308b\u3002<br \/>\nCONFIG REWRITE \u3092\u5b9f\u884c\u3057\u3066\u3044\u308b<br \/>\n\u30de\u30b9\u30bf\u30fc\u304c PING \u5fdc\u7b54\u3092\u3057\u3001\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u7d99\u7d9a\u3055\u308c\u308b\u3002<br \/>\n\u30de\u30b9\u30bf\u30fc\u3068\u90e8\u5206\u7684\u306a\u540c\u671f\u304c\u884c\u308f\u308c\u305f\u3002<\/p>\n<h3>\/var\/log\/redis\/sentinel.log \u7684\u539f\u6587\u9032\u884c\u4e2d\u6587\u7ffb\u8b6f<\/h3>\n<pre class=\"post-pre\"><code>17574:X 30 Jun 2023 11:36:14.933 * Sentinel new configuration saved on disk\r\n17574:X 30 Jun 2023 11:36:14.934 # +new-epoch 1\r\n17574:X 30 Jun 2023 11:36:14.938 * Sentinel new configuration saved on disk\r\n17574:X 30 Jun 2023 11:36:14.939 # +vote-for-leader 1c87ce18ee98b4373cf3d26826893e7fedc29d88 1\r\n17574:X 30 Jun 2023 11:36:15.840 # +sdown master mymaster 192.168.198.87 6379\r\n17574:X 30 Jun 2023 11:36:15.894 # +odown master mymaster 192.168.198.87 6379 #quorum 3\/2\r\n17574:X 30 Jun 2023 11:36:15.895 # Next failover delay: I will not start a failover before Fri Jun 30 11:42:15 2023\r\n17574:X 30 Jun 2023 11:36:16.198 # +config-update-from sentinel 1c87ce18ee98b4373cf3d26826893e7fedc29d88 192.168.198.103 26379 @ mymaster 192.168.198.87 6379\r\n17574:X 30 Jun 2023 11:36:16.199 # +switch-master mymaster 192.168.198.87 6379 192.168.198.103 6379\r\n17574:X 30 Jun 2023 11:36:16.200 * +slave slave 192.168.198.112:6379 192.168.198.112 6379 @ mymaster 192.168.198.103 6379\r\n17574:X 30 Jun 2023 11:36:16.200 * +slave slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n17574:X 30 Jun 2023 11:36:16.206 * Sentinel new configuration saved on disk\r\n17574:X 30 Jun 2023 11:36:46.209 # +sdown slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">sentinel.conf \u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u3067\u3042\u3063\u305f 192.168.198.87 (redissentinel-tokyo1) \u306e\u30c0\u30a6\u30f3\u3092\u691c\u77e5\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">6 \u5206\u9593\u306f\u6b21\u306e\u30d5\u30a7\u30fc\u30eb\u30aa\u30fc\u30d0\u30fc\u304c\u8d77\u304d\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u3092 192.168.198.103 (redissentinel-tokyo2) \u306b\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>192.168.198.87 (redissentinel-tokyo1) \u3092\u30ec\u30d7\u30ea\u30ab\u3068\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002<br \/>\nsentinel.conf \u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u3066\u3044\u308b\u3002<br \/>\n\u30b9\u30ec\u30fc\u30d6\u306e 192.168.198.87 (redissentinel-tokyo1) \u306e\u30c0\u30a6\u30f3\u3092\u8a18\u9332\u3057\u3066\u3044\u308b<\/p>\n<h2>\u4f7f\u7528redis-cli\u547d\u4ee4\u68c0\u67e5\u4e3b\/\u4ece\u590d\u5236\u72b6\u6001\u3002<\/h2>\n<h3>redis_1\uff08\u670d\u52a1\u5668\u5d29\u6e83\uff09<\/h3>\n<pre class=\"post-pre\"><code>redisclient:~# redis-cli -h redissentinel-tokyo1 --tls --cacert redissentinel-tokyo_ca.crt\r\nCould not connect to Redis at redissentinel-tokyo1:6379: Connection refused\r\n<\/code><\/pre>\n<h3>Redis_2 (\u4ece\u526f\u672c\u5347\u7ea7\u4e3a\u4e3b\u8282\u70b9)<\/h3>\n<pre class=\"post-pre\"><code>redisclient:~# redis-cli -h redissentinel-tokyo2 --tls --cacert redissentinel-tokyo_ca.crt\r\nredissentinel-tokyo2:6379&gt; ping\r\nPONG\r\nredissentinel-tokyo2:6379&gt; role\r\n1) \"master\"\r\n2) (integer) 16492964\r\n3) 1) 1) \"192.168.198.112\"\r\n      2) \"6379\"\r\n      3) \"16492819\"\r\nredissentinel-tokyo2:6379&gt; info replication\r\n# Replication\r\nrole:master\r\nconnected_slaves:1\r\nslave0:ip=192.168.198.112,port=6379,state=online,offset=16495596,lag=1\r\nmaster_failover_state:no-failover\r\nmaster_replid:4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a\r\nmaster_replid2:fac9e97e4769636aa327dbdf17c54bbfe8e2a5dc\r\nmaster_repl_offset:16495596\r\nsecond_repl_offset:16450434\r\nrepl_backlog_active:1\r\nrepl_backlog_size:1048576\r\nrepl_backlog_first_byte_offset:15432268\r\nrepl_backlog_histlen:1063329\r\nredissentinel-tokyo2:6379&gt;\r\n<\/code><\/pre>\n<p>\u901a\u8fc7\u5347\u7ea7\u4e3a\u5927\u5e08\u7ea7\uff0c\u53ef\u4ee5\u8fdb\u884c\u5e16\u5b50\u7684\u5199\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code>redisclient:~# redis-cli -h redissentinel-tokyo2 --tls --cacert redissentinel-tokyo_ca.crt\r\nredissentinel-tokyo2:6379&gt; get scott\r\n\"dixon\"\r\nredissentinel-tokyo2:6379&gt; set scott tiger\r\nOK\r\nredissentinel-tokyo2:6379&gt; get scott\r\n\"tiger\"\r\n<\/code><\/pre>\n<h3>Redis 3\uff08\u6ca1\u6709\u4ece\u526f\u672c\u66f4\u6539\u89d2\u8272\uff09<\/h3>\n<pre class=\"post-pre\"><code>redisclient:~# redis-cli -h redissentinel-tokyo3 --tls --cacert redissentinel-tokyo_ca.crt\r\nredissentinel-tokyo3:6379&gt; ping\r\nPONG\r\nredissentinel-tokyo3:6379&gt; role\r\n1) \"slave\"\r\n2) \"192.168.198.103\"\r\n3) (integer) 6379\r\n4) \"connected\"\r\n5) (integer) 16501266\r\nredissentinel-tokyo3:6379&gt; info replication\r\n# Replication\r\nrole:slave\r\nmaster_host:192.168.198.103\r\nmaster_port:6379\r\nmaster_link_status:up\r\nmaster_last_io_seconds_ago:0\r\nmaster_sync_in_progress:0\r\nslave_read_repl_offset:16503016\r\nslave_repl_offset:16503016\r\nslave_priority:100\r\nslave_read_only:1\r\nreplica_announced:1\r\nconnected_slaves:0\r\nmaster_failover_state:no-failover\r\nmaster_replid:4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a\r\nmaster_replid2:fac9e97e4769636aa327dbdf17c54bbfe8e2a5dc\r\nmaster_repl_offset:16503016\r\nsecond_repl_offset:16450434\r\nrepl_backlog_active:1\r\nrepl_backlog_size:1048576\r\nrepl_backlog_first_byte_offset:15452708\r\nrepl_backlog_histlen:1050309\r\nredissentinel-tokyo3:6379\r\n<\/code><\/pre>\n<h1>\u91cd\u65b0\u542f\u52a8Redis_1<\/h1>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/49-0.jpeg\" alt=\"Redis Sentinel Diagram-slaveup.jpg\" \/><\/div>\n<h2>Redis_1<\/h2>\n<pre class=\"post-pre\"><code>redissentinel-tokyo1:\/etc\/redis# systemctl start redis-server\r\n<\/code><\/pre>\n<h3>\/\u53d8\u91cf\/\u8bb0\u5f55\/Redis\/\u670d\u52a1\u5668\/\u65e5\u5fd7<\/h3>\n<pre class=\"post-pre\"><code>31517:M 30 Jun 2023 11:41:26.650 * Ready to accept connections\r\n31517:S 30 Jun 2023 11:41:37.261 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.\r\n31517:S 30 Jun 2023 11:41:37.262 * Connecting to MASTER 192.168.198.103:6379\r\n31517:S 30 Jun 2023 11:41:37.262 * MASTER &lt;-&gt; REPLICA sync started\r\n31517:S 30 Jun 2023 11:41:37.262 * REPLICAOF 192.168.198.103:6379 enabled (user request from 'id=3 addr=192.168.198.112:47512 laddr=192.168.198.87:6379 fd=9 name=sentinel-79552dce-cmd age=10 idle=0 flags=x db=0 sub=0 psub=0 ssub=0 multi=4 qbuf=203 qbuf-free=20271 argv-mem=4 multi-mem=183 rbs=1024 rbp=1024 obl=45 oll=0 omem=0 tot-mem=22579 events=r cmd=exec user=default redir=-1 resp=2')\r\n31517:S 30 Jun 2023 11:41:37.354 # CONFIG REWRITE executed with success.\r\n31517:S 30 Jun 2023 11:41:37.392 * Non blocking connect for SYNC fired the event.\r\n31517:S 30 Jun 2023 11:41:37.401 * Master replied to PING, replication can continue...\r\n31517:S 30 Jun 2023 11:41:37.412 * Trying a partial resynchronization (request ea8357aacfed619a5e0d9df56ada81fdbe5d73c9:16452771).\r\n31517:S 30 Jun 2023 11:41:42.321 * Full resync from master: 4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a:16520922\r\n31517:S 30 Jun 2023 11:41:42.324 * MASTER &lt;-&gt; REPLICA sync: receiving streamed RDB from master with EOF to disk\r\n31517:S 30 Jun 2023 11:41:42.324 * Discarding previously cached master state.\r\n31517:S 30 Jun 2023 11:41:42.325 * MASTER &lt;-&gt; REPLICA sync: Flushing old data\r\n31517:S 30 Jun 2023 11:41:42.325 * MASTER &lt;-&gt; REPLICA sync: Loading DB in memory\r\n31517:S 30 Jun 2023 11:41:42.327 * Loading RDB produced by version 7.0.7\r\n31517:S 30 Jun 2023 11:41:42.328 * RDB age 0 seconds\r\n31517:S 30 Jun 2023 11:41:42.328 * RDB memory usage when created 2.51 Mb\r\n31517:S 30 Jun 2023 11:41:42.328 * Done loading RDB, keys loaded: 1, keys expired: 0.\r\n31517:S 30 Jun 2023 11:41:42.328 * MASTER &lt;-&gt; REPLICA sync: Finished with success\r\n\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u306e 192.168.198.103 (redissentinel-tokyo2) \u306b\u63a5\u7d9a\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u304b\u3089\u540c\u671f\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">CONFIG WRITE \u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u4ee5\u524d\u306e\u30de\u30b9\u30bf\u30fc\u306e\u72b6\u614b\u3092\u7834\u68c4\u3057\u3066\u3044\u308b\u3002<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u304b\u3089\u306e\u540c\u671f\u3092\u5b8c\u4e86\u3057\u3066\u3044\u308b\u3002<\/ul>\n<h3>\/var\/log\/redis\/sentinel.log<\/h3>\n<p>\/var\/log\/redis\/sentinel.log<\/p>\n<pre class=\"post-pre\"><code>21283:X 30 Jun 2023 11:41:27.658 # -sdown slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n<\/code><\/pre>\n<p>192.168.198.87 (redissentinel-tokyo1)\u306e\u30c0\u30a6\u30f3\u306e\u72b6\u6cc1\u3092\u89e3\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u4f7f\u7528redis-cli\u6765\u8fdb\u884c\u8fde\u63a5<\/h3>\n<p>\u6211\u53ef\u4ee5\u8fde\u63a5\u4f5c\u4e3a\u526f\u672c\u3002<\/p>\n<pre class=\"post-pre\"><code>redisclient:~# redis-cli -h redissentinel-tokyo1 --tls --cacert redissentinel-tokyo_ca.crt\r\nredissentinel-tokyo1:6379&gt; ping\r\nPONG\r\nredissentinel-tokyo1:6379&gt; role\r\n1) \"slave\"\r\n2) \"192.168.198.103\"\r\n3) (integer) 6379\r\n4) \"connected\"\r\n5) (integer) 16549337\r\nredissentinel-tokyo1:6379&gt; info replication\r\n# Replication\r\nrole:slave\r\nmaster_host:192.168.198.103\r\nmaster_port:6379\r\nmaster_link_status:up\r\nmaster_last_io_seconds_ago:1\r\nmaster_sync_in_progress:0\r\nslave_read_repl_offset:16550074\r\nslave_repl_offset:16550074\r\nslave_priority:100\r\nslave_read_only:1\r\nreplica_announced:1\r\nconnected_slaves:0\r\nmaster_failover_state:no-failover\r\nmaster_replid:4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a\r\nmaster_replid2:0000000000000000000000000000000000000000\r\nmaster_repl_offset:16550074\r\nsecond_repl_offset:-1\r\nrepl_backlog_active:1\r\nrepl_backlog_size:1048576\r\nrepl_backlog_first_byte_offset:16520923\r\nrepl_backlog_histlen:29152\r\n<\/code><\/pre>\n<h2>Redis_2<\/h2>\n<h3>\/\u53d8\u91cf\/\u65e5\u5fd7\/redis\/\u670d\u52a1\u7aef\/\u65e5\u5fd7<\/h3>\n<pre class=\"post-pre\"><code>17497:M 30 Jun 2023 11:41:37.414 * Replica 192.168.198.87:6379 asks for synchronization\r\n17497:M 30 Jun 2023 11:41:37.414 * Partial resynchronization not accepted: Replication ID mismatch (Replica asked for 'ea8357aacfed619a5e0d9df56ada81fdbe5d73c9', my replication IDs are '4831258c3aa4c7d8d6c9e0eb1244acb86c511c8a' and 'fac9e97e4769636aa327dbdf17c54bbfe8e2a5dc')\r\n17497:M 30 Jun 2023 11:41:37.414 * Delay next BGSAVE for diskless SYNC\r\n17497:M 30 Jun 2023 11:41:42.321 * Starting BGSAVE for SYNC with target: replicas sockets\r\n17497:M 30 Jun 2023 11:41:42.322 * Background RDB transfer started by pid 28448\r\n28448:C 30 Jun 2023 11:41:42.325 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB\r\n17497:M 30 Jun 2023 11:41:42.326 # Diskless rdb transfer, done reading from pipe, 1 replicas still up.\r\n17497:M 30 Jun 2023 11:41:42.331 * Background RDB transfer terminated with success\r\n17497:M 30 Jun 2023 11:41:42.331 * Streamed RDB transfer with replica 192.168.198.87:6379 succeeded (socket). Waiting for REPLCONF ACK from slave to enable streaming\r\n17497:M 30 Jun 2023 11:41:42.331 * Synchronization with replica 192.168.198.87:6379 succeeded\r\n<\/code><\/pre>\n<p>192.168.198.87 (redissentinel-tokyo1)\u3068\u540c\u671f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\/var\/log\/redis\/sentinel.log \u53ef\u4ee5\u7528\u4ee5\u4e0b\u65b9\u5f0f\u7ffb\u8bd1\u6210\u4e2d\u6587\uff1a<br \/>\n\/\u53d8\u91cf\/\u65e5\u5fd7\/\u96f7\u8fea\u65af\/\u54e8\u5175.log<\/h3>\n<pre class=\"post-pre\"><code>17725:X 30 Jun 2023 11:41:27.664 # -sdown slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n<\/code><\/pre>\n<p>192.168.198.87 (redissentinel-tokyo1)\u306e\u30c0\u30a6\u30f3\u306e\u72b6\u6cc1\u3092\u89e3\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>Redis_3 = Redis\u4e09<\/h2>\n<h3>\/\u53d8\u91cf\/\u65e5\u5fd7\/\u96f7\u8fea\u65af\/\u670d\u52a1\u5668\/\u65e5\u5fd7<\/h3>\n<pre class=\"post-pre\"><code>no log\r\n<\/code><\/pre>\n<h3>\/var\/log\/redis\/sentinel.log \u7684\u4e2d\u6587\u7ffb\u8bd1\u662f\u4ec0\u4e48?<\/h3>\n<pre class=\"post-pre\"><code>17574:X 30 Jun 2023 11:41:27.196 # -sdown slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n17574:X 30 Jun 2023 11:41:37.260 * +convert-to-slave slave 192.168.198.87:6379 192.168.198.87 6379 @ mymaster 192.168.198.103 6379\r\n<\/code><\/pre>\n<p>192.168.198.87 (redissentinel-tokyo1)\u306e\u30c0\u30a6\u30f3\u306e\u72b6\u6cc1\u3092\u89e3\u9664\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u914d\u7f6e\u6587\u4ef6\u7684\u66f4\u6539\u5dee\u5f02<\/h1>\n<h2>Redis_1<\/h2>\n<pre class=\"post-pre\"><code>redissentinel-tokyo1:\/etc\/redis# diff redis.conf.before redis.conf.after\r\n&gt; latency-tracking-info-percentiles 50 99 99.9\r\n&gt; replicaof 192.168.198.103 6379\r\n&gt; save 3600 1\r\n&gt; save 300 100\r\n&gt; save 60 10000\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u53d6\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/ul>\n<pre class=\"post-pre\"><code>redissentinel-tokyo1:\/etc\/redis# diff sentinel.conf.before sentinel.conf.after\r\n\r\n&lt; sentinel config-epoch mymaster 0\r\n&lt; sentinel leader-epoch mymaster 0\r\n&lt; sentinel current-epoch 0\r\n---\r\n&gt; sentinel config-epoch mymaster 1\r\n&gt; sentinel leader-epoch mymaster 1\r\n&gt; sentinel current-epoch 1\r\n\r\n&lt; sentinel monitor mymaster 192.168.198.87 6379 2\r\n---\r\n&gt; sentinel monitor mymaster 192.168.198.103 6379 2\r\n\r\n&lt; sentinel known-replica mymaster 192.168.198.103 6379\r\n---\r\n&gt; sentinel known-replica mymaster 192.168.198.87 6379\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u3068\u30ec\u30d7\u30ea\u30ab\u306e IP \u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/ul>\n<h1>redis_2 &#8211; \u91cd\u590d 2<\/h1>\n<pre class=\"post-pre\"><code>redissentinel-tokyo2:\/etc\/redis#  diff redis.conf.before redis.conf.after\r\n&gt; requirepass \"y+8erSZr9YHAUIzA19zkxaS\/8d+kjx4tMJ0zWqBqjuE=\"\r\n&gt; save 3600 1\r\n&gt; save 300 100\r\n&gt; save 60 10000\r\n&gt; latency-tracking-info-percentiles 50 99 99.9\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u53d6\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/ul>\n<pre class=\"post-pre\"><code>redissentinel-tokyo2:\/etc\/redis# diff sentinel.conf.before sentinel.conf.after\r\n\r\n&lt; sentinel config-epoch mymaster 0\r\n&lt; sentinel leader-epoch mymaster 0\r\n&lt; sentinel current-epoch 0\r\n\r\n&gt; sentinel config-epoch mymaster 1\r\n&gt; sentinel leader-epoch mymaster 1\r\n&gt; sentinel current-epoch 1\r\n---\r\n&lt; sentinel monitor mymaster 192.168.198.87 6379 2\r\n&gt; sentinel monitor mymaster 192.168.198.103 6379 2\r\n\r\n&lt; sentinel known-replica mymaster 192.168.198.103 6379\r\n&gt; sentinel known-replica mymaster 192.168.198.87 6379\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u3068\u30ec\u30d7\u30ea\u30ab\u306e IP \u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/ul>\n<h2>Redis_3\u53ef\u4ee5\u7528\u4e2d\u6587\u7ffb\u8bd1\u4e3a&#8221;Redis\u4e09&#8221;\u3002<\/h2>\n<pre class=\"post-pre\"><code>redissentinel-tokyo3:\/etc\/redis# diff  --suppress-common-lines redis.conf.before redis.conf.after\r\n&lt; supervised auto\r\n---\r\n&gt; supervised systemd\r\n&gt; save 3600 1\r\n&gt; save 300 100\r\n&gt; save 60 10000\r\n&gt; latency-tracking-info-percentiles 50 99 99.9\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u53d6\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306e\u8a2d\u5b9a\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/ul>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/88-0.jpeg\" alt=\"redis_3_redis_diff.jpg\" \/><\/div>\n<pre class=\"post-pre\"><code>redissentinel-tokyo3:\/etc\/redis# diff  --suppress-common-lines sentinel.conf.before sentinel.conf.after\r\n12,14c12,14\r\n&lt; sentinel config-epoch mymaster 0\r\n&lt; sentinel leader-epoch mymaster 0\r\n&lt; sentinel current-epoch 0\r\n---\r\n&gt; sentinel config-epoch mymaster 1\r\n&gt; sentinel leader-epoch mymaster 1\r\n&gt; sentinel current-epoch 1\r\n26c26\r\n&lt; sentinel monitor mymaster 192.168.198.87 6379 2\r\n---\r\n&gt; sentinel monitor mymaster 192.168.198.103 6379 2\r\n28c28\r\n&lt; sentinel known-replica mymaster 192.168.198.103 6379\r\n---\r\n&gt; sentinel known-replica mymaster 192.168.198.87 6379\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30de\u30b9\u30bf\u30fc\u3068\u30ec\u30d7\u30ea\u30ab\u306e IP \u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/ul>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/91-0.jpeg\" alt=\"redis_3_sentinel_diff.jpg\" \/><\/div>\n<h1>\u603b\u7ed3<\/h1>\n<p>redis-sentinel \u306f\u3001redis-server \u306e\u30de\u30b9\u30bf\u30fc\u30b5\u30fc\u30d0\u30fc\u306e\u969c\u5bb3\u3092\u691c\u51fa\u3057\u3001redis-server \u306e\u30de\u30b9\u30bf\u30fc\u30fb\u30ec\u30d7\u30ea\u30ab\u306e\u95a2\u4fc2\u3092\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u30ec\u30d7\u30ea\u30ab\u306f\u5e38\u306b\u30de\u30b9\u30bf\u30fc\u306e\u30b3\u30d4\u30fc\u3092\u6301\u3064\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30ec\u30d7\u30ea\u30ab\u304c\u30de\u30b9\u30bf\u30fc\u306b\u6607\u683c\u3059\u308b\u3068\u3001\u305d\u308c\u307e\u3067\u306b\u540c\u671f\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306f\u5f15\u304d\u7d9a\u304d\u4f7f\u7528\u3067\u304d\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002\u30de\u30b9\u30bf\u30fc\u306e\u6607\u683c\u306b\u306f\u7d0430\u79d2\u304b\u304b\u308a\u3001\u305d\u306e\u9593\u306fRedis\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u66f8\u304d\u8fbc\u307f\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redis Sentinel\u662f\u4e00\u79cd\u9ad8\u53ef\u7528\u6027\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5230\u4e3b\u670d\u52a1\u5668\u7684\u6545\u969c\uff0c\u5e76\u52a8\u6001\u5730\u5c06\u590d\u5236\u54c1\u5347\u7ea7\u4e3a\u4e3b\u670d\u52a1\u5668 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33675","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u786e\u8ba4-redis-sentinel-\u7684\u8fd0\u884c\u60c5\u51b5\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5\" \/>\n<meta property=\"og:description\" content=\"Redis Sentinel\u662f\u4e00\u79cd\u9ad8\u53ef\u7528\u6027\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5230\u4e3b\u670d\u52a1\u5668\u7684\u6545\u969c\uff0c\u5e76\u52a8\u6001\u5730\u5c06\u590d\u5236\u54c1\u5347\u7ea7\u4e3a\u4e3b\u670d\u52a1\u5668 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u786e\u8ba4-redis-sentinel-\u7684\u8fd0\u884c\u60c5\u51b5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-13T08:26:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T11:15:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/1-0.jpeg\" \/>\n<meta name=\"author\" content=\"\u96c5, \u609f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u96c5, \u609f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/\",\"name\":\"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-02-13T08:26:08+00:00\",\"dateModified\":\"2024-05-04T11:15:53+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6\",\"name\":\"\u96c5, \u609f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g\",\"caption\":\"\u96c5, \u609f\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u786e\u8ba4-redis-sentinel-\u7684\u8fd0\u884c\u60c5\u51b5\/","og_locale":"zh_CN","og_type":"article","og_title":"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5","og_description":"Redis Sentinel\u662f\u4e00\u79cd\u9ad8\u53ef\u7528\u6027\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u53ef\u4ee5\u68c0\u6d4b\u5230\u4e3b\u670d\u52a1\u5668\u7684\u6545\u969c\uff0c\u5e76\u52a8\u6001\u5730\u5c06\u590d\u5236\u54c1\u5347\u7ea7\u4e3a\u4e3b\u670d\u52a1\u5668 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u786e\u8ba4-redis-sentinel-\u7684\u8fd0\u884c\u60c5\u51b5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-02-13T08:26:08+00:00","article_modified_time":"2024-05-04T11:15:53+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d192237434c4406c084ce\/1-0.jpeg"}],"author":"\u96c5, \u609f","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u96c5, \u609f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/","name":"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-02-13T08:26:08+00:00","dateModified":"2024-05-04T11:15:53+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u786e\u8ba4 Redis Sentinel \u7684\u8fd0\u884c\u60c5\u51b5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/f044a4b7fa4ee2701702942002419ca6","name":"\u96c5, \u609f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e71a913e914f1aad1efc391f92084294bac54bc782acd289638580134cf667a6?s=96&d=mm&r=g","caption":"\u96c5, \u609f"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yawu\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%a1%ae%e8%ae%a4-redis-sentinel-%e7%9a%84%e8%bf%90%e8%a1%8c%e6%83%85%e5%86%b5\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=33675"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33675\/revisions"}],"predecessor-version":[{"id":100177,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/33675\/revisions\/100177"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=33675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=33675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=33675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}