Documentation
¶
Overview ¶
Package drbdmon watches the state changes of the drbd resources, and publishes them as pubsub events, for the instances holding a drbd resource to evaluate their status again.
A drbd resource changes state with no action of the node to tell: its peers connect once it is up, a resync ends when it ends, a peer taking its disk down leaves a connection lost. The status read at the end of an action, or on a peer event, sees the state of that moment, and whatever follows stays unseen until the next scheduled status. Guessing when to read it again does not work for a resync, whose length depends on how much data it moves.
It reads the event stream "drbdsetup events2" prints, which drbd 9 offers on every distribution the agent supports, down to el7. Where the requirements are not met, the monitor disables itself and says so once: drbdsetup not installed, or an event stream the installed drbd does not support or keeps failing. A node where the drbd kernel module is not loaded yet waits for it, as the first drbd resource brought up loads it. Without the monitor, a drbd state change is seen at the next scheduled status.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager watches the drbd events and publishes a DrbdResourceUpdated message for each drbd resource whose state changed.
func NewManager ¶
func NewManager(drainDuration time.Duration, subQS pubsub.QueueSizer) *Manager
NewManager creates a new drbd monitor manager