redis 6.0安装排坑

Redis 6.0安装排坑

Redis 下载路径:http://www.redis.cn/download.html

环境

  • 系统

CentOS Linux release 7.9.2009 (Core)

  • gc版本

4.8.5

报错

报错1:src/redis-server: No such file or directory

执行 src/redis-server` 启动Redis,报错src/redis-server: No such file or directory

原因: Redis是C实现的,需要gcc来进行编译,原因可能是未安装gcc,
解决方案: 使用命令安装gcc:yum install -y gcc
删除 Redis解压文件,重新解压编译 make

报错2:has no member named

在这里插入图片描述

原因: gcc版本过低
方案: 查看gcc的版本是否在 5.3以上,centos7默认是4.8.5.我这里的就是4.8.5
gcc -v

升级到 5.3及以上版本
yum -y install centos-release-scl


yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils


scl enable devtoolset-9 bash
注意:scl命令启用只是临时的,推出xshell或者重启就会恢复到原来的gcc版本。
如果要长期生效的话,执行如下:
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

protected mode because protected mode is enabled

redis-cli -h 127.0.0.1 -p 6379 正常访问,输入redis-cli -h IP(e.g 192.168.0.1) -p 6379 报错
(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients.

原因: protected-mode 和 bind 127.0.0.1配置问题
解决方案: redis.conf 里 找到 bind 127.0.0.1 配置行,加# 注释 # bind 127.0.0.1
protected-mode配置行 protected-mode yes 更改为 protected-mode no

参考

https://blog.csdn.net/hello_cmy/article/details/106062327
https://blog.csdn.net/tv002/article/details/87882347

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值