Redis安装集群的各种问题

本文汇总了Redis在安装、配置及集群部署过程中遇到的常见问题,包括编译错误、连接失败、配置不当等,并提供了详细的解决步骤,如安装gcc、调整配置文件、重启服务等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

常见问题
1.1 make: cc:命令未找到,make: *** [adlist.o] 错误 127

解决方法:安装gcc,命令如下:
yum install gcc

1.2 Redis编译错误Killing still running Redis server 4966

Killing still running Redis server 4966
Killing still running Redis server 4971
Killing still running Redis server 4976
Killing still running Redis server 4978
Killing still running Redis server 4980
Killing still running Redis server 4983
Killing still running Redis server 4990
Killing still running Redis server 4991
Killing still running Redis server 4998
Killing still running Redis server 5001
Killing still running Redis server 5014
Killing still running Redis server 5134
Killing still running Redis server 5187
Killing still running Redis server 5208
Killing still running Redis server 5224
Killing still running Redis server 5253
Killing still running Redis server 5265
make[1]: *** [test] Error 1
make[1]: Leaving directory `/opt/redis/redis-4.0.2/src'
make: *** [test] Error 2

解决方案:

vim tests/integration/replication-2.tcl
将after 1000修改为after 10000

1.3 MISCONF Redis is configured to save RDB snapshots

异常信息:
redis.clients.jedis.exceptions.JedisDataException: 
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. 
Commands that may modify the data set are disabled. 
Please check Redis logs for details about the error.

解决方案:
因为强制关闭Redis快照导致不能持久化。可以使用kill -9再次强制关闭掉redis,然后在重新启动。

1.4 Connection error: Connection refused

修改配置文件/etc/redis.conf,并注释掉bind 127.0.0.1这一行

1.5 Connection: Connection error: The remote host closed the connection

修改配置文件/etc/redis.conf,将protected-mode为no。

1.6 Node 192.168.88.101:7002 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.

1) 先将redis 进程干掉   ps -ef | grep redis kill pid
2) 将每个节点下aof、rdb、nodes.conf本地备份文件删除,redis.conf   appendfilename ;
3) 之后再执行脚本,成功执行;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值