当前位置:网站首页>Redis sentinel mode, master node check script
Redis sentinel mode, master node check script
2022-07-24 03:58:00 【PlatoWG】
This script can be set to keepalived Check script for , To carry on VIP The drift of
The script content
redis-master-check.sh
#!/bin/bash
#Date:20220720
#By: PlatoWG
# $1 is redis server's IP ADDRESS;$2 is redis server's PORT;$3 is redis server's password
if [ -z "$(/usr/bin/redis-cli -h $1 -p $2 -a $3 INFO replication 2>/dev/null|grep "role:master")" ];then
echo -e "\033[31m$1:$2 is not master Redis\033[0m"
exit 1
else
echo -e "\033[32m$1:$2 is master Redis\033[0m"
exit 0
fi
Script testing
[[email protected] tmp]# ./redis-master-check.sh 192.168.137.51 7003 XXXXXXXX
192.168.137.51:7003 is not master Redis
[[email protected] tmp]# ./redis-master-check.sh 192.168.137.51 7002 XXXXXXXX
192.168.137.51:7002 is master Redis
[[email protected] tmp]# ./redis-master-check.sh 192.168.137.51 7001 XXXXXXXX
192.168.137.51:7001 is not master Redis
边栏推荐
- Vscode configuration user code snippet
- 6-14 vulnerability exploitation rpcbind vulnerability exploitation
- LAN SDN hard core technology insider 20 Kang long regrets -- Specifications and restrictions (Part 1)
- Technical dry goods | how difficult is data processing? Take a look at the solution provided by mindspire!
- Native JS realizes the acquisition and operation of DOM
- The value is 0. The other part includes but is not limited to the following. This question is
- (零八)Flask有手就行——数据库迁移Flask-Migrate
- 直播课堂系统04-创建service模块
- Y74. Chapter IV Prometheus large factory monitoring system and practice -- Introduction to promql and monitoring pod resources (V)
- 可能有点用的冷知识
猜你喜欢

Matlab Simulink hydropower and synchronous motor power generation

(008) flask is OK if you have a hand -- database migration flask migrate

Anchor point and anchor frame of target detection

H7-tool serial port offline burning operation instructions, support TTL serial port, RS232 and RS485 (2022-06-30)

buu web

PAT甲级 1040 Longest Symmetric String

Three cluster schemes of redis

Experiment 6 MPEG

一次 svchost.exe 进程占用大量网络带宽的排查
![Embedded system transplantation [6] - uboot source code structure](/img/dd/85e56360b08f49562a28ea6f6adcfd.png)
Embedded system transplantation [6] - uboot source code structure
随机推荐
An in-depth explanation of CAS is necessary for interview practice
三菱转以太网模块远创智控YC8000-FX 连接 MCGS操作方法
Redis
一次 svchost.exe 进程占用大量网络带宽的排查
Preliminary use of swagger2
What are Caicai and qiniu doing? Is it safe to open an account?
6-13 vulnerability exploitation -smtp brute force cracking
LAN SDN hard core technology insider 21 Kang long regrets -- Specifications and restrictions (middle)
Experiment 6 MPEG
Mitsubishi Ethernet module Yuanchuang intelligent control yc8000-fx connection MCGS operation method
Worthington mammalian lactate dehydrogenase study -- Characteristics and determination scheme
数据湖(十九):SQL API 读取Kafka数据实时写入Iceberg表
[novice] develop a tab component that is easy to expand by hand
DOM related method concepts
mongo从开始到安装以及遇到的问题
Matlab sound signal processing frequency diagram signal filtering and playing sound
LAN SDN hard core technology insider 20 Kang long regrets -- Specifications and restrictions (Part 1)
svg图片颜色的修改 没有花里胡哨
D2DEngine食用教程(3)———将渲染目标导出为图像文件
Redis