drbdmon

package
v3.0.0-rc49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

func (*Manager) Start

func (t *Manager) Start(parent context.Context) error

Start launches the drbdmon worker goroutine, where drbdsetup is installed

func (*Manager) Stop

func (t *Manager) Stop() error

Stop stops the drbdmon manager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL