您的位置:首页 > 数据库 > Redis

redis安装

2015-08-03 11:22 501 查看

1.官网下载redis-3.0.3.tar.gz

2.直接安装出错:

make[2]: cc: Command not found

没安装gcc,

 

解决:

yum install gcc-c++

 

3.再执行make命令:

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

zmalloc.h:55:2: error: #error "Newer version of jemalloc required"

 

说关于分配器allocator, 如果有MALLOC 这个 环境变量, 会有用这个环境变量的 去建立Redis。

而且libc 并不是默认的 分配器, 默认的是 jemalloc, 因为 jemalloc 被证明 有更少的 fragmentation problems 比libc。

但是如果你又没有jemalloc 而只有 libc 当然 make 出错。 所以加这么一个参数。

 

解决:

make MALLOC=libc

 

 

4.在src下面,可以看到以下接口

redis-server is the Redis Server itself.

redis-sentinel is the Redis Sentinel executable (monitoring and failover).

redis-cli is the command line interface utility to talk with Redis.

redis-benchmark is used to check Redis performances.

redis-check-aof and redis-check-dump are useful in the rare event of corrupted data files

 

 

可以将这些接口copy到其他的地方,方便执行,例如: cp src/redis-server /usr/local/bin/

 

 

5.启动,执行:redis-server,然后连接测试, 执行命令:redis-cli ping

显示:PONG,完成安装

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: