Redis学习(六)---配置文件(redis.conf)详解

前言

redis的使用肯定离不开他的配置,一个工具的使用,首先要学会配置它,name这个工具才能更有效的发挥它的作用

配置信息

Redis学习(六)---配置文件(redis.conf)详解
Redis学习(六)---配置文件(redis.conf)详解

网络配置(NETWORK)

Redis学习(六)---配置文件(redis.conf)详解

通用配置(GENERAL)

Redis学习(六)---配置文件(redis.conf)详解

Redis学习(六)---配置文件(redis.conf)详解

快照(SNAPSHOTTING)

  • 持久化操作

Redis学习(六)---配置文件(redis.conf)详解
Redis学习(六)---配置文件(redis.conf)详解

主从复制(REPLICATION)

安全(SECURITY)

设置密码:

  • 除了下面这种方式我们还可以直接在客户端用命令设置
  • config get requirepass 获取密码
  • config set requirepass 【密码】设置密码密码
  • auth 【密码】 登入
    Redis学习(六)---配置文件(redis.conf)详解

客户端(CLIENTS)

Redis学习(六)---配置文件(redis.conf)详解

内存管理(MEMORY MANAGEMENT

Redis学习(六)---配置文件(redis.conf)详解
Redis学习(六)---配置文件(redis.conf)详解
六大策略:

  • volatile-lru:只对设置了过期时间的key进行LRU
  • allkeys-lru : 删除lru算法的key
  • volatile-random:随机删除即将过期key
  • allkeys-random:随机删除
  • volatile-ttl : 删除即将过期的
  • noeviction : 永不过期,返回错误

APPEND ONLY MODE(aof配置)

Redis学习(六)---配置文件(redis.conf)详解
Redis学习(六)---配置文件(redis.conf)详解