Documentation ¶
Overview ¶
Copyright 2016 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( MemberAlive MemberStatus = "alive" MemberLeaving = "leaving" MemberLeft = "left" MemberFailed = "failed" )
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 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 // 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.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.