在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
sentinel monitor advertise 192.168.0.5 28001 2 sentinel启动后需要手动将配置文件对应的调整为sentinel deny-scripts-reconfig no,否则不支持命令行runtime修改client-reconfig-script #sentinel deny-scripts-reconfig yes role命令 sentinel masters sentinel master monitor_name sentinel failover monitor_name sentinel moniotr <name> <ip> <port> <quorum> sentinel remove monitor_name sentinel set <mastername> [<option> <value>] 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哨兵常用命令的资料请关注极客世界其它相关文章! |
请发表评论