Centos7.x安装 Redis 5.0.9

    1. # 解压redis-5.0.9
    2. tar -zxvf redis-5.0.9.tar.gz
    3. # 编译redis
    4. make
    5. # 安装到指定目录
    6. make PREFIX=/usr/local/resources/redis-5.0.9 install
    7. # 修改配置文件redis.conf
    8. bind 0.0.0.0 -- 绑定访问IP地址
    9. daemonize yes -- 设置后台启动
    10. dir /usr/local/resources/redis-5.0.9/data -- 设置默认工作空间(数据存储位置)
    11. requirepass yuluomoshang -- 设置redis登录密码
    12. pidfile /usr/local/resources/redis-5.0.9/run/redis_6379.pid
    13. # 修改启动脚本redis_init_script
    14. EXEC=/usr/local/resources/redis-5.0.9/bin/redis-server
    15. CLIEXEC=/usr/local/resources/redis-5.0.9/bin/redis-cli
    16. PIDFILE=/usr/local/resources/redis-5.0.9/run/redis_6379.pid
    17. CONF="/usr/local/resources/redis-5.0.9/conf/redis.conf"
    18. # 修改stop指令中对应参数
    19. $CLIEXEC -a "yuluomoshang" -p $REDISPORT shutdown