当前位置:网站首页>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
边栏推荐
- 【开发笔记】基于机智云4G转接板GC211的设备上云APP控制
- URL programming
- HCIA notes
- PAT甲级 1032 Sharing
- PAT甲级 1027 Colors in Mars
- Vertx multi vertical shared data
- Go language foundation ----- 07 ----- method
- Go language foundation ------ 14 ------ gotest
- Go language foundation ----- 16 ----- goroutine, GPM model
- How long is the fastest time you can develop data API? One minute is enough for me
猜你喜欢

技术干货|AI框架动静态图统一的思考

HCIA notes

Go language foundation ----- 07 ----- method

技术干货|昇思MindSpore NLP模型迁移之Bert模型—文本匹配任务(二):训练和评估

Go language foundation ----- 03 ----- process control, function, value transfer, reference transfer, defer function

Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition

HarmonyOS第三次培训笔记

Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition

Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition

【开发笔记】基于机智云4G转接板GC211的设备上云APP控制
随机推荐
Technical dry goods | hundred lines of code to write Bert, Shengsi mindspire ability reward
How long is the fastest time you can develop data API? One minute is enough for me
不出网上线CS的各种姿势
yarn link 是如何帮助开发者对 NPM 包进行 debug 的?
【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机
IndexSort
[Development Notes] cloud app control on device based on smart cloud 4G adapter gc211
An overview of IfM Engage
哪一刻你才发现青春结束了
PAT甲级 1027 Colors in Mars
[coppeliasim4.3] C calls UR5 in the remoteapi control scenario
Common operations of JSP
Pgadmin 4 v6.11 release, PostgreSQL open source graphical management tool
【MySQL 13】安装MySQL后第一次修改密码,可以可跳过MySQL密码验证进行登录
Logging log configuration of vertx
Grpc message sending of vertx
Industrial resilience
Go language foundation ----- 01 ----- go language features
Image recognition and detection -- Notes
Robots protocol