我已經建立了一個redis主 - 從集羣監控Linux上的debian(使用拉伸backports:redis v4.0.2)HA。redis sentinel客戶端重新配置腳本沒有觸發
Sentinel工作正常,當我關閉三個節點中的一個時,另一個節點被選爲新的主節點。
現在我嘗試設置一個reconfig腳本來通知新主設備的客戶端。
我創建在/var/redis/test.sh可讀和運行(chmod一個+ RX)腳本然後我在/etc/redis/sentinel.conf加入這樣的線在我3個前哨淋巴結:
sentinel client-reconfig-script mymaster /var/redis/test.sh
看着一個sentinel master mymaster
命令哨兵配置,我可以證實,客戶端重新配置腳本很好配置:
10.2.0.6:26379> sentinel master mymaster
...
43) "client-reconfig-script"
44) "/var/redis/test.sh"
然而,當發生故障轉移時,我重新配置腳本不會被觸發。我想知道爲什麼。這裏是哨兵日誌:
29765:X 16 Oct 23:03:11.724 # Executing user requested FAILOVER of 'mymaster'
29765:X 16 Oct 23:03:11.724 # +new-epoch 480
29765:X 16 Oct 23:03:11.724 # +try-failover master mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:11.777 # +vote-for-leader 5a0661a5982701465a387b4872cfa4c576edbd38 480
29765:X 16 Oct 23:03:11.777 # +elected-leader master mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:11.777 # +failover-state-select-slave master mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:11.854 # +selected-slave slave 10.2.0.8:6379 10.2.0.8 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:11.854 * +failover-state-send-slaveof-noone slave 10.2.0.8:6379 10.2.0.8 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:11.910 * +failover-state-wait-promotion slave 10.2.0.8:6379 10.2.0.8 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:12.838 # +promoted-slave slave 10.2.0.8:6379 10.2.0.8 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:12.838 # +failover-state-reconf-slaves master mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:12.893 * +slave-reconf-sent slave 10.2.0.6:6379 10.2.0.6 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:13.865 * +slave-reconf-inprog slave 10.2.0.6:6379 10.2.0.6 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:13.865 * +slave-reconf-done slave 10.2.0.6:6379 10.2.0.6 6379 @ mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:13.937 # +failover-end master mymaster 10.2.0.7 6379
29765:X 16 Oct 23:03:13.937 # +switch-master mymaster 10.2.0.7 6379 10.2.0.8 6379
29765:X 16 Oct 23:03:13.937 * +slave slave 10.2.0.6:6379 10.2.0.6 6379 @ mymaster 10.2.0.8 6379
29765:X 16 Oct 23:03:13.937 * +slave slave 10.2.0.7:6379 10.2.0.7 6379 @ mymaster 10.2.0.8 6379
我可以有一個丟失的配置選項?
附加信息:我在幾個星期前(Redis的4.0.1)安裝了一個類似的架構,它的工作(我的意思是這是我的射擊腳本重新配置),但我沒有保存配置,所以我可以有錯過了什麼。或者...可能是v4.0.2中引入的錯誤?