0
点赞
收藏
分享

微信扫一扫

Redis - ERR unknown command ‘EVAL‘. channel


报错

Exception in thread "pool-25-thread-20" org.redisson.client.RedisException: ERR unknown command 'EVAL'. channel: [id: 0x06fc3a14, L:/11.57.1.15:6694 - R:192.168.200.152/192.168.200.152:26378] command: (EVAL), params: [if (redis.call('hexists', KEYS[1], ARGV[3]) == 0) then return nil;end; local counter = redis.call('h..., 2, lock, redisson_lock__channel:{lock}, 0, 30000, 920d0c4a-1c15-4616-bb41-3ed66a69233e:17177]


解决方式

网上大部分解决该问题的方法都是:排查1、排查2,但是经过验证,小编还发现可能是 排查3 的情况!!!

排查1、检查 redis 版本是否大于等于2.6.0

排查2、打开 redis.conf 配置文件,检查是否有rename-command EVAL ""这项配置?如果有,注释掉# rename-command EVAL "",重启 redis 即可

排查3、其实还需要考虑是否是哨兵模式,就是 Config 配置的时候,如果是哨兵模式的端口,改成真实 redis 的端口即可,因为哨兵模式不支持 'EVAL'。

Ps:Sentinel使用的服务器命令表和普通服务器也不同,命令表里没有SET​DBSIZE​​EVAL​等这些命令,所以Sentinel不能执行这些命令,所以在使用 Redisson 分布式锁的时候,一定要连接的是普通服务器,而不能是哨兵模式。


举报

相关推荐

0 条评论