deployment

package
v0.0.0-...-f73e696 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JobMeta represents MetaServer
	JobMeta = 0

	// JobReplica represents ReplicaServer
	JobReplica = 1

	// JobCollector represents Collector
	JobCollector = 2
)

Variables

View Source
var CreateDeployment func(cluster string) Deployment = nil

CreateDeployment creates a non-nil instance of Deployment that binds to a specific cluster.

Functions

This section is empty.

Types

type Deployment

type Deployment interface {

	// Start a Pegasus node on the specified machine. A possible implementation may
	// login to the machine, download the binary package and config, and launch the
	// process.
	StartNode(Node) error

	// Stop a Pegasus node on the specified machine. A possible implementation may
	// login to the machine, and kill the process (via supervisord).
	StopNode(Node) error

	// Rolling-update a Pegasus node on the specified machine. A possible implementation
	// may login to the machine, re-download the binary package and config and restart the process.
	RollingUpdate(Node) error

	// Retrieves all nodes information in the Pegasus cluster.
	ListAllNodes() ([]Node, error)

	// Name returns a simple name identifies the deployment system.
	Name() string
}

Deployment is the abstraction of a deployment automation system that provides the ability to operate all the nodes in a Pegasus cluster. pegasus-cluster-cli operates the cluster based on `Deployment`, using graceful strategies with higher availability, less performance downgrade than directly killing/starting pegasus server.

type JobType

type JobType int

func (JobType) String

func (j JobType) String() string

type Node

type Node struct {
	Job JobType `json:"job"`

	// Node's name should be unique within the cluster.
	// There's no strict rule on the naming of a node.
	// It could be some ID like "1", "2" ..., or a hostname, UUID, TCP address, etc.
	Name string `json:"name"`

	IPPort string `json:"ip_port"`

	Hostname string `json:"hostname"`

	// Attrs contains the additional attributes that are provided by the specific Deployment.
	// This field is optional, can be left empty.
	// A typical use-case could be giving a "Status" that represents the node running status:
	//   Attrs : map[string]interface{"Status" : "Running"}
	// It will be useful to check if the node behaves normal after start/stop/rolling-update.
	Attrs map[string]interface{} `json:"attributes,omitempty"`
}

Node could be a MetaServer/ReplicaServer/Collector. Provided with a Node, the implementation of Deployment must be able to remotely operates the node.

func NewNode

func NewNode(name string, tcpAddr string, job JobType) Node

NewNode returns a Node.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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