CentOS7安装redis-6.0.12报错处理

因为redis6以上的版本需要gcc大于5.3,而CentOS7默认安装4.8.5
gcc -v
#升级gcc
#yum -y install centos-release-scl 【不需要执行】

因为Centos 7已经停止维护了,所以要修改下源
有的话使用vim编辑该文件:
vim CentOS-SCLo-scl-rh.repo

将[centos-sclo-rh]下的内容改为下面内容:
[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=http://vault.centos.org/centos/7/sclo/$basearch/rh/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
#scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
scl enable devtoolset-9 bash
#查看gcc版本是否已被升级
gcc -v
#重新执行编译安装命令即可

其他报错处理
1、
vim /etc/sysctl.conf
最后添加
vm.overcommit_memory=1
net.core.somaxconn=1024
sysctl -p

2、
echo never > /sys/kernel/mm/transparent_hugepage/enabled

#编辑启动脚本
vim /etc/rc.local

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi

下载参考:
https://download.redis.io/releases/redis-6.0.12.tar.gz
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.32.tar.gz
https://cdn.mysql.com/archives/mysql-5.7/mysql-boost-5.7.32.tar.gz


分享到:

网友留言(0 条)

发表评论

验证码