redis - 无法将传递的 Lua 脚本运行到 Redis:脚本中不允许使用此 Redis 命令
问题描述
我有三个运行哨兵的 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服务器本身,而不是库。
该CLIENT
命令有一个no-script
标志
https://github.com/antirez/redis/blob/fe5aea38c35e3fc35a744ad2de73543df553ae48/src/sentinel.c
推荐阅读
- django - 如何从 Django 选择字段中检索选定的数据?
- macos - lldb:查看 macOS 上的所有寄存器
- python - SYS.STDIN 的 read() 方法等 - 从哪里获取更多信息?
- git - 使用 git 显示过去 24 小时内的聚合“单词更改”
- node.js - node-gyp 针对错误的 NODE_MODULE_VERSION 进行编译
- netflix-eureka - 如何配置备用 SSL 属性以连接到 Spring Boot Admin?
- visual-studio-code - 如何在树莓派上安装 VSCode
- javascript - 对文本有更多控制的 TextArea 的替代品?
- c# - Excel 12.0 Interop 使用 C# 在 Excel 2016 上随机运行
- hadoop2 - 我们可以在现有集群中将 ambari 配置为非 root 用户吗