最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Redis "ERR Error running script" when using Redisson with Spring Boot - Stack Overflow

programmeradmin1浏览0评论

I am using Spring Boot 2.7.18, Redisson 3.17.7, and Redis Cluster in my project. The application is running inside a Kubernetes (multi-pod) environment.

My Redis configuration in application.yml:

spring:
  redis:
    cluster:
      nodes: 192.168.1.10:6379,192.168.1.11:6379,192.168.1.12:6379
    username: my_redis_user
    password: my_redis_password

And the Redisson configuration:

config.useClusterServers()
      .setUsername(username)
      .setPassword(password);

Problem: When the application runs, I get the following error message in the logs:

ERR Error running script (call to f_dad0f8d619e548e04f21fb48d50be5034df3adae): 
@user_script:1: @user_script: 1: The user executing the script can't run this command or subcommand.

It happens when executing EVAL commands for distributed locking in Redisson.

I already granted EVAL permission to my Redis user:

ACL SETUSER my_redis_user +eval

But the error still persists.

Things I've Tried:

  1. Ensured that the Redis user has EVAL permission.

  2. Checked my Redis ACL using:

    ACL GETUSER my_redis_user

Output:

user my_redis_user on >my_redis_password -@all +eval +get +set +del +expire +ttl
  1. Restarted Redis after making changes.

Question:

  • What other Redis commands does Redisson require for distributed locking?
  • How can I properly grant all necessary permissions without using +@all?

Thanks in advance!

发布评论

评论列表(0)

  1. 暂无评论