agent

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SeededAgents chan *Agent = make(chan *Agent)

Functions

func AbortSeed

func AbortSeed(seedId int64) error

AbortSeed will contact agents associated with a seed and request abort.

func FailStaleSeeds

func FailStaleSeeds() error

FailStaleSeeds marks as failed seeds where no progress have been seen recently

func ForgetLongUnseenAgents

func ForgetLongUnseenAgents() error

ForgetLongUnseenAgents will remove entries of all agents that have long since been last seen.

func ReadOutdatedAgentsHosts

func ReadOutdatedAgentsHosts() ([]string, error)

ReadOutdatedAgentsHosts returns agents that need to be updated

func Seed

func Seed(targetHostname string, sourceHostname string) (int64, error)

Seed is the entry point for making a seed

func SubmitAgent

func SubmitAgent(hostname string, port int, token string) (string, error)

SubmitAgent submits a new agent for listing

func SubmitSeedEntry

func SubmitSeedEntry(targetHostname string, sourceHostname string) (int64, error)

SubmitSeedEntry submits a new seed operation entry, returning its unique ID

func UpdateAgentInfo

func UpdateAgentInfo(hostname string, agent Agent) error

UpdateAgentInfo updates some agent state in backend table

func UpdateAgentLastChecked

func UpdateAgentLastChecked(hostname string) error

UpdateAgentLastChecked updates the last_check timestamp in the orchestrator backed database for a given agent

Types

type Agent

type Agent struct {
	Hostname                string
	Port                    int
	Token                   string
	LastSubmitted           string
	AvailableLocalSnapshots []string
	AvailableSnapshots      []string
	LogicalVolumes          []LogicalVolume
	MountPoint              Mount
	MySQLRunning            bool
	MySQLDiskUsage          int64
	MySQLPort               int64
	MySQLDatadirDiskFree    int64
	MySQLErrorLogTail       []string
}

Agent presents the data of an agent

func AbortSeedCommand

func AbortSeedCommand(hostname string, seedId int64) (Agent, error)

ReceiveMySQLSeedData requests an agent to abort seed send/receive (depending on the agent's role)

func CreateSnapshot

func CreateSnapshot(hostname string) (Agent, error)

CreateSnapshot requests an agent to create a new snapshot -- a DIY implementation

func GetAgent

func GetAgent(hostname string) (Agent, error)

GetAgent gets a single agent status from the agent service. This involves multiple HTTP requests.

func MountLV

func MountLV(hostname string, lv string) (Agent, error)

MountLV requests an agent to mount the given volume on the designated mount point

func MySQLStart

func MySQLStart(hostname string) (Agent, error)

MySQLStart requests an agent to start the MySQL service

func MySQLStop

func MySQLStop(hostname string) (Agent, error)

MySQLStop requests an agent to stop MySQL service

func PostCopy

func PostCopy(hostname string) (Agent, error)

PostCopy will request an agent to invoke post-copy commands

func ReadAgents

func ReadAgents() ([]Agent, error)

ReadAgents returns a list of all known agents

func ReceiveMySQLSeedData

func ReceiveMySQLSeedData(hostname string, seedId int64) (Agent, error)

ReceiveMySQLSeedData requests an agent to start listening for incoming seed data

func RemoveLV

func RemoveLV(hostname string, lv string) (Agent, error)

RemoveLV requests an agent to remvoe a snapshot

func SendMySQLSeedData

func SendMySQLSeedData(hostname string, targetHostname string, seedId int64) (Agent, error)

ReceiveMySQLSeedData requests an agent to start sending seed data

func Unmount

func Unmount(hostname string) (Agent, error)

Unmount unmounts the designated snapshot mount point

type LogicalVolume

type LogicalVolume struct {
	Name            string
	GroupName       string
	Path            string
	IsSnapshot      bool
	SnapshotPercent float64
}

LogicalVolume describes an LVM volume

type Mount

type Mount struct {
	Path           string
	Device         string
	LVPath         string
	FileSystem     string
	IsMounted      bool
	DiskUsage      int64
	MySQLDataPath  string
	MySQLDiskUsage int64
}

Mount describes a file system mount point

type SeedOperation

type SeedOperation struct {
	SeedId         int64
	TargetHostname string
	SourceHostname string
	StartTimestamp string
	EndTimestamp   string
	IsComplete     bool
	IsSuccessful   bool
}

SeedOperation makes for the high level data & state of a seed operation

func AgentSeedDetails

func AgentSeedDetails(seedId int64) ([]SeedOperation, error)

AgentSeedDetails reads details from backend table

func ReadActiveSeedsForHost

func ReadActiveSeedsForHost(hostname string) ([]SeedOperation, error)

ReadActiveSeedsForHost reads active seeds where host participates either as source or target

func ReadRecentCompletedSeedsForHost

func ReadRecentCompletedSeedsForHost(hostname string) ([]SeedOperation, error)

ReadRecentCompletedSeedsForHost reads active seeds where host participates either as source or target

func ReadRecentSeeds

func ReadRecentSeeds() ([]SeedOperation, error)

ReadRecentSeeds reads seeds from backend table.

type SeedOperationState

type SeedOperationState struct {
	SeedStateId    int64
	SeedId         int64
	StateTimestamp string
	Action         string
	ErrorMessage   string
}

SeedOperationState represents a single state (step) in a seed operation

func ReadSeedStates

func ReadSeedStates(seedId int64) ([]SeedOperationState, error)

SeedOperationState reads states for a given seed operation

Jump to

Keyboard shortcuts

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