婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > redis哨兵常用命令和監控示例詳解

redis哨兵常用命令和監控示例詳解

熱門標簽:山東外呼銷售系統招商 十堰營銷電銷機器人哪家便宜 日本中國地圖標注 宿遷便宜外呼系統平臺 超呼電話機器人 貴州電銷卡外呼系統 鄭州人工智能電銷機器人系統 魔獸2青云地圖標注 北京400電話辦理收費標準

sentinel monitor advertise 192.168.0.5 28001 2
sentinel set advertise client-reconfig-script /etc/redis/reconfig.sh
sentinel flushconfig

sentinel啟動后需要手動將配置文件對應的調整為sentinel deny-scripts-reconfig no,否則不支持命令行runtime修改client-reconfig-script
# SECURITY
#
# By default SENTINEL SET will not be able to change the notification-script
# and client-reconfig-script at runtime. This avoids a trivial security issue
# where clients can set the script to anything and trigger a failover in order
# to get the program executed.

#sentinel deny-scripts-reconfig yes

role命令
查看sentinel monitor的master names名字

sentinel masters
查看所有監控master及其配置信息

sentinel master monitor_name
查看指定監控master及其配置信息

sentinel failover monitor_name
手動進行swithover切換主從,如果有多個slave會選擇哪個slave做為新的master,待測試?

sentinel moniotr name> ip> port> quorum>
添加監視的master

sentinel remove monitor_name
將監視的為name的master移除監視

sentinel set mastername> [option> value>]
修改監視的master的一些屬性
down-after-milliseconds 過了這個時間考慮master go down
failover-timeout 刷新故障轉移狀態的最大時間
parallel-syncs slave同時reconfigure的個數
notification-script 設置通知腳本
client-reconfig-script 設置通知腳本
auth-pass 執行auth的密碼
quorum 修改master的quorum

sentinel flushconfig

將sentinel信息寫入到配置文件中

sentinel配置文件示例:

daemonize yes
pidfile "/home/redis/sentinel/25000/redis.pid"
loglevel notice
protected-mode yes
bind 192.168.100.5
logfile "/home/redis/sentinel/25000/redis.log"
port 25000
dir "/home/redis/sentinel/25000"
# Generated by CONFIG REWRITE
sentinel myid 0338c4ceb7cf39a8037a22fa17d0f7a76923b5a0
sentinel deny-scripts-reconfig no
sentinel monitor advertise 192.168.100.5 28001 2
sentinel client-reconfig-script advertise /etc/redis/reconfig.sh
sentinel config-epoch advertise 4
sentinel leader-epoch advertise 4
sentinel known-replica advertise 192.168.100.6 28001
sentinel known-sentinel advertise 192.168.100.7 25000 06f937e1d35496dc66d2899e3b25e286ff91d658
sentinel known-sentinel advertise 192.168.100.6 25000 ede86ac0b7d2ff7b532d0e5352ba6e33dd36670e
 
sentinel monitor mymaster1 192.168.100.6 28002 2
sentinel client-reconfig-script mymaster1 /etc/redis/reconfig.sh
sentinel config-epoch mymaster1 5
sentinel leader-epoch mymaster1 1
sentinel known-replica mymaster1 192.168.100.5 28002
sentinel known-sentinel mymaster1 192.168.100.7 25000 06f937e1d35496dc66d2899e3b25e286ff91d658
sentinel known-sentinel mymaster1 192.168.100.6 25000 ede86ac0b7d2ff7b532d0e5352ba6e33dd36670e
sentinel current-epoch 5

sentinel client-reconfig-script腳本示例

#!/bin/bash
 
check_time=$(date +"%F-%T")
master_name="$1"
from_ip="$4"
from_port="$5"
to_ip="$6"
to_port="$7"
 
 
#填寫自己正確的機器人鏈接
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxx' \

   -H 'Content-Type: application/json' \

   -d '
   {
        "msgtype": "text",
        "text": {
            "content": "【'$check_time' '$master_name' redis failover】\nfrom\n'$from_ip:$from_port'\nto\n'$to_ip:$to_port'",
            "mentioned_list":["xiaodongl"]
        }
   }'

以上就是redis哨兵常用命令和監控的詳細內容,更多關于redis哨兵常用命令的資料請關注腳本之家其它相關文章!

您可能感興趣的文章:
  • Redis遍歷所有key的兩個命令(KEYS 和 SCAN)
  • PHP操作Redis常用命令的實例詳解
  • php操作redis命令及代碼實例大全
  • Redis常用數據類型命令實例匯總
  • redis中scan命令的基本實現方法
  • 詳解centos7 yum安裝redis及常用命令
  • 查看Redis內存信息的命令
  • Redis的KEYS 命令千萬不能亂用
  • 詳解Redis基本命令與使用場景

標簽:楊凌 北京 江蘇 吉安 臺州 大慶 果洛 朝陽

巨人網絡通訊聲明:本文標題《redis哨兵常用命令和監控示例詳解》,本文關鍵詞  redis,哨兵,常用,命令,和,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《redis哨兵常用命令和監控示例詳解》相關的同類信息!
  • 本頁收集關于redis哨兵常用命令和監控示例詳解的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 永修县| 隆回县| 贞丰县| 元谋县| 文山县| 黔江区| 隆回县| 彰化市| 泾川县| 宜昌市| 怀远县| 景洪市| 许昌市| 陇南市| 连江县| 都安| 胶州市| 石景山区| 云阳县| 合阳县| 江陵县| 洪泽县| 遵义市| 大连市| 中西区| 宜州市| 赫章县| 托克托县| 台湾省| 浦北县| 寿光市| 绿春县| 肇源县| 庆城县| 许昌市| 揭西县| 虞城县| 鄯善县| 于田县| 永和县| 肃宁县|