https://www.cnblogs.com/hunanzp/p/12304622.html

    1. 官网下载地址:https://redis.io/download

      1. cd /usr/local/src
      2. wget http://download.redis.io/releases/redis-5.0.7.tar.gz
    2. 解压

      1. cd /usr/local/src
      2. tar -zxvf redis-5.0.7.tar.gz
    3. 编译

      1. cd /usr/local/src/redis-5.0.7
      2. make
    4. 安装

      1. cd /usr/local/src/redis-5.0.7
      2. make PREFIX=/usr/local/redis install
      3. mkdir /usr/local/redis/data
    5. 修改配置文件

      1. mv /usr/local/src/redis-5.0.7/redis.conf /usr/local/redis/bin/redis.conf
      2. vim /usr/local/redis/bin/redis.conf
      3. # 修改端口号,默认6379
      4. port 6379
      5. # 启动方式,改为后台启动
      6. daemonize yes
      7. # 允许访问的主机地址
      8. bind * bind 0.0.0.0
      9. # 外部网是否可以连接,需要外部网络,改为no
      10. protected-mode no
      11. # 数据库存储位置
      12. dir /usr/local/redis/data
    6. 启动命令

      1. cd /usr/local/redis/bin/
      2. ./redis-server ./redis.conf
    7. 连接命令

      1. cd /usr/local/redis/bin/
      2. ./redis-cli