当前位置首页 > CentOS知识

在CentOS7中安装Redis3.2.8

阅读次数:257 次  来源:admin  发布时间:
文章环境:
CentOS 7 biuld 1611最小化安装@VMware
Redis 3.2.8

安装步骤:

#安装gcc
yum -y install gcc
#下载redis
curl -O  http://download.redis.io/releases/redis-3.2.8.tar.gz
#解压
tar -zxvf redis-3.2.8.tar.gz
#转换目录
cd redis-3.2.8/deps/
#编译依赖
make geohash-int hiredis jemalloc linenoise lua
#转换目录
cd ..
#编译Redis
make && make install
#转换目录
cd utils/
#使用脚本安装服务
./install_server.sh
#启动服务
systemctl start redis_6379
systemctl status redis_6379

#好了,就这些,尝试一下吧。

简单提示:

当前版本中需要编译的依赖有五项,更早或未来的版本可能会有不同。如果您没有编译这些项目,编译Redis会遇到错误。

fatal error: jemalloc/jemalloc.h: No such file or directory
cc: error: ../deps/hiredis/libhiredis.a: No such file or directory
cc: error: ../deps/lua/src/liblua.a: No such file or directory
cc: error: ../deps/geohash-int/geohash.o: No such file or directory
cc: error: ../deps/linenoise/linenoise.o: No such file or directory

在使用脚本安装服务的过程中,您可以一路【Enter】完成安装。之后您可以再次运行脚本文件,并通过输入不同的端口号建立多个Redis服务。

相关资源和参考:

博客文章:Install redis 3.0 from source on Ubuntu 14.04 / CentOS 7 / RHEL 7 CentOS官方网站:CentOS Project Redis官方网站:Redis Redis中文参考:Redis中文官方网站
上一篇:Ubuntu中如何在更新中解决cups卡死问题
下一篇:在thinkpadSL400上U盘安装双系统ubuntu14.10