Redis Cross Slot error

后端 未结 2 1137
囚心锁ツ
囚心锁ツ 2020-12-16 13:59

I am trying to insert multiple key/values at once on Redis (some values are sets, some are hashes) and I get this error: ERR CROSSSLOT Keys in request don\'t hash to t

2条回答
  •  遥遥无期
    2020-12-16 14:32

    In a cluster topology, the keyspace is divided into hash slots. Different nodes will hold a subset of hash slots.

    Multiple keys operations, transactions, or Lua scripts involving multiple keys are allowed only if all the keys involved are in hash slots belonging to the same node.

    Redis Cluster implements all the single key commands available in the non-distributed version of Redis. Commands performing complex multi-key operations like Set type unions or intersections are implemented as well as long as the keys all belong to the same node.

    You can force the keys to belong to the same node by using Hash Tags

提交回复
热议问题