当前系统是Centos7
官网下载Redis并解压,没有wget命令的话,可以通过yum install wget 安装,
# wget https://download.redis.io/releases/redis-6.2.2.tar.gz
# tar xzf redis-6.2.2.tar.gz
压缩后执行make命令,期间报错,根据报错提示yum install 安装相应软件,执行make distclean 清理后 重新执行make
make成功后 ,进入src 执行 make install 会安装到默认 /usr/local/bin 下,这里我们安装到指定目录, make PREFIX=/opt/redis6 install
修改 # vi /etc/profile,增加redis的环境变量
验证下环境变量是否成功
# source /etc/profile
# echo $PATH
都没问题后执行进入utils目录下执行./install_server.sh,如果报如下错误 (之前安装redis5的时候没有出现这个问题)
编辑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
重新执行 ./install_server.sh
服务安装成功
客户端连接成功