Documentation ¶
Index ¶
- Variables
- func AbortSeed(seedId int64) error
- func CustomCommand(hostname string, cmd string) (output string, err error)
- func DiscoverAgentInstance(hostname string, port int) error
- func FailStaleSeeds() error
- func ForgetLongUnseenAgents() error
- func InitHttpClient()
- func ReadOutdatedAgentsHosts() ([]string, error)
- func Seed(targetHostname string, sourceHostname string) (int64, error)
- func SubmitAgent(hostname string, port int, token string) (string, error)
- func SubmitSeedEntry(targetHostname string, sourceHostname string) (int64, error)
- func UpdateAgentInfo(hostname string, agent Agent) error
- func UpdateAgentLastChecked(hostname string) error
- type Agent
- func AbortSeedCommand(hostname string, seedId int64) (Agent, error)
- func CreateSnapshot(hostname string) (Agent, error)
- func GetAgent(hostname string) (Agent, error)
- func MountLV(hostname string, lv string) (Agent, error)
- func MySQLStart(hostname string) (Agent, error)
- func MySQLStop(hostname string) (Agent, error)
- func PostCopy(hostname string) (Agent, error)
- func ReadAgents() ([]Agent, error)
- func ReceiveMySQLSeedData(hostname string, seedId int64) (Agent, error)
- func RemoveLV(hostname string, lv string) (Agent, error)
- func SendMySQLSeedData(hostname string, targetHostname string, seedId int64) (Agent, error)
- func Unmount(hostname string) (Agent, error)
- type LogicalVolume
- type Mount
- type SeedOperation
- type SeedOperationState
Constants ¶
This section is empty.
Variables ¶
var SeededAgents chan *Agent = make(chan *Agent)
Functions ¶
func DiscoverAgentInstance ¶
If a mysql port is available, try to discover against it
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 InitHttpClient ¶
func InitHttpClient()
InitHttpClient gets called once, and initializes httpClient according to config.Config
func ReadOutdatedAgentsHosts ¶
ReadOutdatedAgentsHosts returns agents that need to be updated
func SubmitAgent ¶
SubmitAgent submits a new agent for listing
func SubmitSeedEntry ¶
SubmitSeedEntry submits a new seed operation entry, returning its unique ID
func UpdateAgentInfo ¶
UpdateAgentInfo updates some agent state in backend table
func UpdateAgentLastChecked ¶
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 ¶
ReceiveMySQLSeedData requests an agent to abort seed send/receive (depending on the agent's role)
func CreateSnapshot ¶
CreateSnapshot requests an agent to create a new snapshot -- a DIY implementation
func GetAgent ¶
GetAgent gets a single agent status from the agent service. This involves multiple HTTP requests.
func MySQLStart ¶
MySQLStart requests an agent to start the MySQL service
func ReceiveMySQLSeedData ¶
ReceiveMySQLSeedData requests an agent to start listening for incoming seed data
func SendMySQLSeedData ¶
ReceiveMySQLSeedData requests an agent to start sending seed data
func (*Agent) GetInstance ¶
func (this *Agent) GetInstance() *inst.InstanceKey
Build an instance key for a given agent
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