1 .\" Copyright (c) 2010 The FreeBSD Foundation
2 .\" All rights reserved.
4 .\" This software was developed by Pawel Jakub Dawidek under sponsorship from
5 .\" the FreeBSD Foundation.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd "Highly Available Storage control utility"
41 .Op Fl e Ar extentsize
49 .Aq init | primary | secondary
69 utility is used to control the behaviour of the
73 This utility should be used by HA software like
77 to setup HAST resources role when changing from primary mode to
78 secondary or vice versa.
79 Be aware that if a file system like UFS exists on HAST provider and
80 primary node dies, file system has to be checked for inconsistencies
83 utility after switching secondary node to primary role.
87 indicates an action to be performed:
88 .Bl -tag -width ".Cm create"
90 Initialize local provider configured for the given resource.
91 Additional options include:
92 .Bl -tag -width ".Fl e Ar extentsize"
93 .It Fl e Ar extentsize
95 Extent is a block which is used for synchronization.
97 maintains a map of dirty extents and extent is the smallest region that
98 can be marked as dirty.
99 If any part of an extent is modified, entire extent will be synchronized
101 If extent size is too small, there will be too much disk activity
102 related to dirty map updates, which will degrade performance of the
104 If extent size is too large, synchronization, even in case of short
105 outage, can take a long time increasing the risk of losing up-to-date
106 node before synchronization process is completed.
107 The default extent size is
109 .It Fl k Ar keepdirty
110 Maximum number of dirty extents to keep dirty all the time.
111 Most recently used extents are kept dirty to reduce number of metadata
113 The default number of most recently used extents which will be kept
116 .It Fl m Ar mediasize
117 Size of the smaller provider used as backend storage on both nodes.
118 This option can be omitted if node providers have the same size on both
122 If size is suffixed with a k, M, G or T, it is taken as a kilobyte,
123 megabyte, gigabyte or terabyte measurement respectively.
125 Change role of the given resource.
126 The role can be one of:
127 .Bl -tag -width ".Cm secondary"
129 Resource is turned off.
133 daemon will act as primary node for the given resource.
134 System on which resource role is set to primary can use
140 daemon will act as secondary node for the given resource - it will wait
141 for connection from the primary node and will handle I/O requests
145 will not be created on secondary node.
148 Present verbose status of the configured resources.
150 Present terse (and more easy machine-parseable) status of the configured
153 Dump metadata stored on local component for the configured resources.
156 In addition, every subcommand can be followed by the following options:
157 .Bl -tag -width ".Fl c Ar config"
159 Specify alternative location of the configuration file.
160 The default location is
163 Print debugging information.
164 This option can be specified multiple times to raise the verbosity
168 .Bl -tag -width ".Pa /var/run/hastctl" -compact
169 .It Pa /etc/hast.conf
170 Configuration file for
174 .It Pa /var/run/hastctl
175 Control socket used by
177 to communicate with the
182 Exit status is 0 on success, or one of the values described in
186 Initialize HAST provider, create file system on it and mount it.
187 .Bd -literal -offset indent
188 nodeB# hastctl create shared
190 nodeB# hastctl role secondary shared
192 nodeA# hastctl create shared
194 nodeA# hastctl role primary shared
195 nodeA# newfs -U /dev/hast/shared
196 nodeA# mount -o noatime /dev/hast/shared /shared
197 nodeA# application_start
203 .Bd -literal -offset indent
204 nodeA# application_stop
205 nodeA# umount -f /shared
206 nodeA# hastctl role secondary shared
208 nodeB# hastctl role primary shared
209 nodeB# fsck -t ufs /dev/hast/shared
210 nodeB# mount -o noatime /dev/hast/shared /shared
211 nodeB# application_start
227 .An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
228 under sponsorship of the FreeBSD Foundation.