redis安装

  1. 安装包下载

    wget https://download.redis.io/releases/redis-6.2.7.tar.gz
    
  2. 解压

    tar -zxvf redis-6.2.7.tar.gz
    
  3. 编译

    # redis解压目录执行make
    make
    

    此时可能会报错cc not found,此时需要执行步骤4安装gcc

  4. 安装gcc

    yum install gcc
    
  5. 再次编译,此时可能会报错,需要先clean

    # 清理
    make distclean
    # 编译
    make
    
  6. 将redis安装成操作系统的服务
    (1)安装redis命令

    make install PREFIX=/opt/redis
    

    (2)配置环境变量,vim /etc/profile,添加export REDIS_HOME=/opt/redis export PATH=$PATH:$REDIS_HOME/bin
    (3)加载环境变量

    source /etc/profile
    

    (4)安装服务

    # 进入redis的utils目录
    cd utils
    # 执行install_server.sh
    ./install_server.sh
    

    (5)此时报错,需要注释install_server.sh中如下代码

    #bail if this system is managed by systemd
    #_pid_1_exe=“KaTeX parse error: Expected 'EOF', got '#' at position 28: … /proc/1/exe)" #̲if [ "{_pid_1_exe##*/}” = systemd ]
    #then
    #echo “This systems seems to use systemd.”
    #echo “Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!”
    #exit 1
    #fi
    (6)重新安装,执行./install_server.sh,一路回车,至此redis服务安装完成

  7. 验证,进入/etc/init.d目录可以看到redis_6379

  8. 查看redis服务状态

    service redis_6379 status
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值