`

redis安装

阅读更多

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,完成安装

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics