第六阶段·数据库MySQL及NoSQL实践 第2章·Redis

  • 01-Redis简介

  • 02-Redis基本安装启动

  • 03-Redis的配置文件基本使用

  • 04-Redis安全管理

  • 05-Redis安全持久化-RDB持久化

  • 06-Redis安全持久化-AOF持久化

  • 07-Redis数据类型-介绍

  • 08-Redis数据类型-String类型应用

  • 09-Redis数据类型-Hash类型应用

  • 10-Redis数据类型-List类型应用

  • 11-Redis数据类型-Set类型应用

  • 12-Redis数据类型-Sorted_set类型应用

  • 13-Redis发布订阅-发布订阅模型介绍

  • 14-Redis发布订阅-发布订阅应用举例

  • 15-Redis事物及锁机制

  • 16-Redis服务器管理命令及全局key操作

  • 17-Redis主从复制介绍、工作过程以及sync-psync区别

  • 18-Redis主从复制-主从数据一致性保证

  • 19-Redis主从复制-1主2从构建

  • 20-Redis主从复制-主库宕机手工Failover

  • 21-Redis高可用架构-Sentinel工作机制介绍

  • 22-Redis高可用架构-Sentinel自动aliover测试

  • 23-Redis Cluster-介绍及基本工作机制

  • 24-Redis Cluster-集群构建过程

  • 25-Redis Cluster-集群节点管理

  • 26-Redis API支持-Python环境准备

  • 27-Redis-Python连接Redis多种架构

01-Redis简介

1.1 缓存数据库产品介绍

1.2 Redis与Memcached的对比;

  • 支持事务;
  • 数据类型丰富;
  • 支持持久化;
  • 支持高可用;
  • 支持分布式分片集群;

1.3 Memcached的优缺点;

1.4 Redis的应用场景;

02-Redis基本安装启动

2.1 下载及安装;

  • wget http://download.redis.io/releases/redis-3.2.12.tar.gz#下载;
  • tar zxvf redis-3.2.12.tar.gz#解压缩
  • cp -a redis-3.2.12 /usr/local/#拷贝到指定目录进行安装;

  • cd /usr/local/redis-3.2.12/src
  • make#编译安装Redis;
  • vim /etc/profile;export PATH=/usr/local/redis-3.2.12/src:$PATH#配置环境变量;
  • source /etc/profile
  • redis-server & #启动Redis;
  • redis-cli进入命令行环境;

2.2 配置环境变量并启动Redis;

2.3 Redis的端口号:6379

 

03-Redis的配置文件基本使用

3.1 redis配置文件的使用,通过redis-server指定redis的配置文件进行重新启动;

3.2 自定义redis.conf配置文件并添加配置;

04-Redis安全管理

4.1 Redis没有用户概念,只有密码;

4.2 redis默认工作在保护模式下,默认不允许远程连接;

4.3 远程用户可以登录到redis,但是无权操作;

(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions:
1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent.
 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 
3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 
4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

05-Redis安全持久化-RDB持久化

5.1 在线热修改一些配置:CONFIG SET *;CONFIG SET requirepass

5.2 Redis的RDB持久化;

  • 性能与数据安全性是相互矛盾的;

06-Redis安全持久化-AOF持久化

6.1 AOF持久化(append-only log file);

6.2 Redis持久化的方式有哪些?有什么区别呢?

  • RDB基于快照的方式进行数据的持久化,速度更快,一般用过备份;Redis的主从复制也是基于RDB持久化功能;
  • AOF持久化是以追加的方式记录Redis操作日志的文件,可以最大程度的保障Redis的数据安全,类似于MySQL中的binlog日志的作用;

07-Redis数据类型-介绍

08-Redis数据类型-String类型应用

09-Redis数据类型-Hash类型应用

10-Redis数据类型-List类型应用

11-Redis数据类型-Set类型应用

12-Redis数据类型-Sorted_set类型应用

13-Redis发布订阅-发布订阅模型介绍

14-Redis发布订阅-发布订阅应用举例

15-Redis事物及锁机制

16-Redis服务器管理命令及全局key操作

17-Redis主从复制介绍、工作过程以及sync-psync区别

18-Redis主从复制-主从数据一致性保证

19-Redis主从复制-1主2从构建

20-Redis主从复制-主库宕机手工Failover

21-Redis高可用架构-Sentinel工作机制介绍

22-Redis高可用架构-Sentinel自动aliover测试

23-Redis Cluster-介绍及基本工作机制

24-Redis Cluster-集群构建过程

25-Redis Cluster-集群节点管理

26-Redis API支持-Python环境准备

27-Redis-Python连接Redis多种架构

原文地址:https://www.cnblogs.com/tqtl911/p/9777079.html