Documentation
¶
Index ¶
Constants ¶
View Source
const ( MemberAlive MemberStatus = "alive" MemberLeaving = "leaving" MemberLeft = "left" MemberFailed = "failed" )
View Source
const RPCPort = 7575 // FIXME: use serf to discover agents
Default RPC port.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent interface {
// Start starts agent's background jobs.
Start() error
// Close stops background activity and releases resources.
Close() error
// Join makes an attempt to join a cluster specified by the list of peers.
Join(peers []string) error
// LocalStatus reports the health status of the local agent node.
LocalStatus() *pb.NodeStatus
// IsMember returns whether this agent is already a member of serf cluster
IsMember() bool
health.CheckerRepository
}
Agent is the interface to interact with the monitoring agent.
type Client ¶
type Client interface {
// Status reports the health status of a serf cluster.
Status(context.Context) (*pb.SystemStatus, error)
// LocalStatus reports the health status of the local serf cluster node.
LocalStatus(context.Context) (*pb.NodeStatus, error)
}
Client is an interface to communicate with the serf cluster via agent RPC.
type Config ¶
type Config struct {
// Name of the agent unique within the cluster.
// Names are used as a unique id within a serf cluster, so
// it is important to avoid clashes.
//
// Name must match the name of the local serf agent so that the agent
// can match itself to a serf member.
Name string
// RPCAddrs is a list of addresses agent binds to for RPC traffic.
//
// Usually, at least two address are used for operation.
// Localhost is a convenience for local communication. Cluster-visible
// IP is required for proper inter-communication between agents.
RPCAddrs []string
// RPC address of local serf node.
SerfRPCAddr string
// Address to listen on for web interface and telemetry for Prometheus metrics.
MetricsAddr string
// Peers lists the nodes that are part of the initial serf cluster configuration.
// This is not a final cluster configuration and new nodes or node updates
// are still possible.
Peers []string
// Set of tags for the agent.
// Tags is a trivial means for adding extra semantic information to an agent.
Tags map[string]string
// Cache is a short-lived storage used by the agent to persist latest health stats.
cache.Cache
}
type RPCServer ¶
type RPCServer interface {
Status(context.Context, *pb.StatusRequest) (*pb.StatusResponse, error)
LocalStatus(context.Context, *pb.LocalStatusRequest) (*pb.LocalStatusResponse, error)
Stop()
}
RPCServer is the interface that defines the interaction with an agent via RPC.
Directories
¶
| Path | Synopsis |
|---|---|
|
influxdb
package influxdb implements a backend to InfluxDB (https://influxdata.com)
|
package influxdb implements a backend to InfluxDB (https://influxdata.com) |
|
package health defines health checking primitives.
|
package health defines health checking primitives. |
|
proto
|
|
|
agentpb
Package agentpb is a generated protocol buffer package.
|
Package agentpb is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.