赞
踩
1.String
Set get getset exists append strlen
incr decr incrby decrby
getrange setrange
setex ttl setnx
mset mget msetnx
2.List
lpush rpush lrange
lpop rpop lindex
llen lrem ltrim rpoplpush
lset linsert
3.Set
sadd smembers sismember
scard srem srandmember
spop smove
Sdiff sinter sunion
4.Hash
hset hget hmset hmget hgetall
hdel hlen hexists
hkeys hvals
hincrby hsetnx
5.Zset
zadd zrange zrem zcard zcount
zrangebyscore zrevrange
6.Geospatial
geoadd geopos geodist geohash georadius georadiusbymember
7.Hyperloglog
pfadd pfmerge pfcount
8.Bitmap
setbit getbit bitcount
9.事务
multi discard exec
10.乐观锁
watch unwatch
11.Spring整合
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.2.0</version>
</dependency>
Jedis jedis = new Jedis("127.0.0.1", 6379)
12.Springboot整合
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
RedisTemplate
13.持久化
rdb (Redis DataBase)
aof (Append only File)
14.发布订阅
SUBSCRIBE
PUBLISH
15.主从复制
SLAVEOF host port
SLAVEOF no one
INFO replication
16.哨兵模式
#sentinel.conf
sentinel monitor redis 127.0.0.1 6370 1
#启动哨兵
redis-sentinel sentinel.conf
17.高可用问题
缓存穿透:布隆过滤器 缓存空对象
缓存击穿:热点数据永不过期 互斥锁
缓存雪崩:redis高可用 限流降级 数据预热
18.MISCONF Redis is configured to save RDB snapshots
config set stop-writes-on-bgsave-error no
狂神Redis视频地址 https://www.bilibili.com/video/BV1S54y1R7SB
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。