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 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.
Click to show internal directories.
Click to hide internal directories.