阿里云 Redis 报错:Redis error: ERR for redis cluster, eval/evalsha number of keys can’t be negative or zero 的分析解决
1、报错:Redis error ERR for redis cluster, evalevalsha number of keys can’t be negative or zero。如图1
Redis error: ERR for redis cluster, eval/evalsha number of keys can't be negative or zero Redis command was: EVAL local allpks=redis.call('LRANGE','ca:ar:user',0,-1) local pks={} local n=0 local v=nil local i=0 local key='ca:ar:user' for k,pk in ipairs(allpks) do if true then i=i+1 if i>0 then do return redis.call('HGETALL','ca:ar:user:a:' .. pk) end end end end return pks 0
2、参考网址:https://developer.aliyun.com/article/645851 。云 Redis 集群对 lua 脚本限制之一,调用必须要带有 key,否则直接返回错误信息, “-ERR for redis cluster, eval/evalsha number of keys can’t be negative or zerorn”。如图2
3、放弃使用阿里云 Redis 集群。问题得以解决。后续对于 Redis 集群的支持有待于在程序层面有所调整才是。如图3
近期评论