redis: kubedb.dev/redis/pkg/configure-cluster Index | Files

package configure_cluster

import "kubedb.dev/redis/pkg/configure-cluster"

Index

Package Files

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

func ClusterFailoverCmd Uses

func ClusterFailoverCmd(ip string) []string

https://redis.io/commands/cluster-failover

func ClusterGetKeysInSlotCmd Uses

func ClusterGetKeysInSlotCmd(srcNodeIP, slot string) []string

https://redis.io/commands/cluster-getkeysinslot

func ClusterInfoCmd Uses

func ClusterInfoCmd() []string

******************************************

redis-cli cluster commands (general)

****************************************** https://redis.io/commands/cluster-info

func ClusterMeetCmd Uses

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

https://redis.io/commands/cluster-meet

func ClusterNodesCmd Uses

func ClusterNodesCmd(ip string) []string

https://redis.io/commands/cluster-nodes

func ClusterReplicateCmd Uses

func ClusterReplicateCmd(ip, masterNodeID string) []string

https://redis.io/commands/cluster-replicate

func ClusterResetCmd Uses

func ClusterResetCmd(ip, resetType string) []string

https://redis.io/commands/cluster-reset

func ClusterSetSlotImportingCmd Uses

func ClusterSetSlotImportingCmd(dstNodeIP, slot, srcNodeID string) []string

https://redis.io/commands/cluster-setslot

func ClusterSetSlotMigratingCmd Uses

func ClusterSetSlotMigratingCmd(srcNodeIP, slot, dstNodeID string) []string

func ClusterSetSlotNodeCmd Uses

func ClusterSetSlotNodeCmd(toNodeIP, slot, dstNodeID 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 MigrateKeyCmd Uses

func MigrateKeyCmd(srcNodeIP, dstNodeIP, dstNodePort, key, dbID, timeout string) []string

https://redis.io/commands/migrate

func PingCmd Uses

func PingCmd(ip string) []string

https://redis.io/commands/ping

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 2019-07-21. Refresh now. Tools for package owners.