CentOS7中安装redis5.0

Posted Angel_Kitty

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7中安装redis5.0相关的知识,希望对你有一定的参考价值。

1. 环境介绍

  • CentOS7 (未安装Development Tools)

2. 下载Redis5.0-rc3

wget -O redis-5.0-rc3.tar.gz https://github.com/antirez/redis/archive/5.0-rc3.tar.gz

3. 解压redis

tar -zxvf redis-5.0-rc3.tar.gz -C /usr/local

4. 编译并安装

cd /usr/local/redis-5.0-rc3
make

此时会出错:

compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/redis-5.0-rc3/src\'
make: *** [all] Error 2

安装Development Tools

yum groupinstall \'Development Tools\'

再次执行,还会报错

make
cd src && make all
make[1]: Entering directory `/usr/local/redis-5.0-rc3/src\'
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
                               ^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/redis-5.0-rc3/src\'
make: *** [all] Error 2

最后解决方案如下:

cd /usr/local/redis-5.0-rc3/deps; make hiredis lua jemalloc linenoise

编译完成后再次在/usr/local/redis-5.0-rc3中执行make命令

cd /usr/local/redis-5.0-rc3
make

出现如下即编译成功

Hint: It\'s a good idea to run \'make test\' 

以上是关于CentOS7中安装redis5.0的主要内容,如果未能解决你的问题,请参考以下文章

liunx安装redis5.0.3

在centos7中安装composer

Centos7搭建redis5.0.5集群

centos7.6 安装redis5.0.4 单机

如何在CentOS 7中安装Subversion

Centos7安装redis5.0.7