关于redis锁

来源:1-12 特性8-高可用分布式

qq_yy_13

2018-05-17

最近公司使用到了redis作为分布式锁,但偶尔就会报错但找不到原因,老师有遇到过吗

2018-05-16 13:03:18.969 [http-bio-8083-exec-100] ERROR o.s.b.web.support.ErrorPageFilter - Forwarding to error page from request [/test/mytest] due to exception [Redis server response timeout (3000 ms) occured for command: (EVAL) with params: [if (redis.call('exists', KEYS[1]) == 0) then redis.call('hset', KEYS[1], ARGV[2], 1); redis.call('pe..., 1, lock:DeviceRH023330, 30000, 44729f05-7d4d-4066-b594-d0262aea16e0:952] channel: [id: 0xcfe81655, L:/172.17.100.201:59328 - R:/10.0.5.201:30402]]
org.redisson.client.RedisTimeoutException: Redis server response timeout (3000 ms) occured for command: (EVAL) with params: [if (redis.call('exists', KEYS[1]) == 0) then redis.call('hset', KEYS[1], ARGV[2], 1); redis.call('pe..., 1, lock:DeviceRH023330, 30000, 44729f05-7d4d-4066-b594-d0262aea16e0:952] channel: [id: 0xcfe81655, L:/172.17.100.201:59328 - R:/10.0.5.201:30402]
    at org.redisson.command.CommandAsyncService$11.run(CommandAsyncService.java:697)
    at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:588)
    at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:662)
    at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:385)
    at java.lang.Thread.run(Thread.java:748)
2018-05-16 13:03:18.970 [http-bio-8083-exec-100] ERROR c.h.s.c.c.GlobalErrorController - 服务器错误
org.redisson.client.RedisTimeoutException: Redis server response timeout (3000 ms) occured for command: (EVAL) with params: [if (redis.call('exists', KEYS[1]) == 0) then redis.call('hset', KEYS[1], ARGV[2], 1); redis.call('pe..., 1, lock:DeviceRH023330, 30000, 44729f05-7d4d-4066-b594-d0262aea16e0:952] channel: [id: 0xcfe81655, L:/172.17.100.201:59328 - R:/10.0.5.201:30402]
    at org.redisson.command.CommandAsyncService$11.run(CommandAsyncService.java:697)
    at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:588)
    at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:662)
    at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:385)
    at java.lang.Thread.run(Thread.java:748)


写回答

1回答

carlosfu

2018-06-27

麻烦提供下lua脚本内容

0
0

一站式学习Redis 从入门到高可用分布式实践

Redis课程升级!系统梳理Redis知识体系,掌握redis必备!

2277 学习 · 261 问题

查看课程