redis-server, redis-cli 命令详解
发布日期:2021-05-10 01:33:14 浏览次数:20 分类:精选文章

本文共 1421 字,大约阅读时间需要 4 分钟。

1. redis-server 常用参数

--port 6666   # 指定端口启动 --slaveof 127.0.0.1 8888  # 从节点启动 --sentinel  # 哨兵模式启动

2. redis-cli 常用参数

-h 
redis-server服务ip (default: 127.0.0.1). -p
redis-server服务端口 (default: 6379). -a
登录密码 -x 从STDIN读取, 作为命令最后一个参数. -r
重复执行repeat次 -i
与-r同时使用, 设置interval间隔时间 -n
Database number. --csv Output in CSV format. --slave 模拟为slave节点 --rdb
让server端生成RDB文件, 传输并存储到本地filename中 --pipe Transfer raw Redis protocol from stdin to server. --pipe-timeout
In --pipe mode, abort with error if after sending all data. no reply is received within
seconds. Default timeout: 30. Use 0 to wait forever. --bigkeys Sample Redis keys looking for big keys. --scan List all keys using the SCAN command. --pattern
Useful with --scan to specify a SCAN pattern. --eval
Send an EVAL command using the Lua script at
.

3. 常用命令

redis-server  # 以默认配置启动  redis-server --port 6666   # 指定端口启动  redis-server /path/redis.conf  # 指定配置文件启动  redis-server --port 7777 --slaveof 127.0.0.1 8888  # 从节点启动  redis-server /etc/sentinel.conf --sentinel  # 哨兵模式启动  cat /etc/passwd | redis-cli -x set mypasswd  redis-cli get mypasswd  redis-cli -r 100 lpush mylist x  redis-cli -r 100 -i 1 info | grep used_memory_human:  redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3  redis-cli --scan --pattern '*:12345*'
上一篇:redis 常见类型及命令详解
下一篇:redis 安装详解

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年03月31日 21时38分27秒