Skip to content

BUCKET.LOCATE

Returns the routing information for a bucket, showing which shards hold its data and the addresses of primary and standby replicas.

BUCKET.LOCATE <bucket>
ParameterTypeRequiredDescription
bucketstringYesName of the bucket to locate.

Returns a flat array with 3 elements per shard:

PositionTypeDescription
0integerShard ID.
1stringPrimary owner address in host:port format.
2arrayStandby replica addresses, each in host:port format. Empty array if no standbys exist.

This pattern repeats for each shard the bucket spans. For a bucket on 2 shards, the array contains 6 elements.

Shards without a known route are silently omitted from the result.

Error CodeDescription
NOSUCHBUCKETThe specified bucket does not exist.

Locate a single-shard bucket:

> BUCKET.LOCATE users
1) (integer) 0
2) "127.0.0.1:5484"
3) (empty array)

Locate a multi-shard bucket:

> BUCKET.LOCATE events
1) (integer) 0
2) "10.0.0.1:5484"
3) (empty array)
4) (integer) 1
5) "10.0.0.2:5484"
6) (empty array)

Non-existent bucket:

> BUCKET.LOCATE nonexistent
(error) NOSUCHBUCKET No such bucket: 'nonexistent'