当前位置:网站首页>Redis查看客户端连接
Redis查看客户端连接
2022-07-03 07:42:00 【老王笔记】
单个实例查看客户端连接较为简单
client list
现在手上拿到几台物理机,每台物理机部署了100个实例,由于是以前遗留下来的实例,不知道能否下线,想知道这批机器是否有人使用?
如果想知道有没有人使用,就要连上去看看上面是否有客户端连接;
现在问题是系统里面部署了70多个实例,每个实例密码不一样; 总不能一个个通过端口连接每个实例,并一个个尝试密码;
首先获取所有port
ps -ef | grep redis | awk -F: '{print $NF}' > port.list
获取所有密码
grep pass */*.conf | awk '{print $NF}' | sort | uniq > auth.list
循环遍历每个密码和端口,尝试连接,并获取连接信息
#!/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
边栏推荐
- Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition
- PgSQL converts string to double type (to_number())
- Structure of golang
- Technical dry goods Shengsi mindspire lite1.5 feature release, bringing a new end-to-end AI experience
- yarn link 是如何帮助开发者对 NPM 包进行 debug 的?
- Go language foundation ----- 02 ----- basic data types and operators
- Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico
- Beginners use Minio
- Go language foundation ----- 05 ----- structure
- 截图工具Snipaste
猜你喜欢
技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
Technical dry goods Shengsi mindspire innovation model EPP mvsnet high-precision and efficient 3D reconstruction
HDMI2.1与HDMI2.0的区别以及转换PD信号。
Robots protocol
PAT甲级 1029 Median
Go language foundation ----- 06 ----- anonymous fields, fields with the same name
HarmonyOS第三次培训笔记
PAT甲级 1032 Sharing
【MySQL 12】MySQL 8.0.18 重新初始化
Why is data service the direction of the next generation data center?
随机推荐
Leetcode 213: 打家劫舍 II
Read config configuration file of vertx
技术干货|昇思MindSpore可变序列长度的动态Transformer已发布!
Leetcode 213: looting II
Collector in ES (percentile / base)
Industrial resilience
Implementation of breadth first in aggregation in ES
项目经验分享:基于昇思MindSpore,使用DFCNN和CTC损失函数的声学模型实现
PHP微信抢红包的算法
The babbage industrial policy forum
Hnsw introduction and some reference articles in lucene9
go语言-循环语句
Analysis of the eighth Blue Bridge Cup single chip microcomputer provincial competition
哪一刻你才发现青春结束了
Technical dry goods Shengsi mindspire innovation model EPP mvsnet high-precision and efficient 3D reconstruction
技术干货|昇思MindSpore NLP模型迁移之Roberta ——情感分析任务
技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
Some basic operations of reflection
项目经验分享:实现一个昇思MindSpore 图层 IR 融合优化 pass
Es writing fragment process