「REDIS」- 服务部署 | 测试学习

该笔记将记录:如何快速部署用于学习和测试的 Redis 服务,以及相关问题的解决办法。

服务部署

on CentOS 7.0

Linux 下 redis 安装与使用

# 安装服务
yum install -y redis.x86_64

# 启动服务,并设置为自启动
systemctl start redis.service
systemctl enable redis.service

on AWS / with ElasticCache Redis OSS

Design your own cache / Cluster cache

访问测试

#!/bin/sh

# redis-cli
127.0.0.1:6379> SET k4nz demo
OK
127.0.0.1:6379> GET k4nz
"demo"
127.0.0.1:6379> DEL k4nz
(integer) 1
127.0.0.1:6379> GET k4nz
(nil)

服务升级

WIP

与 Redis 有关的命令

redis-server – 服务端程序

redis-cli – 客户端程序

redis-sentinel – 到 redis-server 的软链接,使 redis 运行于 Sentinel 模式,官方推荐的高可用性(HA)解决方案

redis-benchmark – 用于 Redis 的基准测试

redis-check-aof – 用于 Redis AOF 文件的检查和修复

redis-check-rdb – 用于 Redis RDB 文件的检查