1 .\" Copyright (c) 2010 The FreeBSD Foundation
2 .\" Copyright (c) 2010-2012 Pawel Jakub Dawidek <pawel@dawidek.net>
3 .\" All rights reserved.
5 .\" This documentation was written by Pawel Jakub Dawidek under sponsorship from
6 .\" the FreeBSD Foundation.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .Nd configuration file for the
48 Configuration file is designed in a way that exactly the same file can be
49 (and should be) used on both HAST nodes.
50 Every line starting with # is treated as comment and ignored.
51 .Sh CONFIGURATION FILE SYNTAX
55 .Bd -literal -offset indent
61 compression <algorithm>
85 compression <algorithm>
93 # Resource-node section
103 # Resource-node section
115 Most of the various available configuration parameters are optional.
116 If parameter is not defined in the particular section, it will be
117 inherited from the parent section.
120 parameter is not defined in the node section, it will be inherited from
122 In case the global section does not define the
124 parameter at all, the default value will be used.
125 .Sh CONFIGURATION FILE DESCRIPTION
128 argument can be replaced either by a full hostname as obtained by
130 only first part of the hostname, by node's UUID as found in the
134 or by node's hostid as found in the
139 The following statements are available:
140 .Bl -tag -width ".Ic xxxx"
141 .It Ic control Aq addr
143 Address for communication with
145 Each of the following examples defines the same control address:
146 .Bd -literal -offset indent
147 uds:///var/run/hastctl
148 unix:///var/run/hastctl
153 .Pa uds:///var/run/hastctl .
154 .It Ic pidfile Aq path
156 File in which to store the process ID of the main
161 .Pa /var/run/hastd.pid .
162 .It Ic listen Aq addr
164 Address to listen on in form of:
165 .Bd -literal -offset indent
166 protocol://protocol-specific-address
169 Each of the following examples defines the same listen address:
170 .Bd -literal -offset indent
179 Multiple listen addresses can be specified.
183 .Pa tcp4://0.0.0.0:8457
186 if kernel supports IPv4 and IPv6 respectively.
187 .It Ic replication Aq mode
189 Replication mode should be one of the following:
190 .Bl -tag -width ".Ic xxxx"
193 Report the write operation as completed when local write completes and
194 when the remote node acknowledges the data receipt, but before it
195 actually stores the data.
196 The data on remote node will be stored directly after sending
198 This mode is intended to reduce latency, but still provides a very good
200 The only situation where some small amount of data could be lost is when
201 the data is stored on primary node and sent to the secondary.
202 Secondary node then acknowledges data receipt and primary reports
203 success to an application.
204 However, it may happen that the secondary goes down before the received
205 data is really stored locally.
206 Before secondary node returns, primary node dies entirely.
207 When the secondary node comes back to life it becomes the new primary.
208 Unfortunately some small amount of data which was confirmed to be stored
209 to the application was lost.
210 The risk of such a situation is very small.
213 replication mode is the default.
216 Mark the write operation as completed when local as well as remote
218 This is the safest and the slowest replication mode.
221 The write operation is reported as complete right after the local write
223 This is the fastest and the most dangerous replication mode.
224 This mode should be used when replicating to a distant node where
225 latency is too high for other modes.
227 .It Ic checksum Aq algorithm
229 Checksum algorithm should be one of the following:
230 .Bl -tag -width ".Ic sha256"
232 No checksum will be calculated for the data being send over the network.
233 This is the default setting.
235 CRC32 checksum will be calculated.
237 SHA256 checksum will be calculated.
239 .It Ic compression Aq algorithm
241 Compression algorithm should be one of the following:
242 .Bl -tag -width ".Ic none"
244 Data send over the network will not be compressed.
246 Only blocks that contain all zeros will be compressed.
247 This is very useful for initial synchronization where potentially many blocks
249 There should be no measurable performance overhead when this algorithm is being
251 This is the default setting.
253 The LZF algorithm by Marc Alexander Lehmann will be used to compress the data
254 send over the network.
255 LZF is very fast, general purpose compression algorithm.
257 .It Ic timeout Aq seconds
259 Connection timeout in seconds.
264 Execute the given program on various HAST events.
265 Below is the list of currently implemented events and arguments the given
266 program is executed with:
267 .Bl -tag -width ".Ic xxxx"
268 .It Ic "<path> role <resource> <oldrole> <newrole>"
270 Executed on both primary and secondary nodes when resource role is changed.
271 .It Ic "<path> connect <resource>"
273 Executed on both primary and secondary nodes when connection for the given
274 resource between the nodes is established.
275 .It Ic "<path> disconnect <resource>"
277 Executed on both primary and secondary nodes when connection for the given
278 resource between the nodes is lost.
279 .It Ic "<path> syncstart <resource>"
281 Executed on primary node when synchronization process of secondary node is
283 .It Ic "<path> syncdone <resource>"
285 Executed on primary node when synchronization process of secondary node is
286 completed successfully.
287 .It Ic "<path> syncintr <resource>"
289 Executed on primary node when synchronization process of secondary node is
290 interrupted, most likely due to secondary node outage or connection failure
292 .It Ic "<path> split-brain <resource>"
294 Executed on both primary and secondary nodes when split-brain condition is
300 argument should contain full path to executable program.
301 If the given program exits with code different than
304 will log it as an error.
308 argument is resource name from the configuration file.
312 argument is previous resource role (before the change).
320 argument is current resource role (after the change).
325 .It Ic metaflush on | off
329 flush write cache of the local provider after every metadata (activemap) update.
330 Flushing write cache ensures that provider will not reorder writes and that
331 metadata will be properly updated before real data is stored.
332 If the local provider does not support flushing write cache (it returns
345 GEOM provider name that will appear as
346 .Pa /dev/hast/<name> .
347 If name is not defined, resource name will be used as provider name.
350 Path to the local component which will be used as backend provider for
352 This can be either GEOM provider or regular file.
353 .It Ic remote Aq addr
355 Address of the remote
358 Format is the same as for the
361 When operating as a primary node this address will be used to connect to
363 When operating as a secondary node only connections from this address
368 can be used when the remote address is not yet known (eg. the other node is not
370 .It Ic source Aq addr
372 Local address to bind to before connecting to the remote
375 Format is the same as for the
380 .Bl -tag -width ".Pa /var/run/hastctl" -compact
381 .It Pa /etc/hast.conf
387 .It Pa /var/run/hastctl
388 Control socket used by the
390 control utility to communicate with the
395 The example configuration file can look as follows:
396 .Bd -literal -offset indent
400 listen tcp://2001:db8::1/64
403 listen tcp://2001:db8::2/64
410 remote tcp://10.0.0.2
413 remote tcp://10.0.0.1
418 local /dev/mirror/tanka
419 source tcp://10.0.0.1
420 remote tcp://10.0.0.2
423 local /dev/mirror/tankb
424 source tcp://10.0.0.2
425 remote tcp://10.0.0.1
438 .An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
439 under sponsorship of the FreeBSD Foundation.