当前位置:网站首页>Redis view client connection
Redis view client connection
2022-07-03 07:45:00 【Lao Wang's notes】
It is easier to view the client connection for a single instance
client list
Now I have several physical machines in my hand , Each physical machine is deployed 100 An example , Because it is an example left over from the past , I don't know if I can get offline , I want to know whether these machines are used ?
If you want to know if anyone uses , Just connect it to see if there is a client connection ;
Now the problem is that the system is deployed 70 More than one instance , The password of each instance is different ; You can't connect each instance through ports one by one , And try the password one by one ;
First, get all port
ps -ef | grep redis | awk -F: '{print $NF}' > port.list
Get all passwords
grep pass */*.conf | awk '{print $NF}' | sort | uniq > auth.list
Loop through each password and port , Try to connect , And get connection information
#!/bin/bash
for auth in `cat auth.list`
do
#echo $x;
for port in `cat port.list`
do
#echo $x;
echo client list | /export/Data/redis/bin/redis-cli -h 127.0.0.1 -p $port -a $auth
done
done
边栏推荐
猜你喜欢
Pat class a 1032 sharing
项目经验分享:实现一个昇思MindSpore 图层 IR 融合优化 pass
【踩坑系列】mysql 修改root密码失败
Collector in ES (percentile / base)
Go language foundation ------ 12 ------ JSON
Technical dry goods Shengsi mindspire elementary course online: from basic concepts to practical operation, 1 hour to start!
Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
[mindspire paper presentation] summary of training skills in AAAI long tail problem
UA camouflage, get and post in requests carry parameters to obtain JSON format content
Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once
随机推荐
PAT甲级 1030 Travel Plan
Vertx metric Prometheus monitoring indicators
Grpc message sending of vertx
PHP微信抢红包的算法
华为交换机Console密码重置、设备初始化、默认密码
什么是定义?什么是声明?它们有何区别?
Analysis of the ninth Blue Bridge Cup single chip microcomputer provincial competition
Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico
lucene scorer
Go language foundation ----- 09 ----- exception handling (error, panic, recover)
Go language foundation ------ 12 ------ JSON
圖像識別與檢測--筆記
Industrial resilience
Lucene merge document order
【LeetCode】4. Best time to buy and sell stock
PAT甲级 1032 Sharing
Go language foundation ----- 10 ----- string related operations (operation function, string conversion)
Application of pigeon nest principle in Lucene minshouldmatchsumscorer
Technical dry goods Shengsi mindspire innovation model EPP mvsnet high-precision and efficient 3D reconstruction
Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition