-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cluster Mode: Ability for client to send a command to specific cluster node(s) or all cluster nodes. #986
Comments
Hello, Would you tell us what is the purpose of the use case? Is it for monitoring or load balancing? |
@supercaracal - Yes, as you surmised, the use case is for cluster monitoring and load balancing.
|
You can extract all node information with workaround like this: r = Redis.new cluster: ['redis://127.0.0.1:7000']
r._client.instance_variable_get(:@node).call_all(%w[info]).map { |reply| Redis::HashifyInfo.call(reply) } It needs more parsing steps if you specify Lines 311 to 317 in fa76a26
The Gem certainly sends the command to a random node when using cluster mode. That behavior might be pointless. Lines 128 to 154 in fa76a26
It seems that Redis Cluster Proxy doesn't support the command. Basically, keys and nodes go hand in hand when servers are cluster mode and clients send commands including keys. I would say that the Gem need not dare to support of exposing interfaces each node. |
@supercaracal - Thanks for the feedback and work-around suggestions. Following is an approach I believe should work to send commands to individual cluster nodes (in addition to your #call_all suggestion to call all cluster nodes). Please let me know your thoughts as to the viability, thanks:
|
It seems that there are no problems except one of the first step:
redis-rb/lib/redis/cluster/node.rb Line 18 in fa76a26
|
RE: Cluster Mode
The text was updated successfully, but these errors were encountered: