使用 Redisson 提供的 Redis 分布式锁时,编译没有问题,运行时报错 (-READONLY You can't write against a read only replica):
10月 11, 2020 2:18:18 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springMVC] in context with path [] threw exception [Request processing failed; nested exception is org.redisson.client.RedisException: ERR Error running script (call to f_9401052d872adfd0179ef8c8e8c028512707629a): @user_script:1: @user_script: 1: -READONLY You can't write against a read only replica. . channel: [id: 0xe42668b2, L:/192.168.186.1:52025 - R:/192.168.186.128:6379] command: (EVAL), params: [if (redis.call('exists', KEYS[1]) == 0) then redis.call('hset', KEYS[1], ARGV[2], 1); redis.call('pe..., 1, upload-lock-redis, 30000, d3df9050-1988-4447-afd0-f9114c20f69b:33]] with root cause
org.redisson.client.RedisException: ERR Error running script (cal