当前位置:网站首页>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
- Opening soon | openatom openharmony sub forum of 2022 open atom global open source summit "interconnection of all things, enabling thousands of industries"
- 【云原生】快速了解Kubernetes
- 。 When calling, the incoming t refers to the Devi pass, which basically asks T2,
- Cve-2022-29464 wso2 file upload vulnerability
- Extend the connection boundary, expand the business scope, and comprehensively move towards the era of Intelligent Cloud network 2.0
- Remember an online sql deadlock accident: how to avoid deadlock?
- Sqlserver backup restore
- Matlab sound signal processing frequency diagram signal filtering and playing sound
- Arduino interrupt realizes rising edge detection and executes other functions
猜你喜欢

Convert the pseudo array returned by childNodes into a true array

6-14 vulnerability exploitation rpcbind vulnerability exploitation
![[novice] develop a tab component that is easy to expand by hand](/img/67/ac0a0a4861f933e447a84c24f62e79.gif)
[novice] develop a tab component that is easy to expand by hand

Developers share mindspire Lite experience, one click image segmentation

Matlab sound signal processing frequency diagram signal filtering and playing sound

Preliminary use of swagger2

Common properties and traversal of trees and binary trees

I wrote code for openharmony, and the second phase of "code" pioneer officially opened!

MLP - Multilayer Perceptron

Listen for the scroll event @scroll of div
随机推荐
发送数据1010_1发人员通过 字节的
Leetcode (Sword finger offer) - 11. Minimum number of rotation array
QT ROS related operations (running Terminal instructions, publishing and subscribing to custom message topics or services, subscribing to images and displaying)
Technical dry goods | how difficult is data processing? Take a look at the solution provided by mindspire!
数据湖(十九):SQL API 读取Kafka数据实时写入Iceberg表
直播课堂系统04-创建service模块
jvm类加载过程简介说明
The value is 0. The other part includes but is not limited to the following. This question is
Prosci Lag3 antibody: improve in vitro research and help cancer immunotherapy
Scenario and value of data desensitization [summary]
6-15 vulnerability exploitation SMB rce remote command execution
组合数(阶乘的质因子的个数,组合数的计算)
Insider of LAN SDN hard core technology 22 Kang long regrets -- Specifications and restrictions (Part 2)
DOM相关的方法概念
Remember an online sql deadlock accident: how to avoid deadlock?
Convert the pseudo array returned by childNodes into a true array
mysql服务1主2从,主主,MHA配置详细步骤
Shengsi YiDianTong | deep learning analysis of classical convolutional neural network
How to prevent SQL injection in PHP applications
Pyth去初始化平均在很多机器学决策边界,始向总线上