package
0.7.0
Repository: https://github.com/lxc/incus.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

Accept a new node and add it to the cluster.
Assign a new role to the local dqlite node.
Bootstrap turns a non-clustered server into the first (and leader) member of a new cluster.
Connect is a convenience around incus.ConnectIncus that configures the client with the correct parameters for node-to-node communication.
ConnectIfInstanceIsRemote figures out the address of the cluster member which is running the instance with the given name in the specified project.
ConnectIfVolumeIsRemote figures out the address of the cluster member on which the volume with the given name is defined.
Count is a convenience for checking the current number of nodes in the cluster.
DqliteLog redirects dqlite's logs to our own logger.
Enabled is a convenience that returns true if clustering is enabled on this node.
EnsureServerCertificateTrusted adds the serverCert to the DB trusted certificates store using the serverName.
EventHubPush pushes the event to the event hub members if local server is an event-hub client.
EventListenerWait waits for there to be listener connected to the specified address, or one of the event hubs if operating in event hub mode.
EventsUpdateListeners refreshes the cluster event listener connections.
Handover looks for a non-voter member that can be promoted to replace a the member with the given address, which is shutting down.
HasConnectivity probes the member with the given address for connectivity.
HeartbeatNode performs a single heartbeat request against the node with the given address.
HeartbeatTask returns a task function that performs leader-initiated heartbeat checks against all cluster members in the cluster.
Join makes a non-clustered server join an existing cluster.
Latency is a coarse grain measure of how fast/reliable network links are.
Leave a cluster.
ListDatabaseNodes returns a list of database node names.
LogLevel sets the logging level for messages emitted by dqlite and raft.
MaybeUpdate Check this node's version and possibly run INCUS_CLUSTER_UPDATE.
MemberState retrieves state information about the cluster member.
NewAPIHearbeat returns initialised APIHeartbeat.
NewGateway creates a new Gateway for managing access to the dqlite cluster.
NewNotifier builds a Notifier that can be used to notify other peers using the given policy.
NotifyHeartbeat attempts to send a heartbeat to all other members to notify them of a new or changed member.
NotifyUpgradeCompleted sends a notification to all other nodes in the cluster that any possible pending database update has been applied, and any nodes which was waiting for this node to be upgraded should re-check if it's okay to move forward.
Purge removes a node entirely from the cluster database.
Rebalance the raft cluster, trying to see if we have a spare online node that we can promote to voter node if we are below membershipMaxRaftVoters, or to standby if we are below membershipMaxStandBys.
Reconfigure replaces the entire cluster configuration.
Recover attempts data recovery on the cluster database.
RemoveRaftNode removes a raft node from the raft configuration.
ResolveTarget is a convenience for resolving a target member name to address.
RoleInSlice returns whether or not the rule is within the roles list.
ServerEventMode returns the event distribution mode that this local server is operating in.
SetupTrust is a convenience around InstanceServer.CreateCertificate that adds the given server certificate to the trusted pool of the cluster at the given address, using the given token.
UpdateTrust ensures that the supplied certificate is stored in the target trust store with the correct name and type to ensure correct cluster operation.
UpgradeMembersWithoutRole assigns the Spare raft role to all cluster members that are not currently part of the raft configuration.

# Constants

EventModeFullMesh is when every cluster member connects to every other cluster member to pull events.
EventModeHubClient is when the cluster is operating in event-hub mode and this member is designated as a hub client, meaning that it is expected to connect to the event-hub members.
EventModeHubServer is when the cluster is operating in event-hub mode and this server is designated as a hub server, meaning that it will only connect to the other event-hub members and not other members.
Only notifies nodes that are alive.
Requires that all nodes are up.
Attempt to notify all nodes regardless of state.

# Variables

ErrNodeIsNotClustered indicates the node is not clustered.
ErrNotLeader signals that a node not the leader.
SchemaVersion holds the version of the cluster database schema.

# Structs

APIHeartbeat contains data sent to nodes in heartbeat.
APIHeartbeatMember contains specific cluster node info.
APIHeartbeatVersion contains max versions for all nodes in cluster.
Gateway mediates access to the dqlite cluster using a gRPC SQL client, and possibly runs a dqlite replica on this member (if we're configured to do so).

# Type aliases

EventMode indicates the event distribution mode.
HeartbeatHandler represents a function that can be called when a heartbeat request arrives.
HeartbeatHook represents a function that can be called as the heartbeat hook.
Notifier is a function that invokes the given function against each node in the cluster excluding the invoking one.
NotifierPolicy can be used to tweak the behavior of NewNotifier in case of some nodes are down.
Option to be passed to NewGateway to customize the resulting instance.