redis 编译安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/heiyouhei123/article/details/89046572

1 下载redis源码

$ wget http://download.redis.io/releases/redis-5.0.4.tar.gz
$ tar xzf redis-5.0.4.tar.gz
$ cd redis-5.0.4

2 编译安装

[root@localhost redis-5.0.4]# make && make install
cd src && make all
make[1]: Entering directory `/root/redis-5.0.4/src'
    CC Makefile.dep
make[1]: Leaving directory `/root/redis-5.0.4/src'
make[1]: Entering directory `/root/redis-5.0.4/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
...

3 遇到的坑

3.1 make提示 "make: cc: Command not found"
解决方式: 因为centos安装的时候,没有选择开发工具,所以现在需要手动下载开发工具的依赖

[root@localhost redis-5.0.4]# yum groupinstall 'Development Tools'

3.2 make提示"zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory"
解决方式:清理好环境文件

[root@localhost redis-5.0.4]# make distclean

猜你喜欢

转载自blog.csdn.net/heiyouhei123/article/details/89046572