记录linux装redis遇坑
环境
虚拟机:centos6
redis:redis-6.2.6
redis下载地址
$ tar xzf redis-6.2.6.tar.gz
$ cd redis-6.2.6
$ make
使用make是报错 ,redis是c写的没有c的环境
引入gcc
yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
发现也报错
是因为centos6已经不支持yum,更换yum源为阿里
更换yum源
yum更换 成功
引入c环境 成功
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
yum clean all
yum makecache
注意: 安装redis-6.0以上版本需要升级gcc到5.3及以上,所以给gcc升级
升级完
再次执行make操作 报错
jemalloc报错
在deps目录下,执行这个命令
make hiredis jemalloc linenoise lua geohash-int
同时 给make个参数 成功
make MALLOC=libc
运行
cd src
./redis-server