132115b10SPawel Jakub Dawidek.\" Copyright (c) 2010 The FreeBSD Foundation 232115b10SPawel Jakub Dawidek.\" 332115b10SPawel Jakub Dawidek.\" This software was developed by Pawel Jakub Dawidek under sponsorship from 432115b10SPawel Jakub Dawidek.\" the FreeBSD Foundation. 532115b10SPawel Jakub Dawidek.\" 632115b10SPawel Jakub Dawidek.\" Redistribution and use in source and binary forms, with or without 732115b10SPawel Jakub Dawidek.\" modification, are permitted provided that the following conditions 832115b10SPawel Jakub Dawidek.\" are met: 932115b10SPawel Jakub Dawidek.\" 1. Redistributions of source code must retain the above copyright 1032115b10SPawel Jakub Dawidek.\" notice, this list of conditions and the following disclaimer. 1132115b10SPawel Jakub Dawidek.\" 2. Redistributions in binary form must reproduce the above copyright 1232115b10SPawel Jakub Dawidek.\" notice, this list of conditions and the following disclaimer in the 1332115b10SPawel Jakub Dawidek.\" documentation and/or other materials provided with the distribution. 1432115b10SPawel Jakub Dawidek.\" 1532115b10SPawel Jakub Dawidek.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 1632115b10SPawel Jakub Dawidek.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1732115b10SPawel Jakub Dawidek.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1832115b10SPawel Jakub Dawidek.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 1932115b10SPawel Jakub Dawidek.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2032115b10SPawel Jakub Dawidek.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2132115b10SPawel Jakub Dawidek.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2232115b10SPawel Jakub Dawidek.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2332115b10SPawel Jakub Dawidek.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2432115b10SPawel Jakub Dawidek.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2532115b10SPawel Jakub Dawidek.\" SUCH DAMAGE. 2632115b10SPawel Jakub Dawidek.\" 27*0fcf43f6SAllan Jude.Dd September 8, 2016 2832115b10SPawel Jakub Dawidek.Dt HASTCTL 8 2932115b10SPawel Jakub Dawidek.Os 3032115b10SPawel Jakub Dawidek.Sh NAME 3132115b10SPawel Jakub Dawidek.Nm hastctl 3232115b10SPawel Jakub Dawidek.Nd "Highly Available Storage control utility" 3332115b10SPawel Jakub Dawidek.Sh SYNOPSIS 3432115b10SPawel Jakub Dawidek.Nm 3532115b10SPawel Jakub Dawidek.Cm create 3632115b10SPawel Jakub Dawidek.Op Fl d 3732115b10SPawel Jakub Dawidek.Op Fl c Ar config 3832115b10SPawel Jakub Dawidek.Op Fl e Ar extentsize 3932115b10SPawel Jakub Dawidek.Op Fl k Ar keepdirty 4032115b10SPawel Jakub Dawidek.Op Fl m Ar mediasize 4132115b10SPawel Jakub Dawidek.Ar name ... 4232115b10SPawel Jakub Dawidek.Nm 4332115b10SPawel Jakub Dawidek.Cm role 4432115b10SPawel Jakub Dawidek.Op Fl d 4532115b10SPawel Jakub Dawidek.Op Fl c Ar config 4632115b10SPawel Jakub Dawidek.Aq init | primary | secondary 4732115b10SPawel Jakub Dawidek.Ar all | name ... 4832115b10SPawel Jakub Dawidek.Nm 495632176cSDmitry Morozovsky.Cm list 505632176cSDmitry Morozovsky.Op Fl d 515632176cSDmitry Morozovsky.Op Fl c Ar config 525632176cSDmitry Morozovsky.Op Ar all | name ... 535632176cSDmitry Morozovsky.Nm 5432115b10SPawel Jakub Dawidek.Cm status 5532115b10SPawel Jakub Dawidek.Op Fl d 5632115b10SPawel Jakub Dawidek.Op Fl c Ar config 5732115b10SPawel Jakub Dawidek.Op Ar all | name ... 5832115b10SPawel Jakub Dawidek.Nm 5932115b10SPawel Jakub Dawidek.Cm dump 6032115b10SPawel Jakub Dawidek.Op Fl d 6132115b10SPawel Jakub Dawidek.Op Fl c Ar config 6232115b10SPawel Jakub Dawidek.Op Ar all | name ... 6332115b10SPawel Jakub Dawidek.Sh DESCRIPTION 6432115b10SPawel Jakub DawidekThe 6532115b10SPawel Jakub Dawidek.Nm 6632115b10SPawel Jakub Dawidekutility is used to control the behaviour of the 6732115b10SPawel Jakub Dawidek.Xr hastd 8 6832115b10SPawel Jakub Dawidekdaemon. 6932115b10SPawel Jakub Dawidek.Pp 7032115b10SPawel Jakub DawidekThis utility should be used by HA software like 7132115b10SPawel Jakub Dawidek.Nm heartbeat 7232115b10SPawel Jakub Dawidekor 7332115b10SPawel Jakub Dawidek.Nm ucarp 7432115b10SPawel Jakub Dawidekto setup HAST resources role when changing from primary mode to 7532115b10SPawel Jakub Dawideksecondary or vice versa. 7632115b10SPawel Jakub DawidekBe aware that if a file system like UFS exists on HAST provider and 7732115b10SPawel Jakub Dawidekprimary node dies, file system has to be checked for inconsistencies 7832115b10SPawel Jakub Dawidekwith the 7932115b10SPawel Jakub Dawidek.Xr fsck 8 8032115b10SPawel Jakub Dawidekutility after switching secondary node to primary role. 8132115b10SPawel Jakub Dawidek.Pp 8232115b10SPawel Jakub DawidekThe first argument to 8332115b10SPawel Jakub Dawidek.Nm 8432115b10SPawel Jakub Dawidekindicates an action to be performed: 8532115b10SPawel Jakub Dawidek.Bl -tag -width ".Cm create" 8632115b10SPawel Jakub Dawidek.It Cm create 8732115b10SPawel Jakub DawidekInitialize local provider configured for the given resource. 8832115b10SPawel Jakub DawidekAdditional options include: 8932115b10SPawel Jakub Dawidek.Bl -tag -width ".Fl e Ar extentsize" 9032115b10SPawel Jakub Dawidek.It Fl e Ar extentsize 9132115b10SPawel Jakub DawidekSize of an extent. 9232115b10SPawel Jakub DawidekExtent is a block which is used for synchronization. 93d4aac54cSMikolaj Golub.Xr hastd 8 9432115b10SPawel Jakub Dawidekmaintains a map of dirty extents and extent is the smallest region that 9532115b10SPawel Jakub Dawidekcan be marked as dirty. 9632115b10SPawel Jakub DawidekIf any part of an extent is modified, entire extent will be synchronized 9732115b10SPawel Jakub Dawidekwhen nodes connect. 9832115b10SPawel Jakub DawidekIf extent size is too small, there will be too much disk activity 9932115b10SPawel Jakub Dawidekrelated to dirty map updates, which will degrade performance of the 10032115b10SPawel Jakub Dawidekgiven resource. 10132115b10SPawel Jakub DawidekIf extent size is too large, synchronization, even in case of short 1024b85a12fSUlrich Spörleinoutage, can take a long time increasing the risk of losing up-to-date 10332115b10SPawel Jakub Dawideknode before synchronization process is completed. 10432115b10SPawel Jakub DawidekThe default extent size is 10532115b10SPawel Jakub Dawidek.Va 2MB . 10632115b10SPawel Jakub Dawidek.It Fl k Ar keepdirty 10732115b10SPawel Jakub DawidekMaximum number of dirty extents to keep dirty all the time. 10832115b10SPawel Jakub DawidekMost recently used extents are kept dirty to reduce number of metadata 10932115b10SPawel Jakub Dawidekupdates. 110c2025a76SJoel DahlThe default number of most recently used extents which will be kept 11132115b10SPawel Jakub Dawidekdirty is 11232115b10SPawel Jakub Dawidek.Va 64 . 11332115b10SPawel Jakub Dawidek.It Fl m Ar mediasize 11432115b10SPawel Jakub DawidekSize of the smaller provider used as backend storage on both nodes. 11532115b10SPawel Jakub DawidekThis option can be omitted if node providers have the same size on both 11632115b10SPawel Jakub Dawideksides. 11732115b10SPawel Jakub Dawidek.El 118e7272ff3SMikolaj Golub.Pp 119e7272ff3SMikolaj GolubIf size is suffixed with a k, M, G or T, it is taken as a kilobyte, 120e7272ff3SMikolaj Golubmegabyte, gigabyte or terabyte measurement respectively. 12132115b10SPawel Jakub Dawidek.It Cm role 12232115b10SPawel Jakub DawidekChange role of the given resource. 12332115b10SPawel Jakub DawidekThe role can be one of: 12432115b10SPawel Jakub Dawidek.Bl -tag -width ".Cm secondary" 12532115b10SPawel Jakub Dawidek.It Cm init 12632115b10SPawel Jakub DawidekResource is turned off. 12732115b10SPawel Jakub Dawidek.It Cm primary 12832115b10SPawel Jakub DawidekLocal 12932115b10SPawel Jakub Dawidek.Xr hastd 8 13032115b10SPawel Jakub Dawidekdaemon will act as primary node for the given resource. 13132115b10SPawel Jakub DawidekSystem on which resource role is set to primary can use 13232115b10SPawel Jakub Dawidek.Pa /dev/hast/<name> 13332115b10SPawel Jakub DawidekGEOM provider. 13432115b10SPawel Jakub Dawidek.It Cm secondary 13532115b10SPawel Jakub DawidekLocal 13632115b10SPawel Jakub Dawidek.Xr hastd 8 13732115b10SPawel Jakub Dawidekdaemon will act as secondary node for the given resource - it will wait 13832115b10SPawel Jakub Dawidekfor connection from the primary node and will handle I/O requests 13932115b10SPawel Jakub Dawidekreceived from it. 14032115b10SPawel Jakub DawidekGEOM provider 14132115b10SPawel Jakub Dawidek.Pa /dev/hast/<name> 14232115b10SPawel Jakub Dawidekwill not be created on secondary node. 14332115b10SPawel Jakub Dawidek.El 1445632176cSDmitry Morozovsky.It Cm list 1455632176cSDmitry MorozovskyPresent verbose status of the configured resources. 14632115b10SPawel Jakub Dawidek.It Cm status 1475632176cSDmitry MorozovskyPresent terse (and more easy machine-parseable) status of the configured 1485632176cSDmitry Morozovskyresources. 14932115b10SPawel Jakub Dawidek.It Cm dump 15032115b10SPawel Jakub DawidekDump metadata stored on local component for the configured resources. 15132115b10SPawel Jakub Dawidek.El 15232115b10SPawel Jakub Dawidek.Pp 15332115b10SPawel Jakub DawidekIn addition, every subcommand can be followed by the following options: 15432115b10SPawel Jakub Dawidek.Bl -tag -width ".Fl c Ar config" 15532115b10SPawel Jakub Dawidek.It Fl c Ar config 15632115b10SPawel Jakub DawidekSpecify alternative location of the configuration file. 15732115b10SPawel Jakub DawidekThe default location is 15832115b10SPawel Jakub Dawidek.Pa /etc/hast.conf . 15932115b10SPawel Jakub Dawidek.It Fl d 16032115b10SPawel Jakub DawidekPrint debugging information. 16132115b10SPawel Jakub DawidekThis option can be specified multiple times to raise the verbosity 16232115b10SPawel Jakub Dawideklevel. 16332115b10SPawel Jakub Dawidek.El 1640b31f1f7SUlrich Spörlein.Sh FILES 1650b31f1f7SUlrich Spörlein.Bl -tag -width ".Pa /var/run/hastctl" -compact 1660b31f1f7SUlrich Spörlein.It Pa /etc/hast.conf 1670b31f1f7SUlrich SpörleinConfiguration file for 1680b31f1f7SUlrich Spörlein.Nm 1690b31f1f7SUlrich Spörleinand 1700b31f1f7SUlrich Spörlein.Xr hastd 8 . 1710b31f1f7SUlrich Spörlein.It Pa /var/run/hastctl 1720b31f1f7SUlrich SpörleinControl socket used by 1730b31f1f7SUlrich Spörlein.Nm 1740b31f1f7SUlrich Spörleinto communicate with the 1750b31f1f7SUlrich Spörlein.Xr hastd 8 1760b31f1f7SUlrich Spörleindaemon. 1770b31f1f7SUlrich Spörlein.El 17832115b10SPawel Jakub Dawidek.Sh EXIT STATUS 17932115b10SPawel Jakub DawidekExit status is 0 on success, or one of the values described in 18032115b10SPawel Jakub Dawidek.Xr sysexits 3 18132115b10SPawel Jakub Dawidekon failure. 18232115b10SPawel Jakub Dawidek.Sh EXAMPLES 18332115b10SPawel Jakub DawidekInitialize HAST provider, create file system on it and mount it. 18432115b10SPawel Jakub Dawidek.Bd -literal -offset indent 18532115b10SPawel Jakub DawideknodeB# hastctl create shared 18632115b10SPawel Jakub DawideknodeB# hastd 18732115b10SPawel Jakub DawideknodeB# hastctl role secondary shared 18832115b10SPawel Jakub Dawidek 1893d3063c0SPawel Jakub DawideknodeA# hastctl create shared 19032115b10SPawel Jakub DawideknodeA# hastd 19132115b10SPawel Jakub DawideknodeA# hastctl role primary shared 19232115b10SPawel Jakub DawideknodeA# newfs -U /dev/hast/shared 19332115b10SPawel Jakub DawideknodeA# mount -o noatime /dev/hast/shared /shared 19432115b10SPawel Jakub DawideknodeA# application_start 19532115b10SPawel Jakub Dawidek.Ed 19632115b10SPawel Jakub Dawidek.Pp 19732115b10SPawel Jakub DawidekSwitch roles for the 19832115b10SPawel Jakub Dawidek.Nm shared 19932115b10SPawel Jakub DawidekHAST resource. 20032115b10SPawel Jakub Dawidek.Bd -literal -offset indent 20132115b10SPawel Jakub DawideknodeA# application_stop 20232115b10SPawel Jakub DawideknodeA# umount -f /shared 20332115b10SPawel Jakub DawideknodeA# hastctl role secondary shared 20432115b10SPawel Jakub Dawidek 20532115b10SPawel Jakub DawideknodeB# hastctl role primary shared 20632115b10SPawel Jakub DawideknodeB# fsck -t ufs /dev/hast/shared 20732115b10SPawel Jakub DawideknodeB# mount -o noatime /dev/hast/shared /shared 20832115b10SPawel Jakub DawideknodeB# application_start 20932115b10SPawel Jakub Dawidek.Ed 21032115b10SPawel Jakub Dawidek.Sh SEE ALSO 21132115b10SPawel Jakub Dawidek.Xr sysexits 3 , 21232115b10SPawel Jakub Dawidek.Xr geom 4 , 21332115b10SPawel Jakub Dawidek.Xr hast.conf 5 , 21432115b10SPawel Jakub Dawidek.Xr fsck 8 , 21532115b10SPawel Jakub Dawidek.Xr ggatec 8 , 21632115b10SPawel Jakub Dawidek.Xr ggatel 8 , 21732115b10SPawel Jakub Dawidek.Xr hastd 8 , 21832115b10SPawel Jakub Dawidek.Xr mount 8 , 219344c81a1SWarren Block.Xr newfs 8 220*0fcf43f6SAllan Jude.Sh HISTORY 221*0fcf43f6SAllan JudeThe 222*0fcf43f6SAllan Jude.Nm 223*0fcf43f6SAllan Judeutility appeared in 224*0fcf43f6SAllan Jude.Fx 8.1 . 22532115b10SPawel Jakub Dawidek.Sh AUTHORS 22632115b10SPawel Jakub DawidekThe 22732115b10SPawel Jakub Dawidek.Nm 22832115b10SPawel Jakub Dawidekwas developed by 229bd0891ceSBaptiste Daroussin.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org 23032115b10SPawel Jakub Dawidekunder sponsorship of the FreeBSD Foundation. 231