View Source Module eredis_cluster_monitor

This module manages the slot mapping.

Behaviours: gen_server.

See also: eredis_cluster.

description

Description

In a Redis cluster, each key belongs to a slot and each slot belongs to a Redis master node.

This module is mainly internal, but some functions are documented and may be useful for advanced scenarios.

function-index

Function Index

get_cluster_nodes/0Get cluster nodes information.
get_cluster_nodes/1
get_cluster_slots/0Get cluster slots information.

function-details

Function Details

get_cluster_nodes-0

get_cluster_nodes/0

get_cluster_nodes() -> [[bitstring()]]

Get cluster nodes information. Returns a list of node elements, each in the form:

[id, ip:port@cport, flags, master, ping-sent, pong-recv, config-epoch, link-state, Slot1, ..., SlotN]

See: https://redis.io/commands/cluster-nodes#serialization-format

get_cluster_nodes-1

get_cluster_nodes/1

get_cluster_nodes(Cluster::atom()) -> [[bitstring()]]

get_cluster_slots-0

get_cluster_slots/0

get_cluster_slots() -> [[bitstring() | [bitstring()]]]

Get cluster slots information.