wget http://download.redis.io/redis-stable.tar.gz
tar -zxvf redis-stable.tar.gz
cd redis-stable
make
make install
vi redis.conf
修改#bind 127.0.0.1
修改protected-mode no
redis-server
redis-cli shutdown
redis-server redis.conf
后台启动
redis-server &
设置密码
redis-cli -p 6379
config set requirepass 123
编译可能报错
[code="java"]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[/code]
原因是jemalloc重载了Linux下的ANSI C的malloc和free函数
解决办法是make时添加参数
make MALLOC=libc
本文介绍如何使用wget下载Redis稳定版并进行安装配置的过程。包括编译安装、后台启动及设置密码等步骤。针对可能出现的jemalloc编译错误,提供了解决方案。
1100

被折叠的 条评论
为什么被折叠?



