Redis cluster support for Redis Modules

232 views
Skip to first unread message

Sam Fang

unread,
Jun 10, 2019, 4:30:45 AM6/10/19
to Redis DB
Hi,

With Redis cluster and for example redis-cli as the client:
1) Does "MODULE LOAD" command install a Redis module on all cluster nodes?
2) When issuing a custom command defined by modules with key argument, is the key hashed to find out the target node? Or the module command is broadcasted to all nodes?

Thanks a lot,
Sam

Itamar Haber

unread,
Jun 10, 2019, 3:17:36 PM6/10/19
to redi...@googlegroups.com
Hello Sam,

1. No, you have to issue it on each node (and, better yet, via the conf file)
2. Yes, custom module commands need to let Redis know which arguments are keys during command creation. Just like any other command, accessing a node with an operation on a key that doesn't belong to the node's hashslots will result in a redirect.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/da916991-e81d-4176-be1d-2609065fa8c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Itamar Haber
Technicalist Evangely

Phone: +972.54.567.9692

Redis Labs

new sewe

unread,
Jun 11, 2019, 3:37:20 AM6/11/19
to Redis DB
Hi Itamar,

What's if the custom command doesn't have a key? Say, it's a MODULE.HELP SUBCOMMAND command, which prints the help info of a subcommand.

I did some experiments, and it seems that I can specify the command flag string as "readonly getkeys-api" when creating the command.  So that when I issue the command, Redis Cluster will serve the request with the connecting node, and won't redirect the client to other node.

I'm not sure if this is correct solution for custom command that doesn't have a key. Can you confirm it? Thanks!

Regards

在 2019年6月11日星期二 UTC+8上午3:17:36,Itamar Haber写道:
Hello Sam,

1. No, you have to issue it on each node (and, better yet, via the conf file)
2. Yes, custom module commands need to let Redis know which arguments are keys during command creation. Just like any other command, accessing a node with an operation on a key that doesn't belong to the node's hashslots will result in a redirect.

On Mon, Jun 10, 2019 at 11:30 AM Sam Fang <rappor...@gmail.com> wrote:
Hi,

With Redis cluster and for example redis-cli as the client:
1) Does "MODULE LOAD" command install a Redis module on all cluster nodes?
2) When issuing a custom command defined by modules with key argument, is the key hashed to find out the target node? Or the module command is broadcasted to all nodes?

Thanks a lot,
Sam

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redi...@googlegroups.com.

To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/da916991-e81d-4176-be1d-2609065fa8c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Itamar Haber

unread,
Jun 11, 2019, 6:48:59 AM6/11/19
to redi...@googlegroups.com
Commands that don't expect keys as arguments can be run on any shard.

To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.

To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
Reply all
Reply to author
Forward
0 new messages