linux-tutorial/docs/deploy/tool/redis/install-redis.md

51 lines
914 B
Markdown
Raw Normal View History

2018-02-24 14:16:40 +08:00
# Redis 安装
## 安装
安装步骤如下:
1下载并解压到本地
进入官网下载地址https://redis.io/download ,选择合适的版本下载。
我选择的是最新稳定版本 4.0.8http://download.redis.io/releases/redis-4.0.8.tar.gz
我个人喜欢存放在:`/opt/software/redis`
```
wget -O /opt/software/redis/redis-4.0.8.tar.gz http://download.redis.io/releases/redis-4.0.8.tar.gz
cd /opt/software/redis
tar zxvf redis-4.0.8.tar.gz
```
2编译安装
执行以下命令:
```
cd /opt/software/redis/redis-4.0.8
make
```
## 启动
**启动 redis 服务**
```
cd /opt/software/redis/redis-4.0.8/src
./redis-server
```
**启动 redis 客户端**
```
cd /opt/software/redis/redis-4.0.8/src
./redis-cli
```
## 脚本
以上两种安装方式,我都写了脚本去执行:
| [安装脚本](https://github.com/dunwu/linux/tree/master/codes/deploy/tool/redis) |