Redis缓存练手

1. 下载Redis源码(tar.gz),并上传到Linux

2. 解压缩包:tar zxvf redis-2.8.17.tar.gz

3. 进入解压缩后的文件夹:cd redis-2.8.17

4. 编译源码:make

(1)若出现如下提示,则说明未安装gcc,使用命令安装gcc:yum install gcc

[root@localhost redis-2.8.17]# make
cd src && make all
make[1]: Entering directory `/root/redis-2.8.17/src‘
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/root/redis-2.8.17/src‘
make: *** [all] Error 2

我报的是(1)中的错,于是执行yum install gcc ,又报错

http://mirrors.cloud.aliyuncs.com/centos/%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.cloud.aliyuncs.com'"等等 ,貌似是阿里云服务器上出错,于是按照下面的链接 修改

https://blog.csdn.net/fx_yzjy101/article/details/79728476



(2)若出现如下提示,则将make改为make MALLOC=libc,推测是因为编译库的问题。

[root@localhost redis-2.8.17]# make
cd src && make all
make[1]: Entering directory `/root/redis-2.8.17/src‘
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/redis-2.8.17/src‘
make: *** [all] Error 2
---------------------

猜你喜欢

转载自www.cnblogs.com/maowuyu-xb/p/10735939.html