你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 6.5安装 Redis

[日期:2014-12-31] 来源:Linux社区  作者:jameshadoop [字体:大 中 小]

CentOS 6.5安装 Redis

版本:redis-2.8.19.tar.gz

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

yum installgcc-c++

yum install -y tcl。

1、获取安装文件

redis-2.8.19.tar.gz

http://redis.io/download

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安装及简单测试 http://www.linuxidc.com/Linux/2014-05/101544.htm

Redis集群明细文档 http://www.linuxidc.com/Linux/2013-09/90118.htm

Ubuntu 12.10下安装Redis(图文详解)+ Jedis连接Redis http://www.linuxidc.com/Linux/2013-06/85816.htm

Redis系列-安装部署维护篇 http://www.linuxidc.com/Linux/2012-12/75627.htm

CentOS 6.3安装Redis http://www.linuxidc.com/Linux/2012-12/75314.htm

Redis安装部署学习笔记 http://www.linuxidc.com/Linux/2014-07/104306.htm

Redis配置文件redis.conf 详解 http://www.linuxidc.com/Linux/2013-11/92524.htm

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

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-12/111053.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款