Closed nmtruong93 closed 1 year ago
@nmtruong93 Are all the 71 keys you get with redis-py-cluster in the same node?
If not - this is the expected behavior of the keys
command, to return the keys from the node you sent the command to.if you want to get the keys from all the nodes you can specify the target_nodes to primaries
or all
:
connection.keys('pfs:aiml:*:status', target_nodes="primaries")
@dvora-h thanks, you solved my problem!
Version: 4.4.0
Platform: Python 3.8.10 on Mac M1 Montery 12.6
Description: I tried 2 Redis client packages: redis 4.4.0 and redis-py-cluster 2.1.3
The code for redis 4.4.0
The code for redis-py-cluster 2.1.3:
However, when I try to get pattern of keys, the results in redis 4.4.0 are less than redis-py-cluster. It means redis 4.4.0 can not get all keys from the cluster.
I tried many ways, including using Redis, StrictRedis classes, add more startup nodes to params startup_nodes, but the results of redis 4.4.0 are always less than redis-py-cluster.
Please help me solve this problem. Thank you.