terrafarm

package
v0.0.0-...-ae2807b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Farmer

type Farmer struct {
	Output      io.Writer
	Cwd, LogDir string
	Args        []string
	KeyName     string
	Stores      string
	// contains filtered or unexported fields
}

A Farmer sets up and manipulates a test cluster via terraform.

func (*Farmer) AbsLogDir

func (f *Farmer) AbsLogDir() string

AbsLogDir returns the absolute log dir to which logs are written.

func (*Farmer) Add

func (f *Farmer) Add(nodes, writers int) error

Add provisions the given number of nodes and block writers, respectively.

func (*Farmer) Assert

func (f *Farmer) Assert(t util.Tester)

Assert verifies that the cluster state is as expected (i.e. no unexpected restarts or node deaths occurred). Tests can call this periodically to ascertain cluster health. TODO(tschottdorf): unimplemented when nodes are expected down.

func (*Farmer) AssertAndStop

func (f *Farmer) AssertAndStop(t util.Tester)

AssertAndStop performs the same test as Assert but then proceeds to dismantle the cluster.

func (*Farmer) CollectLogs

func (f *Farmer) CollectLogs()

CollectLogs copies all possibly interesting files from all available peers if LogDir is not empty.

func (*Farmer) ConnString

func (f *Farmer) ConnString(i int) string

ConnString returns a connection string to pass to client.Open().

func (*Farmer) Destroy

func (f *Farmer) Destroy() error

Destroy collects the logs and tears down the cluster.

func (*Farmer) Exec

func (f *Farmer) Exec(i int, cmd string) error

Exec executes the given command on the i-th node, returning (in that order) stdout, stderr and an error.

func (*Farmer) Kill

func (f *Farmer) Kill(i int) error

Kill terminates the cockroach process running on the given node number. The given integer must be in the range [0,NumNodes()-1].

func (*Farmer) LoadBalancer

func (f *Farmer) LoadBalancer() string

LoadBalancer returns the load balancer address.

func (*Farmer) MustDestroy

func (f *Farmer) MustDestroy()

MustDestroy calls Destroy(), panicking on error.

func (*Farmer) Nodes

func (f *Farmer) Nodes() (hosts []string)

Nodes returns a (copied) slice of provisioned nodes' host names.

func (*Farmer) NumNodes

func (f *Farmer) NumNodes() int

NumNodes returns the number of nodes.

func (*Farmer) NumWriters

func (f *Farmer) NumWriters() int

NumWriters returns the number of block writers.

func (*Farmer) PGAddr

func (f *Farmer) PGAddr(i int) *net.TCPAddr

PGAddr returns the Postgres address for the given node.

func (*Farmer) Resize

func (f *Farmer) Resize(nodes, writers int) error

Resize is the counterpart to Add which resizes a cluster given the desired number of nodes and writers.

func (*Farmer) Restart

func (f *Farmer) Restart(i int) error

Restart terminates the cockroach process running on the given node number, unless it is already stopped, and restarts it. The given integer must be in the range [0,NumNodes()-1].

func (*Farmer) URL

func (f *Farmer) URL(i int) string

URL returns the HTTP(s) endpoint.

func (*Farmer) WaitReady

func (f *Farmer) WaitReady(d time.Duration) error

WaitReady waits until the infrastructure is in a state that *should* allow for a healthy cluster. Currently, this means waiting for the load balancer to resolve from all nodes.

func (*Farmer) Writers

func (f *Farmer) Writers() (hosts []string)

Writers returns a (copied) slice of provisioned block writers' host names.

Jump to

Keyboard shortcuts

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