Csuper Blog

Csuper Blog

redis 状态监测
2021-06-07

检测后台进程是否存在

ps -ef |grep redis

 

检测6379端口是否在监听

netstat -lntp | grep 6379

 

使用redis-cli客户端检测连接是否正常

查看redis状态:


systemctl status redis

 

测试一下客户端存取是否正常:


redis-cli

127.0.0.1:6379> keys *

(empty list or set)

127.0.0.1:6379> set key "hello world"

OK

127.0.0.1:6379> get key

"hello world"

 

停止redis:

#停止

systemctl stop redis

#启动

systemctl start redis

#重新载入

systemctl reload redis