1
本文介绍了 RedisLinuxDcoker 中的安装和配置流程,Windows版的直接在 这里 下载解压即可使用,在此不做过多的描述

linux下安装

  1. 下载redis,在https://redis.io/https://github.com/antirez/re... 下载 redis-xxxx.tar.gz
  2. 解压,我这里下载的是 5.0.0 版本

    1. tar zxvf redis-5.0.0.tar.gz
  3. 安装依赖环境,需要安装gcc

    1. yum install gcc-c++
没有安装gcc在接下来的安装过程中会出现多处如下错误:

1.  `CC adlist.o`
2.  `/bin/sh: cc: 未找到命令`
3.  `make[1]: *** [adlist.o] 错误 127`
4.  `make[1]: 离开目录“/usr/local/redis/redis-5.0.0/src”`
5.  `make: *** [install] 错误 2`
  1. 解压后进入目录,在 /redis.5.0.0 目录下,执行

    1. make install
  2. 至此已经安装成功,拷贝一份 redis.conf,对 redis做相关的配置

    1. cp redis.conf ../redis.conf
回到命令所在的目录,启动redis,验证是否安装成功,执行 `redis-server redis.conf` 出现下述文字则表示安装成功:

1.  `[root@wangkai-centos redis]# redis-server redis-conf`
2.  `12241:C 24 Jan 2019 22:24:42.589 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo`
3.  `12241:C 24 Jan 2019 22:24:42.589 # Redis version=5.0.0, bits=64, commit=00000000, modified=0, pid=12241, just started`
4.  `12241:C 24 Jan 2019 22:24:42.589 # Configuration loaded`
5.  `12241:M 24 Jan 2019 22:24:42.590 * Increased maximum number of open files to 10032 (it was originally set to 1024).`
6.   `_._` 
7.   `_.-``__ ''-._` 
8.   ```_.-`` `.  `_. ''-._ Redis 5.0.0 (00000000/0) 64 bit```
9.  `.-`` .-```.  ```\/    _.,_ ''-._` 
10.  ``( '      ,       .-`  | `,    )     Running in standalone mode``
11.  ```|`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379```
12.  ``|    `-._ `._    /     _.-'    |     PID: 12241``
13.  `` `-._ `-._  `-./ _.-'    _.-'`` 
14.  ``|`-._`-._ `-.__.-'    _.-'_.-'|`` 
15.  ``|    `-._`-._        _.-'_.-'    |           http://redis.io`` 
16.  `` `-._ `-._`-.__.-'_.-' _.-'`` 
17.  ``|`-._`-._    `-.__.-' _.-'_.-'|`` 
18.  ``| `-._`-._        _.-'_.-' |`` 
19.  `` `-._    `-._`-.__.-'_.-'    _.-'`` 
20.   `` `-._ `-.__.-'    _.-'`` 
21.   `` `-._        _.-'`` 
22.   `` `-.__.-'`` 

使用docker

  1. 拉取Redis镜像

    1. docker pull redis
![image-20200625173344930](http://oss.fantasywk.tech/img/image-20200625173344930.png)
  1. 启动Redis容器

    1. docker run --name redis -d redis

image-20200625173419795



QuoVadis
11 声望5 粉丝