ERR bad lua script for redis cluster, redis.call/pcall, wrong number of arguments for ‘pexpire‘ comm

阿里云的redis使用lua脚本报错

ERR bad lua script for redis cluster, redis.call/pcall, wrong number of arguments for ‘pexpire’ command. channel:

org.redisson.client.RedisException: ERR bad lua script for redis
cluster, redis.call/pcall, wrong number of arguments for ‘pexpire’
command. channel: [id: 0xec112fb5, L:/ - Rcommand: (EVAL), promise:
java.util.concurrent.CompletableFuture@28a11e11[Not completed, 1
dependents], params: [local result = 0;for j = 1, #KEYS, 1 do local
expireSet; if ARGV[2] ~= ‘’ then expireSet = redis.call(‘pexpire’,
KEYS[j], ARGV[1], ARGV[2]); else expireSet = redis.call(‘pexpire’,
KEYS[j], ARGV[1]); end; if expireSet == 1 then result = expireSet;end;
end; return result; , 1, ooooooo, 22604000, ]

解决办法

默认阿里云Redis会对lua脚本做一定限制,目的是为了保证脚本里面的所有操作都在相同slot进行,如果用户能够在代码确保所有操作都在相同slot而又想打破Redis集群的lua限制的话可以通过控制台修改script_check_enable参数为0,则后端不会对脚本进行校验。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值