Centos7 安装Redis,报错[adlist.o] Error jemalloc/jemalloc.h: No such file or directory

redis官网

https://redis.io/download

安装

$ wget http://download.redis.io/releases/redis-5.0.4.tar.gz
$ tar xzf redis-5.0.4.tar.gz
$ cd redis-5.0.4
$ make

启动

src/redis-server

make时候可能报错

xx command not found

CentOS7默认没有安装gcc,这会导致我们无法make成功。使用yum安装:

yum -y install gcc

error: jemalloc/jemalloc.h: No such file or directory

原因是jemalloc重载了Linux下的ANSI C的malloc和free函数。解决办法:make时添加参数。

make MALLOC=libc

make之后,会出现一句Hint提示

Hint: To run 'make test' is a good idea ;)
但是不测试,通常是可以使用的。若我们运行make test ,会有如下提示

$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: ***[test] Error_1

解决办法是用yum安装tcl8.5(或去tcl的官方网站http://www.tcl.tk/下载8.5版本,并参考官网介绍进行安装)

yum install tcl

安装完之后再次执行测试

$ make test
.......
\o/ All tests passed without errors!

Cleanup: may take some time... OK
make[1]: Leaving directory `/usr/local/redis-5.0.4/src'

redis设置密码

临时生效

# ./redis-cli 
127.0.0.1:6379> config set requirepass 123456
OK
127.0.0.1:6379> 

永久生效

需更改redis.conf配置文件
requirepass passwoord
重启redis后生效

转载于:https://www.cnblogs.com/aresxin/p/Centos7-an-zhuangRedis-bao-cuo-adlisto-Error-jemal.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值