0

I know that Jedis (and other client libs) can select an appropriate shard to execute the Lua script. However what I cannot find is how the master-slave nodes are used after. Say I have multiple Lua scripts and part of them does writes, another part - reads. How does Jedis know whether it should be executed on master or slave considering slaves are read-only?

Does it always send EVAL commands to master even for read-only scripts?

Nestor Sokil
  • 2,162
  • 12
  • 28

2 Answers2

2

Jedis sends all commands to master nodes in cluster mode. By all, I mean all sorts of Redis commands, not only EVAL commands.

Jedis may use slave nodes, but it's only during internal cluster configuration.

sazzad
  • 5,740
  • 6
  • 25
  • 42
  • Thanks for your reply. Isn't this very performance-killing? I'd still would use replicas for HA, but reading from them would be nice too. Can you also provide a link for me confirming this behavior? – Nestor Sokil Apr 18 '18 at 08:05
1

JedisCluster does not support Slaves as of now.

ReadOnly access to Slaves is in development

You may try to select slave nodes manually like examples here

igord
  • 26
  • 3