🔖 Redis 安装脚本和文档

pull/11/head
Zhang Peng 2018-02-24 14:16:40 +08:00
parent d2bff8d484
commit 2d6f13c903
4 changed files with 76 additions and 5 deletions

View File

@ -48,3 +48,4 @@
* Maven 安装和配置:| [CODES](codes/deploy/tool/maven) | [DOCS](docs/deploy/tool/maven/install-maven.md) |
* Nginx 安装和配置:| [CODES](codes/deploy/tool/nginx) | [DOCS](docs/deploy/tool/nginx/install-nginx.md) |
* Nodejs 安装和配置:| [CODES](codes/deploy/tool/nodejs) | [DOCS](docs/deploy/tool/nodejs/install-nodejs.md) |
* Redis 安装和配置:| [CODES](codes/deploy/tool/redis) | [DOCS](docs/deploy/tool/redis/install-redis.md) |

View File

@ -0,0 +1,11 @@
# 安装 Redis
使用方法:
```sh
wget --no-check-certificate --no-cookies https://raw.githubusercontent.com/dunwu/linux/master/codes/deploy/tool/redis/install-redis.sh
chmod -R 777 install-redis.sh
./install-redis.sh
```
脚本会下载解压 redis 到 `/opt/software/redis` 路径下。

View File

@ -1,12 +1,21 @@
#!/usr/bin/env bash
###################################################################################
# 安装 Redis 脚本
# 适用于所有 linux 发行版本。
# Author: Zhang Peng
###################################################################################
echo -e "\n>>>>>>>>> install redis"
mkdir -p /opt/software/redis
cd /opt/software/redis
# 下载并解压 redis
root=/opt/software/redis
version=4.0.8
wget http://download.redis.io/releases/redis-${version}.tar.gz
tar -zxvf redis-${version}.tar.gz
mkdir -p ${root}
wget -O ${root}/redis-${version}.tar.gz http://download.redis.io/releases/redis-${version}.tar.gz
cd ${root}
tar zxvf redis-${version}.tar.gz
# 编译
cd redis-${version}
make

View File

@ -0,0 +1,50 @@
# 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) |