redis 6.0 安装过程中遇到的问题以及解决方案
1.安装过程中gcc已经提示为最新版,但是make时依然报错,以下为其中一段报错信息:
server.c:2896:27: error: ‘struct redisServer’ has no member named ‘tlsfd_count’ for (j = 0; j <
解决方案:
升级gcc:
1:yum -y install centos-release-scl
2:yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
3:scl enable devtoolset-9 bash
然后清除之前的编译 make distclean,然后重新 make 解决问题
2.在执行 make install PREFIX=/opt/soft/redis6发生提示信息:
This systems seems to use systemd.
Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!
解决方案: 包系统默认的脚本注释掉一段
#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
3.配置REDIS_HOME 环境变量,vi /etc/profile 在尾部追加以下代码 ,然后source /etc/profile
export REDIS_HOME=/opt/soft/redis6
export PATH=$PATH:$REDIS_HOME/bin
4.进入 redis解压目录,我是的/root/soft/redis-6.0.6/utils
启动./install_server.sh 成功注册并启动redis 服务,进入/etc/init.d 可以看到redis_6379