下载 Redis6.0
华为镜像站Redis各版本列表:https://mirrors.huaweicloud.com/redis/
官方镜像站Redis各版本列表:http://download.redis.io/releases/
华为镜像站 Redis : https://mirrors.huaweicloud.com/redis/redis-6.0.5.tar.gz (加速)
Redis官方下载地址:http://download.redis.io/releases/redis-6.0.5.tar.gz (Stable版本)
编译安装 Redis6.0
#!/bin/bash
set -u -e
yum -y install gcc centos-release-scl cmake wget tcl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile && source /etc/profile && gcc -v
wget https://mirrors.huaweicloud.com/redis/redis-6.0.4.tar.gz && tar -xf redis-6.0.4.tar.gz && cd redis-6.0.4/
mkdir -p /usr/local/redis/conf && cp sentinel.conf redis.conf /usr/local/redis/conf/
make -j
make install PREFIX=/usr/local/redis
cd /usr/local/redis/bin && ls
启动 Redis6.0
#!/bin/bash
sed -i 's/^daemonize no/daemonize yes/' /usr/local/redis/conf/redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf
/usr/local/redis/bin/redis-cli
kill -9 `cat /var/run/redis_6379.pid`