Lazy loaded image
大数据
🙅🏼‍♀️Redis入门基础
字数 8756阅读时长 22 分钟
2021-8-13
2025-8-13
type
status
date
slug
summary
tags
category
icon
password

Redis


一、Redis入门

1.1 redis介绍

notion image
notion image

1.2 安装

说明:安装和启动redis均使用root用户
  • 第三步: 安装gcc环境:我们需要将源码编译后再安装,因此需要安装c语言的编译环境!不能直接make!
  • 第四步:查看安装是否成功
notion image
notion image
  • 第五步:编译,执行make命令,安装gcc
  • 第六步:编译完成后,安装,执行make install命令!
notion image
notion image

1.3 启动

1.3.1 启动服务端

  1. 设置后台启动,修改/opt/module/redis-3.2.5/redis.conf文件
notion image
  1. 启动redis服务端
  1. 查询服务端是否开启
notion image
  1. 关闭服务端
notion image
  1. redis服务端的端口号为:6379
notion image

1.3.2 客户端登入

notion image

二、redis基本操作

2.1 基本操作

2.2 key操作

==redis所有的数据都是存储在内存中==

2.3 value的五大常用类型

key
value
value

2.3.1 String

  • 具体的操作

2.3.2 list

  • 具体的操作

2.3.3 set

2.3.4 hash

2.3.5 zset

三 、 Redis的配置说明

3.1 单位说明

notion image

3.2 include

notion image

3.3 network

3.4 general

3.5 其他

四、 持久化

4.1 RDB

4.1.1 RDB介绍

4.1.2 RDB的持久化触发条件

4.1.3 参数配置

4.1.4 RDB的优缺点

4.2 AOF

4.2.1 AOF简介

4.2.2 AOF保存数据的策略

4.2.3 配置参数

4.2.4 AOF文件的修复

4.2.5 AOF的优缺点

4.3 官方持久化建议

五、事务

5.1 redis的事务介绍

5.2 redis常用的命令

5.3 redis组队失败

5.4 Redis中的锁

六、主从复制

6.1 主从简介

6.2 主从准备

  • 6379.conf
  • 6380.conf
  • 6381.conf
  • base.conf
notion image
notion image
notion image
主从关系的配置:配从不配主。

6.3 主从建立

6.3.1 建立临时的主从关系

notion image
notion image

6.3.2 永久建立

6.3.3 恢复身份

6.4 常见问题

6.5 哨兵模式

七、集群模式

上一篇
治理考核评价实践总结
下一篇
Git入门基础