1.安装 及 资料
# ubuntu 下直接装
sudo apt-get install redis-server
playgroud:
http://try.redis.io/
中文资料:
官方文档的github:
https://github.com/antirez/redis-doc/tree/master/topics
Redis 设计与实现(第一版)(包括数据持久化):
https://redisbook.readthedocs.io/en/latest/index.html
入门 + 快速查询:
http://www.runoob.com/redis/redis-data-types.html
redis的适用场景:
https://www.jianshu.com/p/9cecff6042de
2.查看所有
# 查看 info
info
# info 中列出的每一项都可以 单独查询
info server
info clients
# 所有数据结构
keys *
# 所有channel
pubsub channels
# 切换数据库 0-15 ,默认为 0
select 1
3.数据结构
官方的说明(包括bitmap和阻塞list)https://redis.io/topics/data-types-intro
#list
lrange xxx 0 -1
#set
smembers xxx
#sort-set
zrange xxx 0 -1
#hash
hgetall xxx
4.sub pub
sub pattern 参考:
https://redisbook.readthedocs.io/en/latest/feature/pubsub.html
http://www.runoob.com/redis/redis-pub-sub.html