【问题标题】:cannot run passed Lua script to Redis: This Redis command is not allowed from scripts无法将传递的 Lua 脚本运行到 Redis:脚本中不允许使用此 Redis 命令
【发布时间】:2019-11-20 05:18:26
【问题描述】:

我有三个运行 sentinel 的 Redis 服务器实例和一个 Lua 脚本,以便让 redis_exporter 收集连接到 Redis 服务器的客户端列表。但是当我将脚本传递给redis-cli 命令时,我收到以下错误:

(error) ERR Error running script (call to f_4c6be190ef2981eda70d58ec0c959bd1ca2c5352): @user_script:10: @user_script: 10: This Redis command is not allowed from scripts

这是我的 Lua 脚本:

local r = redis.call("CLIENT", "LIST")
return r

有没有办法解决这个问题?

【问题讨论】:

    标签: redis lua redis-sentinel redis-cli


    【解决方案1】:

    快速 google 一下,似乎问题出在 redis 服务器本身,而不是库。

    CLIENT 命令有一个no-script 标志

    https://github.com/antirez/redis/blob/fe5aea38c35e3fc35a744ad2de73543df553ae48/src/sentinel.c

    【讨论】:

      猜你喜欢
      • 2018-01-05
      • 2017-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-04
      • 1970-01-01
      • 2016-05-20
      • 2020-11-18
      相关资源
      最近更新 更多