vim /etc/resolv.conf
直接修改下面的信息,按下i键开始修改,在最后面添加,如果不设置gcc安装可能会失败
nameserver 8.8.8.8
按esc,输入:wq
安装GCC
yum -y install gcc automake autoconf libtool make
然后升级GCC
yum -y install centos-release-scl && 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
redis-6.2.5.tar.gz下载地址=https://cloud.189.cn/web/share?code=26nIjyABJFBb
cd /usr/local
解压
tar -zxvf redis-6.2.5.tar.gz
cd /usr/local/redis-6.2.5
修改/usr/local/redis-6.2.5/utils/install_server.sh,下面的文件注释掉
#bail if this system is managed by systemd
#_pid_1_exe="$(readlink -f /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
编译
make MALLOC=libc
安装地方
make install PREFIX=/usr/local/redis6
cd /usr/local
mkdir redis-cluster<