CentOS安装Redis

wenshifang 2019-02-21

wgethttp://download.redis.io/redis-stable.tar.gz

tar-zxvfredis-stable.tar.gz

cdredis-stable

make

makeinstall

viredis.conf

修改#bind127.0.0.1

修改protected-modeno

redis-server

redis-clishutdown

redis-serverredis.conf

后台启动

redis-server&

设置密码

redis-cli-p6379

configsetrequirepass123

编译可能报错

zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
                               ^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/software/redis-stable/src'
make: *** [all] Error 2

原因是jemalloc重载了Linux下的ANSIC的malloc和free函数

解决办法是make时添加参数

makeMALLOC=libc

相关推荐