daemon is responsible for managing highly available GEOM providers.
allows to transparently store data on two physically separated machines
connected over the TCP/IP network.
Only one machine (cluster node) can actively use storage provided by
This machine is called primary.
daemon operates on block level, which makes it transparent to file
systems and applications.
There is one main
daemon which starts new worker process as soon as a role for the given
resource is changed to primary or as soon as a role for the given
resource is changed to secondary and remote (primary) node will
successfully connect to it.
Every worker process gets a new process title (see
which describes its role and resource it controls.
The exact format is:
hastd: <resource name> (<role>)
If (and only if)
operates in primary role for the given resource, a corresponding
disk-like device (GEOM provider) is created.
File systems and applications can use this provider to send I/O
Every write, delete and flush operation
( BIO_WRITE, BIO_DELETE, BIO_FLUSH)
is sent to the local component and replicated on the remote (secondary) node
if it is available.
are handled locally unless an I/O error occurs or the local version of the data
is not up-to-date yet (synchronization is in progress).
daemon uses the GEOM Gate class to receive I/O requests from the
in-kernel GEOM infrastructure.
module is loaded automatically if the kernel was not compiled with the
.Cd options GEOM_GATE
The connection between two
daemons is always initiated from the one running as primary to the one
running as secondary.
When the primary
is unable to connect or the connection fails, it will try to re-establish
the connection every few seconds.
Once the connection is established, the primary
will synchronize every extent that was modified during connection outage
to the secondary
It is possible that in the case of a connection outage between the nodes the
primary role for the given resource will be configured on both nodes.
This in turn leads to incompatible data modifications.
Such a condition is called a split-brain and cannot be automatically
resolved by the
daemon as this will lead most likely to data corruption or loss of
Even though it cannot be fixed by
itself, it will be detected and a further connection between independently
modified nodes will not be possible.
Once this situation is manually resolved by an administrator, the resource
on one of the nodes can be initialized (erasing local data), which makes
a connection to the remote node possible again.
Connection of the freshly initialized component will trigger full resource
daemon never picks its role automatically.
The role has to be configured with the
control utility by additional software like
that can reliably manage role separation and switch secondary node to
primary role in case of the primarys failure.
daemon can be started with the following command line arguments:
Specify alternative location of the configuration file.
The default location is
Print or log debugging information.
This option can be specified multiple times to raise the verbosity
daemon in the foreground.
starts in the background.
Specify alternative location of a file where main process PID will be
The default location is