Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'redis cluster' connection raise exception since redis 5.x gem, should support redis-clustering gem. #369

Open
sudoudaisuke opened this issue Sep 25, 2023 · 3 comments

Comments

@sudoudaisuke
Copy link

The 'redis-store' gem depends on the 'redis' gem.
The 'redis' gem since 5.0 does not support redis clusters. redis clusters are supported by the 'redis-clustering' gem.

https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#500

Now I got exception by this code.

require 'redis-store'
redis = ::Redis::Store::Factory.create({cluster: 'redis://redis_cluster:7001/0'})

exception message

$ bundle exec ruby app.rb
/app/vendor/bundle/ruby/3.2.0/gems/redis-5.0.7/lib/redis.rb:136:in `initialize_client': Redis Cluster support was moved to the `redis-clustering` gem. (RuntimeError)
        from /app/vendor/bundle/ruby/3.2.0/gems/redis-5.0.7/lib/redis.rb:73:in `initialize'
        from /app/vendor/bundle/ruby/3.2.0/gems/redis-store-1.10.0/lib/redis/store.rb:21:in `initialize'
        from /app/vendor/bundle/ruby/3.2.0/gems/redis-store-1.10.0/lib/redis/store/factory.rb:27:in `new'
        from /app/vendor/bundle/ruby/3.2.0/gems/redis-store-1.10.0/lib/redis/store/factory.rb:27:in `create'
        from /app/vendor/bundle/ruby/3.2.0/gems/redis-store-1.10.0/lib/redis/store/factory.rb:10:in `create'
        from app.rb:3:in `<main>'
@slai11
Copy link

slai11 commented Oct 30, 2023

Would including redis-clustering force the redis-store gem to only support redis v5 gem? That said, what is the maintainer's stance on supporting Redis Cluster funtionalities in redis-store with the separation of redis-clustering from the redis gem?

@rayway30419
Copy link

I will recommend to use native redis-clustering with active_support
redis = Redis::Cluster.new(nodes: [])
store = ActiveSupport::Cache.lookup_store(:redis_cache_store, { redis: redis })

@iain-bryson
Copy link

Same issue here, except for the session. Is it possible to have a redis-rb 5 Redis::Cluster-based session store?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants