Home  >  Article  >  Database  >  CentOS 6.5安装 Redis

CentOS 6.5安装 Redis

WBOY
WBOYOriginal
2016-06-07 16:40:43966browse

CentOS 6.5安装 Redis 版本:redis-2.8.19.tar.gz 检查下面依赖是否安装,如果没有要先安装,不然会有异常。 yum installgcc-c++

CentOS 6.5安装 Redis

版本:redis-2.8.19.tar.gz

检查下面依赖是否安装,,如果没有要先安装,不然会有异常。

yum installgcc-c++

yum install -y tcl。

1、获取安装文件

redis-2.8.19.tar.gz

2、解压文件

tar -xzvf redis-2.8.19.tar.gz

mv redis-2.8.19  /usr/local/redis

3、进入目录

cd redis

4、编译

make

5、安装

make install

6、设置配置文件路径

mkdir -p /etc/redis

cp redis.conf/etc/redis

7、修改配置文件

vi /etc/redis/redis.conf

仅修改: daemonize yes

8、启动

/usr/local/bin/redis-server/etc/redis/redis.conf

9、查看启动

ps -ef | grep redis 

10、使用客户端

redis-cli

>set namedavid

OK

11.关闭客户端

redis-cli  shutdown

12.异常及解决方法

异常一:

make[2]: cc:Command not found

异常原因:没有安装gcc

解决方案:yum install gcc-c++

异常二:

zmalloc.h:51:31:error: jemalloc/jemalloc.h: No such file or directory

异常原因:一些编译依赖或原来编译遗留出现的问题

解决方案:make distclean。清理一下,然后再make。

在make成功以后,需要make test。在make test出现异常。

异常一:

couldn'texecute "tclsh8.5": no such file or directory

异常原因:没有安装tcl

如果不先安装tcl在编译redis的时候,执行make test 会报以下错误,这步也可以省略,不执行make test 直接执行make install 对redis的启动和关闭没有什么影响。
[root@localhostredis]# make test
cd src &&make test
make[1]: Enteringdirectory `/usr/local/webserver/redis/src'
You need tcl 8.5 ornewer in order to run the Redis test
make[1]: *** [test]Error 1
make[1]: Leavingdirectory `/usr/local/webserver/redis/src'
make: *** [test]Error 2

Ubuntu 14.04下Redis安装及简单测试

Redis集群明细文档

Ubuntu 12.10下安装Redis(图文详解)+ Jedis连接Redis

Redis系列-安装部署维护篇

CentOS 6.3安装Redis

Redis安装部署学习笔记

Redis配置文件redis.conf 详解

Redis 的详细介绍:请点这里
Redis 的下载地址:请点这里

本文永久更新链接地址:

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn