ERR Unknown option or number of arguments for CONFIG SET: Unknown option or number of arguments for CONFIG SET (older versions: Unsupported CONFIG parameter)(CONFIG SET 的选项未知或参数数量错误)
Redis含义
您试图用 CONFIG SET 修改的配置参数在此 Redis 版本中无法识别,或参数数量错误。在 Redis 7 中完整消息为 "ERR Unknown option or number of arguments for CONFIG SET - '<name>'";旧版本返回 "ERR Unsupported CONFIG parameter"。CONFIG GET 对未知参数不会报错,而是返回空列表。
原因
参数名拼写错误;使用了其他 Redis 版本的参数(参数可能在版本之间增加或移除);或托管云服务不允许修改某些参数。在较新/较旧版本上运行旧脚本是典型原因。
解决方法
确认有效的参数名。用模式列出当前设置,例如 CONFIG GET 'maxmemory*'。查阅与您 Redis 版本对应的文档中的参数列表;用 INFO server 查看版本。如果云服务有限制,使用提供商允许的参数集。针对目标版本更新脚本。
同一数据库的其他条目
- ERR DEBUG command not allowedDEBUG command not allowed(不允许使用 DEBUG 命令)
- ERR Can't save in background: fork failedBackground save failed: fork failed(后台保存失败:fork 失败)
- NOPROTO unsupported protocol versionUnsupported RESP protocol version(不支持的 RESP 协议版本)
- ERR MULTI calls can not be nestedMULTI calls can not be nested(MULTI 调用不能嵌套)
- ERR Lua script attempted to access nonexistent global variableLua script attempted to access a nonexistent global variable(Lua 脚本试图访问不存在的全局变量)
- ERR unknown commandUnknown command(未知命令)
- TRYAGAIN Multiple keys request during rehashing of slotMultiple keys request during rehashing of slot (cluster)(槽重新哈希期间的多键请求)