当前位置:   article > 正文

redis笔记_狂神 redis

狂神 redis

1.String

Set get getset exists append strlen 
incr decr incrby decrby 
getrange setrange
setex ttl setnx
mset mget msetnx
  • 1
  • 2
  • 3
  • 4
  • 5

2.List

lpush rpush lrange
lpop rpop lindex
llen lrem ltrim rpoplpush
lset linsert
  • 1
  • 2
  • 3
  • 4

3.Set

sadd smembers sismember
scard srem srandmember
spop smove
Sdiff sinter sunion
  • 1
  • 2
  • 3
  • 4

4.Hash

hset hget hmset hmget hgetall
hdel hlen hexists
hkeys hvals
hincrby hsetnx
  • 1
  • 2
  • 3
  • 4

5.Zset

zadd zrange zrem zcard zcount
zrangebyscore zrevrange
  • 1
  • 2

6.Geospatial

geoadd geopos geodist geohash georadius georadiusbymember
  • 1

7.Hyperloglog

pfadd pfmerge pfcount
  • 1

8.Bitmap

setbit getbit bitcount
  • 1

9.事务

multi discard exec
  • 1

10.乐观锁

watch unwatch
  • 1

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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

12.Springboot整合

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

RedisTemplate
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

13.持久化

rdb (Redis DataBase)
aof (Append only File)
  • 1
  • 2

14.发布订阅

SUBSCRIBE
PUBLISH
  • 1
  • 2

15.主从复制

SLAVEOF host port
SLAVEOF no one
INFO replication
  • 1
  • 2
  • 3

16.哨兵模式

#sentinel.conf
sentinel monitor redis 127.0.0.1 6370 1
#启动哨兵
redis-sentinel sentinel.conf
  • 1
  • 2
  • 3
  • 4

17.高可用问题
缓存穿透:布隆过滤器 缓存空对象
缓存击穿:热点数据永不过期 互斥锁
缓存雪崩:redis高可用 限流降级 数据预热
18.MISCONF Redis is configured to save RDB snapshots

config set stop-writes-on-bgsave-error no
  • 1
狂神Redis视频地址 https://www.bilibili.com/video/BV1S54y1R7SB
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/673627
推荐阅读
相关标签
  

闽ICP备14008679号