HASTCTL(8)
πΈ NAME πΈ
Bestie, meet hastctl(8) β aka HASTCTL(8) from the System Manager's Manual β the Highly Available Storage control utility π. She's the command-line control girlie for the hastd(8) daemon, and she's about to make your HAST life make sense, no cap.
π¦ SYNOPSIS π¦
hastctl create [-d] [-c config] [-e extentsize] [-k keepdirty]
[-m mediasize] name ...
hastctl role [-d] [-c config] β¨init | primary | secondaryβ© all | name
...
hastctl list [-d] [-c config] [all | name ...]
hastctl status [-d] [-c config] [all | name ...]
hastctl dump [-d] [-c config] [all | name ...]
π DESCRIPTION π
Okay so the hastctl utility is used to control the behaviour of the hastd(8) daemon. Main character energy, honestly.
This utility should be used by HA software like heartbeat or ucarp to setup HAST resources role when changing from primary mode to secondary or vice versa. Be aware that if a file system like UFS exists on HAST provider and primary node dies, file system has to be checked for inconsistencies with the fsck(8) utility after switching secondary node to primary role. That part is important, bestie β do not skip the fsck.
The first argument to hastctl indicates an action to be performed:
createβ Initialize local provider configured for the given resource. Additional options include:-eextentsize β Size of an extent. Extent is a block which is used for synchronization.hastd(8)maintains a map of dirty extents and extent is the smallest region that can be marked as dirty. If any part of an extent is modified, entire extent will be synchronized when nodes connect. If extent size is too small, there will be too much disk activity related to dirty map updates, which will degrade performance of the given resource. If extent size is too large, synchronization, even in case of short outage, can take a long time increasing the risk of losing up-to-date node before synchronization process is completed. The default extent size is2MB.-kkeepdirty β Maximum number of dirty extents to keep dirty all the time. Most recently used extents are kept dirty to reduce number of metadata updates. The default number of most recently used extents which will be kept dirty is64.-mmediasize β Size of the smaller provider used as backend storage on both nodes. This option can be omitted if node providers have the same size on both sides.
If size is suffixed with a k, M, G or T, it is taken as a kilobyte, megabyte, gigabyte or terabyte measurement respectively. iykyk, units matter π
roleβ Change role of the given resource. The role can be one of:initβ Resource is turned off.primaryβ Localhastd(8)daemon will act as primary node for the given resource. System on which resource role is set to primary can use/dev/hast/<name>GEOM provider.secondaryβ Localhastd(8)daemon will act as secondary node for the given resource β it will wait for connection from the primary node and will handle I/O requests received from it. GEOM provider/dev/hast/<name>will not be created on secondary node.
listβ Present verbose status of the configured resources.statusβ Present terse (and more easy machine-parseable) status of the configured resources.dumpβ Dump metadata stored on local component for the configured resources.
In addition, every subcommand can be followed by the following options:
-cconfig β Specify alternative location of the configuration file. The default location is/etc/hast.conf.-dβ Print debugging information. This option can be specified multiple times to raise the verbosity level. Spam it for maximum gossip from the daemon β¨
π FILES π
/etc/hast.confβ Configuration file forhastctlandhastd(8)./var/run/hastctlβ Control socket used byhastctlto communicate with thehastd(8)daemon.
π EXIT STATUS π
Exit status is 0 on success, or one of the values described in sysexits(3) on failure. Slay when it's zero, check the docs when it's not π
π EXAMPLES π
π§ Example 1: initialize HAST provider, create file system on it and mount it
Initialize HAST provider, create file system on it and mount it.
nodeB# hastctl create shared
nodeB# hastd
nodeB# hastctl role secondary shared
nodeA# hastctl create shared
nodeA# hastd
nodeA# hastctl role primary shared
nodeA# newfs -U /dev/hast/shared
nodeA# mount -o noatime /dev/hast/shared /shared
nodeA# application_start
π§ Example 2: switch roles for the shared HAST resource
Switch roles for the shared HAST resource.
nodeA# application_stop
nodeA# umount -f /shared
nodeA# hastctl role secondary shared
nodeB# hastctl role primary shared
nodeB# fsck -t ufs /dev/hast/shared
nodeB# mount -o noatime /dev/hast/shared /shared
nodeB# application_start
π SEE ALSO π
sysexits(3), geom(4), hast.conf(5), fsck(8), ggatec(8), ggatel(8), hastd(8), mount(8), newfs(8)
π¦ HISTORY π¦
The hastctl utility appeared in FreeBSD 8.1. OG status, fr fr π«Ά
π AUTHORS π
The hastctl was developed by Pawel Jakub Dawidek <pjd@FreeBSD.org> under sponsorship of the FreeBSD Foundation. Iconic collaboration, periodt π
And that's the whole page, bestie β signed off by Debian, dated September 8, 2016, for HASTCTL(8). Byeee π β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2010 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms