Redis 常用命令
查看全部的keys
127.0.0.1:6379> KEYS *
(empty list or set)
查看前缀是xiao的信息
127.0.0.1:6379> KEYS "xiao*"
(empty list or set)
随机抽取一个key
127.0.0.1:6379> RANDOMKEY
(nil)
查看日志
127.0.0.1:6379> SLOWLOG get
(empty list or set)
127.0.0.1:6379> SLOWLOG get 10
(empty list or set)
查看redis 服务器的信息
127.0.0.1:6379> INFO
# Server
redis_version:3.2.3
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:ab05c86184ac1d8a
redis_mode:standalone
os:Linux 2.6.32-431.el6.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.7
process_id:2437
run_id:e21aeaa38b0aa04663ea96b3d6fe6dd773c9e905
tcp_port:6379
uptime_in_seconds:193
uptime_in_days:0
hz:10
lru_clock:9564347
executable:/opt/redis-3.2.3/src/./redis-server
config_file:
*************************
详细的请查看:http://blog.csdn.net/xfg0218/article/details/54813347
查看redis正在做什么
127.0.0.1:6379> MONITOR
OK
清除数据
127.0.0.1:6379> FLUSHALL
OK
192.168.215.156:7000> CLUSTER reset
OK
查看有多少key
127.0.0.1:6379> DBSIZE
<integer> 12344
Redis 内部工具
一下工具在Redis的安装目录下的src目录下
工具 描述
redis-server 服务端
redis-cli 客户端
redis-benchmark Redis性能测试工具
redis-check-aof AOF文件修复工具
redis-check-dump RDB文件检测工具
redis-sentinel Sentinel服务器(仅在2.8之后)