简体   繁体   English

Redis 错误“NOSCRIPT No matching script. Please use EVAL” on Redis 服务重启

[英]Redis error "NOSCRIPT No matching script. Please use EVAL" on Redis service restart

I'm using Redis with express-rate-limit and rate-limit-redis in my node ExpressJS server.我在我的节点 ExpressJS 服务器中使用 Redis 和express-rate-limitrate-limit-redis

The problem I'm facing is that when my Redis server restarts (I know that is something shouldn't happen, but, let's just think it might happen eventually), it re-connects successfully, but then on the next request to my server, I get this error from Redis:我面临的问题是,当我的 Redis 服务器重新启动时(我知道这是不应该发生的事情,但是,我们只是认为它最终可能会发生),它重新连接成功,但是在下一个请求到我的服务器时,我从 Redis 得到这个错误:

NOSCRIPT No matching script. Please use EVAL

I've read some info about it and I've seen I'm not the only one suffering from this problem.我已经阅读了一些有关它的信息,并且我发现我不是唯一遭受此问题困扰的人。

But still, I haven't been able to find a solution.但是,我仍然无法找到解决方案。

What should I do to avoid this error?我应该怎么做才能避免这个错误? What options do I have?我有什么选择?

NOSCRIPT No matching script. NOSCRIPT 没有匹配的脚本。 Please use EVAL请使用评估

This means you are using EVALSHA to run a pre-loaded script.这意味着您正在使用EVALSHA来运行预加载的脚本。 However, the script doesn't exist.但是,该脚本不存在。 Because when Redis restarts, all pre-loaded scripts will be removed.因为当Redis重启时,所有预加载的脚本都会被移除。

In your case, rate-limit-redis might used some pre-loaded script, and these scripts have been removed when Redis restarts.在您的情况下, rate-limit-redis可能使用了一些预加载的脚本,并且这些脚本在 Redis 重新启动时已被删除。 So you need to take a look at the rate-limit-redis ' doc to find a way to reload these scripts ( SCRIPT LOAD ).因此,您需要查看rate-limit-redis的文档以找到重新加载这些脚本的方法 ( SCRIPT LOAD )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM