clustering

package
v0.0.0-...-f651441 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachingSlavesToMaster

func AttachingSlavesToMaster(cluster *redis.Cluster, admin redis.AdminInterface, slavesByMaster map[string]redis.Nodes) error

AttachingSlavesToMaster used to attach slaves to there masters

func ClassifyNodesByRole

func ClassifyNodesByRole(nodes redis.Nodes) (masters, slaves, nones redis.Nodes)

ClassifyNodesByRole use to classify the Nodes by roles

func DispatchMasters

func DispatchMasters(cluster *redis.Cluster, nodes redis.Nodes, nbMaster int32, admin redis.AdminInterface) (redis.Nodes, redis.Nodes, redis.Nodes, error)

DispatchMasters used to select nodes with master roles

func DispatchSlave

func DispatchSlave(cluster *redis.Cluster, nodes redis.Nodes, replicationLevel int32, admin redis.AdminInterface) error

DispatchSlave aim is to dispatch the available redis to slave of the current masters

func DispatchSlaveByMaster

func DispatchSlaveByMaster(futurMasterNodes, currentSlaveNodes, futurSlaveNodes redis.Nodes, replicationLevel int32, admin redis.AdminInterface) error

DispatchSlaveByMaster use to dispatch available Nodes as slave to Master

func DispatchSlavesToNewMasters

func DispatchSlavesToNewMasters(newMasterNodesSlice, oldSlaveNodesSlice, newSlaveNodesSlice redis.Nodes, replicationLevel int32, admin redis.AdminInterface) error

DispatchSlavesToNewMasters use to dispatch available Nodes as slave to Master in the case of rolling update

func DispatchSlotToNewMasters

func DispatchSlotToNewMasters(cluster *redis.Cluster, admin redis.AdminInterface, newMasterNodes, currentMasterNodes, allMasterNodes redis.Nodes) error

DispatchSlotToNewMasters used to dispatch Slot to the new master nodes

func PlaceMasters

func PlaceMasters(cluster *redis.Cluster, currentMaster redis.Nodes, allPossibleMasters redis.Nodes, nbMaster int32) (redis.Nodes, bool, error)

PlaceMasters used to select Redis Node knowing on which VM they are running in order to spread as possible the masters on different VMs. Improvement: Use Kube Node labeling instead of the "NodeName", (availability zone and so)

func PlaceSlaves

func PlaceSlaves(cluster *redis.Cluster, masters, oldSlaves, newSlaves redis.Nodes, replicationFactor int32) (map[string]redis.Nodes, bool)

PlaceSlaves used to select Redis Node knowing on which VM they are running in order to spread as possible

func SelectMastersToReplace

func SelectMastersToReplace(currentOldMaster, currentNewMasters, newNoneNodes redis.Nodes, nbMaster, nbMasterToReplace int32) (selectedMasters redis.Nodes, newSelectedMasters redis.Nodes, err error)

SelectMastersToReplace used to replace currentMaster with new Nodes

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL