2

I want to check total number of keys in Redis Cluster.

Is there any direct command available to get this or I have to check with INFO command from each instance / node.

RKP
  • 750
  • 2
  • 12
  • 23

1 Answers1

2

There is no direct way.

You can do the following with the cli though:

redis-cli --cluster call one-cluster-node-ip-address:the-port DBSIZE

And then sum the results.

Alternatively, there's RedisGears with which you can do the following to get the same result:

redis> RG.PYEXECUTE "GB().count().run()"
Itamar Haber
  • 47,336
  • 7
  • 91
  • 117