redis: Index | Files

package configure_cluster

import ""


Package Files

cluster.go cluster_cmd.go cluster_operations.go config.go util.go

func ClusterFailoverCmd Uses

func ClusterFailoverCmd(useTLS bool, ip string) []string

func ClusterMeetCmd Uses

func ClusterMeetCmd(useTLS bool, senderIP, receiverIP, receiverPort string) []string

func ClusterNodesCmd Uses

func ClusterNodesCmd(useTLS bool, ip string) []string


redis-cli cluster commands (general)


func ClusterReplicateCmd Uses

func ClusterReplicateCmd(useTLS bool, ip, masterNodeID string) []string

func ClusterResetCmd Uses

func ClusterResetCmd(useTLS bool, ip, resetType string) []string

func ConfigureRedisCluster Uses

func ConfigureRedisCluster(
    restConfig *rest.Config, redis *api.Redis, version string, pods [][]*core.Pod) error

ConfigureRedisCluster() configures a cluster. Here, pods[][] contains the ordered pods. pods[i][j] is the j'th Pod of i'th StatefulSet (where each StatefulSet represents a shard. That means if there are 3 shards in cluster, then for each shard there is a StatefulSet and 0'th Pod of i'th StatefulSet is the master for i'th shard and 1, 2, 3, ....'th Pods are the replicas or slaves of that master).

func PingCmd Uses

func PingCmd(useTLS bool, ip string) []string

type Config Uses

type Config struct {
    // RestConfig is needed to execute commands inside Pods
    RestConfig *rest.Config

    // Cluster keeps the cluster info
    Cluster RedisCluster
    // contains filtered or unexported fields

Config contains necessary fields that are needed in the processes to configure.

type RedisCluster Uses

type RedisCluster struct {
    // Number of master nodes
    MasterCnt int

    // Number of replica(s) per master node
    Replicas int

RedisCluster contains same info as `.spec.cluster` of Redis CRD

type RedisNode Uses

type RedisNode struct {
    // If this node is a master then it's slots info are stored. Otherwise, these slots info will take the
    // default values.
    // There is a total of 16384 slots in the cluster. SlotsCnt is the total number of slots, the current
    // node contains out of 16384 slots.
    // The node may have different ranges of slots. Then SlotStart and SlotEnd are the array of starting and
    // ending indices of the range(s) respectively.
    // Say, the node has slots of ranges 0-1000 2000-2500 10000-12000.
    // So SlotCnt is 3500, SlotStart[] is [0, 2000, 10000] and SlotEnd[] is [1000, 2500 12000]
    SlotStart []int
    SlotEnd   []int
    SlotsCnt  int

    // node id
    ID  string

    // node ip
    IP  string

    // port at which redis server is running in the node
    Port int

    // node role (either master or slave)
    Role string

    // true if the flag of the node is 'fail'
    Down bool

    // If the node role is slave, then Master is set, otherwise it is nil.
    Master *RedisNode

    // If the node role is master, the Slaves contains the array of it's slave nodes. Otherwise, it is empty.
    Slaves []*RedisNode

RedisNode stores info about a node

type ResetType Uses

type ResetType string

Package configure_cluster imports 12 packages (graph) and is imported by 2 packages. Updated 2020-11-24. Refresh now. Tools for package owners.