Sidekiq 7 / Redis 客户端在 Heroku 上无法工作

huangapple go评论61阅读模式
英文:

Sidekiq 7 / Redis-client not working (on Heroku)

问题

我正在使用在Heroku上托管的应用程序中的Sidekiq。
我一直在使用redis gem。

现在我正在尝试升级到Sidekiq 7,它使用redis-client而不是redis。但在这样做时,我遇到了这个错误:

redis-client要求Redis 6+,并且要求HELLO命令可用

我在Heroku上有的Redis实例的版本是6.2.6(所以是Redis 6+)(附有图片)

以下是我的redis.rb文件(位于initializers目录下)。我将Redis替换为RedisClient,但无论是在使用redis gem与Sidekiq 7还是使用redis-client的情况下,我都仍然遇到了错误。
这意味着当Sidekiq内部代码使用redis-client时出现错误。

非常感谢您提供任何想法或建议 🙏🏼 先行致谢!

我期望这能够正常工作,因为我的Redis实例是6+版本

url = ENV["REDISCLOUD_URL"]

if url
  Sidekiq.configure_server do |config|
    config.redis = { url: url }
  end

  Sidekiq.configure_client do |config|
    config.redis = { url: url }
  end
end

Sidekiq 7 / Redis 客户端在 Heroku 上无法工作

英文:

I am using Sidekiq on an app hosted on Heroku.
I have been using the redis gem.

Now I am trying to upgrade to sidekiq 7 which uses redis-client instead of redis. And when doing so I get this error:

redis-client requires Redis 6+ with HELLO command available

The Redis instance I have on Heroku is on the version 6.2.6 (so Redis 6+) (picture attached)

Below my redis.rb file (which is in initializers). I replaced Redis with RedisClient but I still get the error in both cases (in the case where I use the redis gem with Sidekiq 7 and the case where I use redis-client).
It means that it is when the Sidekiq inner code is using redis-client that the error is happening.

Any thoughts or ideas would be highly appreciated 🙏🏼 Thanks in advance!

I was expecting this to work as my Redis instance is on a 6+ version

url = ENV["REDISCLOUD_URL"]

if url
  Sidekiq.configure_server do |config|
    config.redis = { url: url }
  end

  Sidekiq.configure_client do |config|
    config.redis = { url: url }
  end
end

Sidekiq 7 / Redis 客户端在 Heroku 上无法工作

答案1

得分: 2

搜索Sidekiq问题中的"HELLO"会给您带来这个问题:

https://github.com/sidekiq/sidekiq/issues/5594#issuecomment-1302384905

英文:

Searching the Sidekiq issues for "HELLO" gives you this issue:

https://github.com/sidekiq/sidekiq/issues/5594#issuecomment-1302384905

答案2

得分: 0

你需要将你的redis服务器(在你的机器上)升级到6+版本。升级后不要忘记重新启动它。

英文:

You need to upgrade your redis-server (on your machine) to 6+ version. Don't forget to restart it after upgrading.

答案3

得分: 0

在我的应用程序中,我遇到了同样的问题。尽管版本6.2.6是6+,但只有在我使用了版本6.2.12的Redis时,错误才停止了。在暂存环境中,我正在使用一个带有Redis 6.2.12的“Heroku Data for Redis®* Mini”(在Sidekiq 7中正常运行)。在生产环境中,我正在使用一个带有Redis 7的“Memetria for Redis®* Mini”。

我不知道是否可以选择“Heroku Data for Redis®* Mini”的版本,我已经在暂存环境中安装了这个插件。

英文:

I had the same problem here in my application.
Although the version 6.2.6 is 6+ The error only stopped when I used Redis on version 6.2.12.
In staging I am using a "Heroku Data for Redis®* Mini" (with Redis 6.2.12) and it is running normally in Sidekiq 7
In production I am using a "Memetria for Redis®* Mini" (Redis 7)

I don't know if it is possible to choose the version of "Heroku Data for Redis®* Mini" I already had this addon installed in stage.

huangapple
  • 本文由 发表于 2023年2月19日 01:15:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75495015.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定