fc58c31b717a3c6d2cdad237a032440bfee4e00a
[nivanova/samba-autobuild/.git] / ctdb / doc / ctdbd.conf.5.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry
3         PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4         "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
5
6 <refentry id="ctdbd.conf.5">
7
8   <refmeta>
9     <refentrytitle>ctdbd.conf</refentrytitle>
10     <manvolnum>5</manvolnum>
11     <refmiscinfo class="source">ctdb</refmiscinfo>
12     <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
13   </refmeta>
14
15   <refnamediv>
16     <refname>ctdbd.conf</refname>
17     <refpurpose>CTDB daemon configuration file</refpurpose>
18   </refnamediv>
19
20   <refsect1>
21     <title>DESCRIPTION</title>
22
23     <para>
24       This file contains CTDB configuration variables that are affect
25       the operation of CTDB.  The default location of this file is
26       <filename>/usr/local/etc/ctdb/ctdbd.conf</filename>.
27     </para>
28
29     <para>
30       This file is a shell script (see
31       <citerefentry><refentrytitle>sh</refentrytitle>
32       <manvolnum>1</manvolnum></citerefentry>) but is usually limited
33       to simple variable assignments and shell-style comments.
34     </para>
35
36     <para>
37       CTDB configuration variables are grouped into several categories below.
38     </para>
39
40     <para>
41       Variables defined in this document can also be set in a
42       distribution-specific configuration file such as
43       <filename>/etc/sysconfig/ctdb</filename> (Red Hat) or
44       <filename>/etc/default/ctdb</filename> (Debian).  However, these
45       files should be reserved for variables used by the initscript.
46       A historical alternative is
47       <filename>/usr/local/etc/ctdb/sysconfig/ctdb</filename> - this is
48       deprecated.
49     </para>
50
51   </refsect1>
52
53   <refsect1>
54     <title>
55       INITSCRIPT CONFIGURATION
56     </title>
57
58     <para>
59       Some options must be available to the initscript so they need to
60       be set in the distribution-specific initscript configuration,
61       such as <filename>/etc/sysconfig/ctdb</filename> or
62       <filename>/etc/default/ctdb</filename>.
63     </para>
64
65     <variablelist>
66
67       <varlistentry>
68         <term>CTDB_PIDFILE=<parameter>FILENAME</parameter></term>
69         <listitem>
70           <para>
71             FILENAME is the name of the file used to contain the
72             process ID (PID) of the main CTDB daemon when it is
73             running.  This is passed from the initscript to
74             <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
75             <manvolnum>1</manvolnum></citerefentry>.
76           </para>
77
78           <para>
79             Default is <filename>/usr/local/var/run/ctdb/ctdbd.pid</filename>.
80             Corresponds to <option>--pidfile</option>.
81           </para>
82         </listitem>
83       </varlistentry>
84
85     </variablelist>
86   </refsect1>
87
88   <refsect1>
89     <title>
90       GLOBAL CONFIGURATION
91     </title>
92
93     <para>
94       These options may be used in the initscripts, daemon and
95       scripts.
96     </para>
97
98     <variablelist>
99
100       <varlistentry>
101         <term>CTDB_BASE=<parameter>DIRECTORY</parameter></term>
102         <listitem>
103           <para>
104             DIRECTORY containing CTDB scripts and configuration files.
105           </para>
106         </listitem>
107       </varlistentry>
108
109     </variablelist>
110   </refsect1>
111
112   <refsect1>
113     <title>
114       DAEMON CONFIGURATION
115     </title>
116
117     <para>
118       Variables in this section are processed by
119       <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
120       <manvolnum>1</manvolnum></citerefentry> and are converted into
121       command-line arguments to
122       <citerefentry><refentrytitle>ctdbd</refentrytitle>
123       <manvolnum>1</manvolnum></citerefentry>.  Correspondence with
124       <citerefentry><refentrytitle>ctdbd</refentrytitle>
125       <manvolnum>1</manvolnum></citerefentry> options is shown for
126       each variable.  The the documentation for the relevant options
127       for more details.
128     </para>
129
130     <para>
131       Many of these variables are also used by event scripts.
132     </para>
133
134     <variablelist>
135
136       <varlistentry>
137         <term>CTDB_CAPABILITY_LMASTER=yes|no</term>
138         <listitem>
139           <para>
140             Defaults to yes.  Corresponds to <option>--no-lmaster</option>.
141           </para>
142         </listitem>
143       </varlistentry>
144
145       <varlistentry>
146         <term>CTDB_CAPABILITY_RECMASTER=yes|no</term>
147         <listitem>
148           <para>
149             Defaults to yes.  Corresponds to
150             <option>--no-recmaster</option>.
151           </para>
152         </listitem>
153       </varlistentry>
154
155       <varlistentry>
156         <term>CTDB_DBDIR=<parameter>DIRECTORY</parameter></term>
157         <listitem>
158           <para>
159             Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
160           </para>
161           <para>
162             Apart from a DIRECTORY, this can take a special value of
163             the form
164             <option>tmpfs</option><optional>:<parameter>OPTIONS</parameter></optional>.
165             OPTIONS is a comma-separated list of any permissible
166             options to the tmpfs filesystem.  The only pre-specified
167             default is <option>mode=700</option>, which can
168             overriden by specifying <option>mode</option> in
169             OPTIONS.  It probably makes sense to specify a maximum
170             <option>size</option>.
171           </para>
172           <para>
173             Corresponds to <option>--dbdir</option>.
174           </para>
175         </listitem>
176       </varlistentry>
177
178       <varlistentry>
179         <term>CTDB_DBDIR_PERSISTENT=<parameter>DIRECTORY</parameter></term>
180         <listitem>
181           <para>
182             Defaults to <filename>/usr/local/var/lib/ctdb/persistent</filename>.
183           </para>
184           <para>
185             Corresponds to <option>--dbdir-persistent</option>.
186           </para>
187         </listitem>
188       </varlistentry>
189
190       <varlistentry>
191         <term>CTDB_DBDIR_STATE=<parameter>DIRECTORY</parameter></term>
192         <listitem>
193           <para>
194             Defaults to <filename>/usr/local/var/lib/ctdb/state</filename>.
195           </para>
196           <para>
197             Corresponds to <option>--dbdir-state</option>.
198           </para>
199         </listitem>
200       </varlistentry>
201
202       <varlistentry>
203         <term>CTDB_DEBUGLEVEL=<parameter>DEBUGLEVEL</parameter></term>
204         <listitem>
205           <para>
206             Default is NOTICE.  Corresponds to <option>-d</option> or
207             <option>--debug</option>.
208           </para>
209         </listitem>
210       </varlistentry>
211
212       <varlistentry>
213         <term>CTDB_EVENT_SCRIPT_DIR=<parameter>DIRECTORY</parameter></term>
214         <listitem>
215           <para>
216             Default is <varname>CTDB_BASE</varname>/events.d, so usually
217             <filename>/usr/local/etc/ctdb/events.d</filename>.  Corresponds to
218             <option>--event-script-dir</option>.
219           </para>
220         </listitem>
221       </varlistentry>
222
223       <varlistentry>
224         <term>CTDB_LOGGING=<parameter>STRING</parameter></term>
225         <listitem>
226           <para>
227             STRING specifies where ctdbd will write its log. The
228             default is
229             file:<filename>/usr/local/var/log/log.ctdb</filename>.
230             Corresponds to <option>--logging</option>.
231           </para>
232           <para>
233             Valid values are:
234           </para>
235           <variablelist>
236             <varlistentry>
237               <term>file:<parameter>FILENAME</parameter></term>
238               <listitem>
239                 <para>
240                   FILENAME where ctdbd will write its log. This is usually
241                   <filename>/usr/local/var/log/log.ctdb</filename>.
242                 </para>
243               </listitem>
244             </varlistentry>
245             <varlistentry>
246               <term>syslog<optional>:<parameter>METHOD</parameter></optional></term>
247               <listitem>
248                 <para>
249                   CTDB will log to syslog.  By default this will use
250                   the syslog(3) API.
251                 </para>
252                 <para>
253                   If METHOD is specified then it specifies an
254                   extension that causes logging to be done in a
255                   non-blocking fashion.  This can be useful under
256                   heavy loads that might cause the syslog daemon to
257                   dequeue messages too slowly, which would otherwise
258                   cause CTDB to block when logging.  METHOD must be
259                   one of:
260                 </para>
261                 <variablelist>
262                   <varlistentry>
263                     <term>nonblocking</term>
264                     <listitem>
265                       <para>
266                         CTDB will log to syslog via
267                         <filename>/dev/log</filename> in non-blocking
268                         mode.
269                       </para>
270                     </listitem>
271                   </varlistentry>
272                   <varlistentry>
273                     <term>udp</term>
274                     <listitem>
275                       <para>
276                         CTDB will log to syslog via UDP to
277                         localhost:514.  The syslog daemon must be
278                         configured to listen on (at least)
279                         localhost:514.  Most implementations will log
280                         the messages against hostname "localhost" -
281                         this is a limit of the implementation for
282                         compatibility with more syslog daemon
283                         implementations.
284                       </para>
285                     </listitem>
286                   </varlistentry>
287                   <varlistentry>
288                     <term>udp-rfc5424</term>
289                     <listitem>
290                       <para>
291                         As with "udp" but messages are sent in RFC5424
292                         format.  This method will log the correct
293                         hostname but is not as widely implemented in
294                         syslog daemons.
295                       </para>
296                     </listitem>
297                   </varlistentry>
298                 </variablelist>
299               </listitem>
300             </varlistentry>
301           </variablelist>
302         </listitem>
303       </varlistentry>
304
305       <varlistentry>
306         <term>CTDB_NODES=<parameter>FILENAME</parameter></term>
307         <listitem>
308           <para>
309             Default is <varname>CTDB_BASE</varname>/nodes, so usually
310             <filename>/usr/local/etc/ctdb/nodes</filename>.  Corresponds to
311             <option>--nlist</option>.
312           </para>
313         </listitem>
314       </varlistentry>
315
316       <varlistentry>
317         <term>CTDB_NOSETSCHED=yes|no</term>
318         <listitem>
319           <para>
320             Defaults to no.  Corresponds to <option>--nosetsched</option>.
321           </para>
322           <para>
323             Usually CTDB runs with real-time priority.  If you are running
324             CTDB on a platform that does not support real-time priority,
325             you can set this.
326           </para>
327         </listitem>
328       </varlistentry>
329
330       <varlistentry>
331         <term>CTDB_NOTIFY_SCRIPT=<parameter>FILENAME</parameter></term>
332         <listitem>
333           <para>
334             No default, usually
335             <filename>/usr/local/etc/ctdb/notify.sh</filename>.  Corresponds to
336             <option>--notification-script</option>.
337           </para>
338         </listitem>
339       </varlistentry>
340
341       <varlistentry>
342         <term>CTDB_MAX_PERSISTENT_CHECK_ERRORS=<parameter>NUM</parameter></term>
343         <listitem>
344           <para>
345             Default 0.  Corresponds to
346             <option>--max-persistent-check-errors</option>.
347           </para>
348         </listitem>
349       </varlistentry>
350
351       <varlistentry>
352         <term>CTDB_NODE_ADDRESS=<parameter>IPADDR</parameter></term>
353         <listitem>
354           <para>
355             IPADDR is the private IP address that ctdbd will bind to.
356             Corresponds to <option>--listen</option>.
357           </para>
358           <para>
359             By default ctdbd will select the first address from the
360             nodes list that in can bind to.  See also
361             <citetitle>CTDB_NODES</citetitle>.
362           </para>
363           <para>
364             This option is only required when automatic address
365             detection can not be used.  This can be the case when
366             running multiple ctdbd daemons/nodes on the same physical
367             host (usually for testing), using InfiniBand for the
368             private network or on Linux when sysctl
369             net.ipv4.ip_nonlocal_bind=1.
370           </para>
371         </listitem>
372       </varlistentry>
373
374       <varlistentry>
375         <term>CTDB_PUBLIC_ADDRESSES=<parameter>FILENAME</parameter></term>
376         <listitem>
377           <para>
378             No default, usually
379             <filename>/usr/local/etc/ctdb/public_addresses</filename>.
380             Corresponds to <option>--public-addresses</option>.
381           </para>
382         </listitem>
383       </varlistentry>
384
385       <varlistentry>
386         <term>CTDB_PUBLIC_INTERFACE=<parameter>INTERFACE</parameter></term>
387         <listitem>
388           <para>
389             No default.  Corresponds to
390             <option>--public-interface</option>.
391           </para>
392         </listitem>
393       </varlistentry>
394
395       <varlistentry>
396         <term>CTDB_RECOVERY_LOCK=<parameter>LOCK</parameter></term>
397         <listitem>
398           <para>
399             LOCK specifies the cluster-wide mutex used to detect and
400             prevent a partitioned cluster (or "split brain").
401           </para>
402           <para>
403             No default, but the default configuration file specifies
404             <filename>/some/place/on/shared/storage</filename>, which
405             should be change to a useful value.  Corresponds to
406             <option>--reclock</option>.
407           </para>
408           <para>
409             For information about the recovery lock please see the
410             <citetitle>RECOVERY LOCK</citetitle> section in
411             <citerefentry><refentrytitle>ctdb</refentrytitle>
412             <manvolnum>7</manvolnum></citerefentry>.
413           </para>
414         </listitem>
415       </varlistentry>
416
417       <varlistentry>
418         <term>CTDB_SCRIPT_LOG_LEVEL=<parameter>DEBUGLEVEL</parameter></term>
419         <listitem>
420           <para>
421             Defaults to ERR.  Corresponds to
422             <option>--script-log-level</option>.
423           </para>
424         </listitem>
425       </varlistentry>
426
427       <varlistentry>
428         <term>CTDB_SOCKET=<parameter>FILENAME</parameter></term>
429         <listitem>
430           <para>
431             Defaults to <filename>/usr/local/var/run/ctdb/ctdbd.socket</filename>.
432             Corresponds to <option>--socket</option>.
433           </para>
434           <para>
435             If you change this then you probably want to set this in
436             root's environment (perhaps in a file in
437             <filename>/etc/profile.d</filename>) so that you can use
438             the <citerefentry><refentrytitle>ctdb</refentrytitle>
439             <manvolnum>1</manvolnum></citerefentry> command in a
440             straightforward manner.
441           </para>
442         </listitem>
443       </varlistentry>
444
445       <varlistentry>
446         <term>CTDB_START_AS_DISABLED=yes|no</term>
447         <listitem>
448           <para>
449             Default is no.  Corresponds to
450             <option>--start-as-disabled</option>.
451           </para>
452         </listitem>
453       </varlistentry>
454
455       <varlistentry>
456         <term>CTDB_START_AS_STOPPED=yes|no</term>
457         <listitem>
458           <para>
459             Default is no.  Corresponds to
460             <option>--start-as-stopped</option>.
461           </para>
462         </listitem>
463       </varlistentry>
464
465       <varlistentry>
466         <term>CTDB_TRANSPORT=tcp|infiniband</term>
467         <listitem>
468           <para>
469             Defaults to tcp.  Corresponds to
470             <option>--transport</option>.
471           </para>
472         </listitem>
473       </varlistentry>
474
475     </variablelist>
476
477     <para>
478       While the following variables do not translate into daemon
479       options they are used by
480       <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
481       <manvolnum>1</manvolnum></citerefentry> when starting and
482       stopping <citerefentry><refentrytitle>ctdbd</refentrytitle>
483       <manvolnum>1</manvolnum></citerefentry>.
484     </para>
485
486     <variablelist>
487
488       <varlistentry>
489         <term>CTDB_SHUTDOWN_TIMEOUT=<parameter>NUM</parameter></term>
490         <listitem>
491           <para>
492             NUM is the number of seconds to wait for
493             <citerefentry><refentrytitle>ctdbd</refentrytitle>
494             <manvolnum>1</manvolnum></citerefentry> to shut down
495             gracefully before giving up and killing it.
496           </para>
497
498           <para>
499             Defaults is 30.
500           </para>
501         </listitem>
502       </varlistentry>
503
504       <varlistentry>
505         <term>CTDB_STARTUP_TIMEOUT=<parameter>NUM</parameter></term>
506         <listitem>
507           <para>
508             NUM is the number of seconds to wait for
509             <citerefentry><refentrytitle>ctdbd</refentrytitle>
510             <manvolnum>1</manvolnum></citerefentry> complete early
511             initialisation up to a point where it is unlikely to
512             abort.  If <command>ctdbd</command> doesn't complete the
513             "setup" event before this timeout then it is killed.
514           </para>
515
516           <para>
517             Defaults is 10.
518           </para>
519         </listitem>
520       </varlistentry>
521
522     </variablelist>
523   </refsect1>
524
525   <refsect1>
526     <title>NETWORK CONFIGURATION</title>
527
528     <refsect2>
529       <title>NAT GATEWAY</title>
530
531       <para>
532         NAT gateway is used to configure fallback routing for nodes
533         when they do not host any public IP addresses.  For example,
534         it allows unhealthy nodes to reliably communicate with
535         external infrastructure.  One node in a NAT gateway group will
536         be designated as the NAT gateway master node and other (slave)
537         nodes will be configured with fallback routes via the NAT
538         gateway master node.  For more information, see the
539         <citetitle>NAT GATEWAY</citetitle> section in
540         <citerefentry><refentrytitle>ctdb</refentrytitle>
541         <manvolnum>7</manvolnum></citerefentry>.
542       </para>
543
544       <variablelist>
545
546         <varlistentry>
547           <term>CTDB_NATGW_DEFAULT_GATEWAY=<parameter>IPADDR</parameter></term>
548           <listitem>
549             <para>
550               IPADDR is an alternate network gateway to use on the NAT
551               gateway master node.  If set, a fallback default route
552               is added via this network gateway.
553             </para>
554             <para>
555               No default.  Setting this variable is optional - if not
556               set that no route is created on the NAT gateway master
557               node.
558             </para>
559           </listitem>
560         </varlistentry>
561
562         <varlistentry>
563           <term>CTDB_NATGW_NODES=<parameter>FILENAME</parameter></term>
564           <listitem>
565             <para>
566               FILENAME contains the list of nodes that belong to the
567               same NAT gateway group.
568             </para>
569             <para>
570               File format:
571               <screen>
572 <parameter>IPADDR</parameter> <optional>slave-only</optional>
573               </screen>
574             </para>
575             <para>
576               IPADDR is the private IP address of each node in the NAT
577               gateway group.
578             </para>
579             <para>
580               If "slave-only" is specified then the corresponding node
581               can not be the NAT gateway master node.  In this case
582               <varname>CTDB_NATGW_PUBLIC_IFACE</varname> and
583               <varname>CTDB_NATGW_PUBLIC_IP</varname> are optional and
584               unused.
585             </para>
586             <para>
587               No default, usually
588               <filename>/usr/local/etc/ctdb/natgw_nodes</filename> when enabled.
589             </para>
590           </listitem>
591         </varlistentry>
592
593         <varlistentry>
594           <term>CTDB_NATGW_PRIVATE_NETWORK=<parameter>IPADDR/MASK</parameter></term>
595           <listitem>
596             <para>
597               IPADDR/MASK is the private sub-network that is
598               internally routed via the NAT gateway master node.  This
599               is usually the private network that is used for node
600               addresses.
601             </para>
602             <para>
603               No default.
604             </para>
605           </listitem>
606         </varlistentry>
607
608         <varlistentry>
609           <term>CTDB_NATGW_PUBLIC_IFACE=<parameter>IFACE</parameter></term>
610           <listitem>
611             <para>
612               IFACE is the network interface on which the
613               CTDB_NATGW_PUBLIC_IP will be configured.
614             </para>
615             <para>
616               No default.
617             </para>
618           </listitem>
619         </varlistentry>
620
621         <varlistentry>
622           <term>CTDB_NATGW_PUBLIC_IP=<parameter>IPADDR/MASK</parameter></term>
623           <listitem>
624             <para>
625               IPADDR/MASK indicates the IP address that is used for
626               outgoing traffic (originating from
627               CTDB_NATGW_PRIVATE_NETWORK) on the NAT gateway master
628               node.  This <emphasis>must not</emphasis> be a
629               configured public IP address.
630             </para>
631             <para>
632               No default.
633             </para>
634           </listitem>
635         </varlistentry>
636
637         <varlistentry>
638           <term>CTDB_NATGW_STATIC_ROUTES=<parameter>IPADDR/MASK[@GATEWAY]</parameter> ...</term>
639           <listitem>
640             <para>
641               Each IPADDR/MASK identifies a network or host to which
642               NATGW should create a fallback route, instead of
643               creating a single default route.  This can be used when
644               there is already a default route, via an interface that
645               can not reach required infrastructure, that overrides
646               the NAT gateway default route.
647             </para>
648             <para>
649               If GATEWAY is specified then the corresponding route on
650               the NATGW master node will be via GATEWAY.  Such routes
651               are created even if
652               <varname>CTDB_NATGW_DEFAULT_GATEWAY</varname> is not
653               specified.  If GATEWAY is not specified for some
654               networks then routes are only created on the NATGW
655               master node for those networks if
656               <varname>CTDB_NATGW_DEFAULT_GATEWAY</varname> is
657               specified.
658             </para>
659             <para>
660               This should be used with care to avoid causing traffic
661               to unnecessarily double-hop through the NAT gateway
662               master, even when a node is hosting public IP addresses.
663               Each specified network or host should probably have a
664               corresponding automatically created link route or static
665               route to avoid this.
666             </para>
667             <para>
668               No default.
669             </para>
670           </listitem>
671         </varlistentry>
672
673       </variablelist>
674
675       <refsect3>
676         <title>Example</title>
677         <screen>
678 CTDB_NATGW_NODES=/usr/local/etc/ctdb/natgw_nodes
679 CTDB_NATGW_PRIVATE_NETWORK=192.168.1.0/24
680 CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1
681 CTDB_NATGW_PUBLIC_IP=10.0.0.227/24
682 CTDB_NATGW_PUBLIC_IFACE=eth0
683         </screen>
684
685         <para>
686           A variation that ensures that infrastructure (ADS, DNS, ...)
687           directly attached to the public network (10.0.0.0/24) is
688           always reachable would look like this:
689         </para>
690         <screen>
691 CTDB_NATGW_NODES=/usr/local/etc/ctdb/natgw_nodes
692 CTDB_NATGW_PRIVATE_NETWORK=192.168.1.0/24
693 CTDB_NATGW_PUBLIC_IP=10.0.0.227/24
694 CTDB_NATGW_PUBLIC_IFACE=eth0
695 CTDB_NATGW_STATIC_ROUTES=10.0.0.0/24
696         </screen>
697         <para>
698           Note that <varname>CTDB_NATGW_DEFAULT_GATEWAY</varname> is
699           not specified.
700         </para>
701       </refsect3>
702
703     </refsect2>
704
705     <refsect2>
706       <title>POLICY ROUTING</title>
707
708       <para>
709         A node running CTDB may be a component of a complex network
710         topology.  In particular, public addresses may be spread
711         across several different networks (or VLANs) and it may not be
712         possible to route packets from these public addresses via the
713         system's default route.  Therefore, CTDB has support for
714         policy routing via the <filename>13.per_ip_routing</filename>
715         eventscript.  This allows routing to be specified for packets
716         sourced from each public address.  The routes are added and
717         removed as CTDB moves public addresses between nodes.
718       </para>
719
720       <para>
721         For more information, see the <citetitle>POLICY
722         ROUTING</citetitle> section in
723         <citerefentry><refentrytitle>ctdb</refentrytitle>
724         <manvolnum>7</manvolnum></citerefentry>.
725       </para>
726
727       <variablelist>
728         <varlistentry>
729           <term>CTDB_PER_IP_ROUTING_CONF=<parameter>FILENAME</parameter></term>
730           <listitem>
731             <para>
732               FILENAME contains elements for constructing the desired
733               routes for each source address.
734             </para>
735
736             <para>
737               The special FILENAME value
738               <constant>__auto_link_local__</constant> indicates that no
739               configuration file is provided and that CTDB should
740               generate reasonable link-local routes for each public IP
741               address.
742             </para>
743
744             <para>
745               File format:
746               <screen>
747 <parameter>IPADDR</parameter> <parameter>DEST-IPADDR/MASK</parameter> <optional><parameter>GATEWAY-IPADDR</parameter></optional>
748               </screen>
749             </para>
750
751             <para>
752               No default, usually
753               <filename>/usr/local/etc/ctdb/policy_routing</filename> when enabled.
754             </para>
755           </listitem>
756         </varlistentry>
757
758         <varlistentry>
759           <term>CTDB_PER_IP_ROUTING_RULE_PREF=<parameter>NUM</parameter></term>
760         <listitem>
761           <para>
762             NUM sets the priority (or preference) for the routing
763             rules that are added by CTDB.
764           </para>
765
766           <para>
767             This should be (strictly) greater than 0 and (strictly)
768             less than 32766.  A priority of 100 is recommended, unless
769             this conflicts with a priority already in use on the
770             system.  See
771             <citerefentry><refentrytitle>ip</refentrytitle>
772             <manvolnum>8</manvolnum></citerefentry>, for more details.
773           </para>
774         </listitem>
775         </varlistentry>
776
777         <varlistentry>
778           <term>
779             CTDB_PER_IP_ROUTING_TABLE_ID_LOW=<parameter>LOW-NUM</parameter>,
780             CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=<parameter>HIGH-NUM</parameter>
781           </term>
782           <listitem>
783             <para>
784               CTDB determines a unique routing table number to use for
785               the routing related to each public address.  LOW-NUM and
786               HIGH-NUM indicate the minimum and maximum routing table
787               numbers that are used.
788             </para>
789
790             <para>
791               <citerefentry><refentrytitle>ip</refentrytitle>
792               <manvolnum>8</manvolnum></citerefentry> uses some
793               reserved routing table numbers below 255.  Therefore,
794               CTDB_PER_IP_ROUTING_TABLE_ID_LOW should be (strictly)
795               greater than 255.
796             </para>
797
798             <para>
799               CTDB uses the standard file
800               <filename>/etc/iproute2/rt_tables</filename> to maintain
801               a mapping between the routing table numbers and labels.
802               The label for a public address
803               <replaceable>ADDR</replaceable> will look like
804               ctdb.<replaceable>addr</replaceable>.  This means that
805               the associated rules and routes are easy to read (and
806               manipulate).
807             </para>
808
809             <para>
810               No default, usually 1000 and 9000.
811             </para>
812           </listitem>
813         </varlistentry>
814       </variablelist>
815
816       <refsect3>
817         <title>Example</title>
818         <screen>
819 CTDB_PER_IP_ROUTING_CONF=/usr/local/etc/ctdb/policy_routing
820 CTDB_PER_IP_ROUTING_RULE_PREF=100
821 CTDB_PER_IP_ROUTING_TABLE_ID_LOW=1000
822 CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000
823         </screen>
824       </refsect3>
825
826     </refsect2>
827
828     <refsect2>
829       <title>LVS</title>
830
831       <para>
832         For a general description see the <citetitle>LVS</citetitle>
833         section in <citerefentry><refentrytitle>ctdb</refentrytitle>
834         <manvolnum>7</manvolnum></citerefentry>.
835       </para>
836
837       <refsect3>
838         <title>Eventscript</title>
839
840         <simplelist>
841           <member><filename>91.lvs</filename></member>
842         </simplelist>
843       </refsect3>
844
845       <variablelist>
846
847         <varlistentry>
848           <term>CTDB_LVS_NODES=<parameter>FILENAME</parameter></term>
849           <listitem>
850             <para>
851               FILENAME contains the list of nodes that belong to the
852               same LVS group.
853             </para>
854             <para>
855               File format:
856               <screen>
857 <parameter>IPADDR</parameter> <optional>slave-only</optional>
858               </screen>
859             </para>
860             <para>
861               IPADDR is the private IP address of each node in the LVS
862               group.
863             </para>
864             <para>
865               If "slave-only" is specified then the corresponding node
866               can not be the LVS master node.  In this case
867               <varname>CTDB_LVS_PUBLIC_IFACE</varname> and
868               <varname>CTDB_LVS_PUBLIC_IP</varname> are optional and
869               unused.
870             </para>
871             <para>
872               No default, usually
873               <filename>/usr/local/etc/ctdb/lvs_nodes</filename> when enabled.
874             </para>
875           </listitem>
876         </varlistentry>
877
878         <varlistentry>
879           <term>CTDB_LVS_PUBLIC_IFACE=<parameter>INTERFACE</parameter></term>
880           <listitem>
881             <para>
882               INTERFACE is the network interface that clients will use
883               to connection to <varname>CTDB_LVS_PUBLIC_IP</varname>.
884               This is optional for slave-only nodes.
885               No default.
886             </para>
887           </listitem>
888         </varlistentry>
889
890         <varlistentry>
891           <term>CTDB_LVS_PUBLIC_IP=<parameter>IPADDR</parameter></term>
892           <listitem>
893             <para>
894               CTDB_LVS_PUBLIC_IP is the LVS public address.  No
895               default.
896           </para>
897           </listitem>
898         </varlistentry>
899
900       </variablelist>
901     </refsect2>
902
903     <refsect2>
904       <title>MISCELLANEOUS NETWORK CONFIGURATION</title>
905
906       <variablelist>
907
908         <varlistentry>
909           <term>CTDB_PARTIALLY_ONLINE_INTERFACES=yes|no</term>
910           <listitem>
911             <para>
912               Whether one or more offline interfaces should cause a
913               monitor event to fail if there are other interfaces that
914               are up.  If this is "yes" and a node has some interfaces
915               that are down then <command>ctdb status</command> will
916               display the node as "PARTIALLYONLINE".
917             </para>
918
919             <para>
920               Note that CTDB_PARTIALLY_ONLINE_INTERFACES=yes is
921               incompatible with NAT gateway, since NAT gateway relies
922               on the interface configured by CTDB_NATGW_PUBLIC_IFACE
923               to be up.
924             </para>
925
926             <para>
927               Default is "no".
928             </para>
929           </listitem>
930         </varlistentry>
931
932       </variablelist>
933     </refsect2>
934
935   </refsect1>
936
937   <refsect1>
938     <title>SERVICE CONFIGURATION</title>
939
940     <para>
941       CTDB can be configured to manage and/or monitor various NAS (and
942       other) services via its eventscripts.
943     </para>
944
945     <para>
946       In the simplest case CTDB will manage a service.  This means the
947       service will be started and stopped along with CTDB, CTDB will
948       monitor the service and CTDB will do any required
949       reconfiguration of the service when public IP addresses are
950       failed over.
951     </para>
952
953     <refsect2>
954       <title>SAMBA</title>
955
956       <refsect3>
957         <title>Eventscripts</title>
958
959         <simplelist>
960           <member><filename>49.winbind</filename></member>
961           <member><filename>50.samba</filename></member>
962         </simplelist>
963       </refsect3>
964
965       <variablelist>
966
967         <varlistentry>
968           <term>CTDB_MANAGES_SAMBA=yes|no</term>
969           <listitem>
970             <para>
971               Should CTDB manage Samba?
972             </para>
973             <para>
974               Default is no.
975             </para>
976           </listitem>
977         </varlistentry>
978
979         <varlistentry>
980           <term>CTDB_MANAGES_WINBIND=yes|no</term>
981           <listitem>
982             <para>
983               Should CTDB manage Winbind?
984             </para>
985             <para>
986               Default is no.
987             </para>
988           </listitem>
989         </varlistentry>
990
991         <varlistentry>
992           <term>CTDB_SAMBA_CHECK_PORTS=<parameter>PORT-LIST</parameter></term>
993           <listitem>
994             <para>
995               When monitoring Samba, check TCP ports in
996               space-separated PORT-LIST.
997             </para>
998             <para>
999               Default is to monitor ports that Samba is configured to listen on.
1000             </para>
1001           </listitem>
1002         </varlistentry>
1003
1004         <varlistentry>
1005           <term>CTDB_SAMBA_SKIP_SHARE_CHECK=yes|no</term>
1006           <listitem>
1007             <para>
1008               As part of monitoring, should CTDB skip the check for
1009               the existence of each directory configured as share in
1010               Samba.  This may be desirable if there is a large number
1011               of shares.
1012             </para>
1013             <para>
1014               Default is no.
1015             </para>
1016           </listitem>
1017         </varlistentry>
1018
1019         <varlistentry>
1020           <term>CTDB_SERVICE_NMB=<parameter>SERVICE</parameter></term>
1021           <listitem>
1022             <para>
1023               Distribution specific SERVICE for managing nmbd.
1024             </para>
1025             <para>
1026               Default is distribution-dependant.
1027             </para>
1028           </listitem>
1029         </varlistentry>
1030         <varlistentry>
1031           <term>CTDB_SERVICE_SMB=<parameter>SERVICE</parameter></term>
1032           <listitem>
1033             <para>
1034               Distribution specific SERVICE for managing smbd.
1035             </para>
1036             <para>
1037               Default is distribution-dependant.
1038             </para>
1039           </listitem>
1040         </varlistentry>
1041
1042         <varlistentry>
1043           <term>CTDB_SERVICE_WINBIND=<parameter>SERVICE</parameter></term>
1044           <listitem>
1045             <para>
1046               Distribution specific SERVICE for managing winbindd.
1047             </para>
1048             <para>
1049               Default is "winbind".
1050             </para>
1051           </listitem>
1052         </varlistentry>
1053
1054       </variablelist>
1055
1056     </refsect2>
1057
1058     <refsect2>
1059       <title>NFS</title>
1060
1061       <para>
1062         This includes parameters for the kernel NFS server.
1063         Alternative NFS subsystems (such as <ulink
1064         url="https://github.com/nfs-ganesha/nfs-ganesha/wiki">NFS-Ganesha</ulink>)
1065         can be integrated using <varname>CTDB_NFS_CALLOUT</varname>.
1066       </para>
1067
1068       <refsect3>
1069         <title>Eventscript</title>
1070
1071         <simplelist>
1072           <member><filename>60.nfs</filename></member>
1073         </simplelist>
1074       </refsect3>
1075
1076       <variablelist>
1077
1078         <varlistentry>
1079           <term>CTDB_MANAGES_NFS=yes|no</term>
1080           <listitem>
1081             <para>
1082               Should CTDB manage NFS?
1083             </para>
1084             <para>
1085               Default is no.
1086             </para>
1087           </listitem>
1088         </varlistentry>
1089
1090         <varlistentry>
1091           <term>CTDB_NFS_CALLOUT=<parameter>COMMAND</parameter></term>
1092           <listitem>
1093             <para>
1094               COMMAND specifies the path to a callout to handle
1095               interactions with the configured NFS system, including
1096               startup, shutdown, monitoring.
1097             </para>
1098             <para>
1099               Default is the included
1100               <command>nfs-linux-kernel-callout</command>.
1101             </para>
1102           </listitem>
1103         </varlistentry>
1104
1105         <varlistentry>
1106           <term>CTDB_NFS_CHECKS_DIR=<parameter>DIRECTORY</parameter></term>
1107           <listitem>
1108             <para>
1109               Specifies the path to a DIRECTORY containing files that
1110               describe how to monitor the responsiveness of NFS RPC
1111               services.  See the README file for this directory for an
1112               explanation of the contents of these "check" files.
1113             </para>
1114             <para>
1115               CTDB_NFS_CHECKS_DIR can be used to point to different
1116               sets of checks for different NFS servers.
1117             </para>
1118             <para>
1119               One way of using this is to have it point to, say,
1120               <filename>/usr/local/etc/ctdb/nfs-checks-enabled.d</filename>
1121               and populate it with symbolic links to the desired check
1122               files.  This avoids duplication and is upgrade-safe.
1123             </para>
1124             <para>
1125               Default is
1126               <filename>/usr/local/etc/ctdb/nfs-checks.d</filename>,
1127               which contains NFS RPC checks suitable for Linux kernel
1128               NFS.
1129             </para>
1130           </listitem>
1131         </varlistentry>
1132
1133         <varlistentry>
1134           <term>CTDB_NFS_SKIP_SHARE_CHECK=yes|no</term>
1135           <listitem>
1136             <para>
1137               As part of monitoring, should CTDB skip the check for
1138               the existence of each directory exported via NFS.  This
1139               may be desirable if there is a large number of exports.
1140             </para>
1141             <para>
1142               Default is no.
1143             </para>
1144           </listitem>
1145         </varlistentry>
1146
1147         <varlistentry>
1148           <term>CTDB_RPCINFO_LOCALHOST=<parameter>IPADDR</parameter>|<parameter>HOSTNAME</parameter></term>
1149           <listitem>
1150             <para>
1151               IPADDR or HOSTNAME indicates the address that
1152               <command>rpcinfo</command> should connect to when doing
1153               <command>rpcinfo</command> check on IPv4 RPC service during
1154               monitoring.  Optimally this would be "localhost".
1155               However, this can add some performance overheads.
1156             </para>
1157             <para>
1158               Default is "127.0.0.1".
1159             </para>
1160           </listitem>
1161         </varlistentry>
1162
1163         <varlistentry>
1164           <term>CTDB_RPCINFO_LOCALHOST6=<parameter>IPADDR</parameter>|<parameter>HOSTNAME</parameter></term>
1165           <listitem>
1166             <para>
1167               IPADDR or HOSTNAME indicates the address that
1168               <command>rpcinfo</command> should connect to when doing
1169               <command>rpcinfo</command> check on IPv6 RPC service
1170               during monitoring.  Optimally this would be "localhost6"
1171               (or similar).  However, this can add some performance
1172               overheads.
1173             </para>
1174             <para>
1175               Default is "::1".
1176             </para>
1177           </listitem>
1178         </varlistentry>
1179
1180         <varlistentry>
1181           <term>CTDB_NFS_STATE_FS_TYPE=<parameter>TYPE</parameter></term>
1182           <listitem>
1183             <para>
1184               The type of filesystem used for a clustered NFS' shared
1185               state. No default.
1186             </para>
1187           </listitem>
1188         </varlistentry>
1189
1190         <varlistentry>
1191           <term>CTDB_NFS_STATE_MNT=<parameter>DIR</parameter></term>
1192           <listitem>
1193             <para>
1194               The directory where a clustered NFS' shared state will be
1195               located. No default.
1196             </para>
1197           </listitem>
1198         </varlistentry>
1199
1200       </variablelist>
1201
1202     </refsect2>
1203
1204     <refsect2>
1205       <title>APACHE HTTPD</title>
1206
1207       <para>
1208         CTDB can manage the Apache web server.
1209       </para>
1210
1211       <refsect3>
1212         <title>Eventscript</title>
1213
1214         <simplelist>
1215           <member><filename>41.httpd</filename></member>
1216         </simplelist>
1217       </refsect3>
1218
1219       <variablelist>
1220         <varlistentry>
1221           <term>CTDB_MANAGES_HTTPD=yes|no</term>
1222           <listitem>
1223             <para>
1224               Should CTDB manage the Apache web server?
1225             </para>
1226             <para>
1227               Default is no.
1228             </para>
1229           </listitem>
1230         </varlistentry>
1231       </variablelist>
1232     </refsect2>
1233
1234     <refsect2>
1235       <title>CLAMAV</title>
1236
1237       <para>
1238         CTDB has support to manage the popular anti-virus daemon
1239         ClamAV.
1240       </para>
1241
1242       <refsect3>
1243         <title>Eventscript</title>
1244
1245         <simplelist>
1246           <member><filename>31.clamd</filename></member>
1247         </simplelist>
1248
1249         <para>
1250           This eventscript is not enabled by default.  Use
1251           <command>ctdb enablescript</command> to enable it.
1252         </para>
1253
1254       </refsect3>
1255
1256       <variablelist>
1257
1258         <varlistentry>
1259           <term>CTDB_MANAGES_CLAMD=yes|no</term>
1260           <listitem>
1261             <para>
1262               Should CTDB manage ClamAV?
1263             </para>
1264             <para>
1265               Default is no.
1266             </para>
1267           </listitem>
1268         </varlistentry>
1269
1270         <varlistentry>
1271           <term>CTDB_CLAMD_SOCKET=<parameter>FILENAME</parameter></term>
1272           <listitem>
1273             <para>
1274               FILENAME is the socket to monitor ClamAV.
1275             </para>
1276             <para>
1277               No default.
1278             </para>
1279           </listitem>
1280         </varlistentry>
1281
1282       </variablelist>
1283
1284     </refsect2>
1285
1286     <refsect2>
1287       <title>ISCSI</title>
1288
1289       <para>
1290         CTDB has support for managing the Linux iSCSI tgtd service.
1291       </para>
1292
1293       <refsect3>
1294         <title>Eventscript</title>
1295
1296         <simplelist>
1297           <member><filename>70.iscsi</filename></member>
1298         </simplelist>
1299       </refsect3>
1300
1301       <variablelist>
1302
1303         <varlistentry>
1304           <term>CTDB_MANAGES_ISCSI=yes|no</term>
1305           <listitem>
1306             <para>
1307               Should CTDB manage iSCSI tgtd?
1308             </para>
1309             <para>
1310               Default is no.
1311             </para>
1312           </listitem>
1313         </varlistentry>
1314
1315         <varlistentry>
1316           <term>CTDB_START_ISCSI_SCRIPTS=<parameter>DIRECTORY</parameter></term>
1317           <listitem>
1318             <para>
1319               DIRECTORY on shared storage containing scripts to start
1320               tgtd for each public IP address.
1321             </para>
1322             <para>
1323               No default.
1324             </para>
1325           </listitem>
1326         </varlistentry>
1327       </variablelist>
1328     </refsect2>
1329
1330     <refsect2>
1331       <title>MULTIPATHD</title>
1332
1333       <para>
1334         CTDB can monitor multipath devices to ensure that active paths
1335         are available.
1336       </para>
1337
1338       <refsect3>
1339         <title>Eventscript</title>
1340
1341         <simplelist>
1342           <member><filename>20.multipathd</filename></member>
1343         </simplelist>
1344
1345         <para>
1346           This eventscript is not enabled by default.  Use
1347           <command>ctdb enablescript</command> to enable it.
1348         </para>
1349       </refsect3>
1350
1351       <variablelist>
1352         <varlistentry>
1353           <term>CTDB_MONITOR_MPDEVICES=<parameter>MP-DEVICE-LIST</parameter></term>
1354           <listitem>
1355             <para>
1356               MP-DEVICE-LIST is a list of multipath devices for CTDB to monitor?
1357             </para>
1358             <para>
1359               No default.
1360             </para>
1361           </listitem>
1362         </varlistentry>
1363       </variablelist>
1364     </refsect2>
1365
1366     <refsect2>
1367       <title>VSFTPD</title>
1368
1369       <para>
1370         CTDB can manage the vsftpd FTP server.
1371       </para>
1372
1373       <refsect3>
1374         <title>Eventscript</title>
1375
1376         <simplelist>
1377           <member><filename>40.vsftpd</filename></member>
1378         </simplelist>
1379       </refsect3>
1380
1381       <variablelist>
1382         <varlistentry>
1383           <term>CTDB_MANAGES_VSFTPD=yes|no</term>
1384           <listitem>
1385             <para>
1386               Should CTDB manage the vsftpd FTP server?
1387             </para>
1388             <para>
1389               Default is no.
1390             </para>
1391           </listitem>
1392         </varlistentry>
1393       </variablelist>
1394     </refsect2>
1395
1396     <refsect2>
1397       <title>
1398         SYSTEM RESOURCE MONITORING CONFIGURATION
1399       </title>
1400
1401       <para>
1402         CTDB can experience seemingly random (performance and other)
1403         issues if system resources become too constrained.  Options in
1404         this section can be enabled to allow certain system resources
1405         to be checked.  They allows warnings to be logged and nodes to
1406         be marked unhealthy when system resource usage reaches the
1407         configured thresholds.
1408       </para>
1409
1410       <para>
1411         Some checks are enabled by default.  It is recommended that
1412         these checks remain enabled or are augmented by extra checks.
1413         There is no supported way of completely disabling the checks.
1414       </para>
1415
1416       <refsect3>
1417         <title>Eventscripts</title>
1418
1419         <simplelist>
1420           <member><filename>05.system</filename></member>
1421         </simplelist>
1422
1423         <para>
1424           Filesystem and memory usage monitoring is in
1425           <filename>05.system</filename>.
1426         </para>
1427       </refsect3>
1428
1429       <variablelist>
1430
1431         <varlistentry>
1432           <term>CTDB_MONITOR_FILESYSTEM_USAGE=<parameter>FS-LIMIT-LIST</parameter></term>
1433           <listitem>
1434             <para>
1435               FS-LIMIT-LIST is a space-separated list of
1436               <parameter>FILESYSTEM</parameter>:<parameter>WARN_LIMIT</parameter><optional>:<parameter>UNHEALTHY_LIMIT</parameter></optional>
1437               triples indicating that warnings should be logged if the
1438               space used on FILESYSTEM reaches WARN_LIMIT%.  If usage
1439               reaches UNHEALTHY_LIMIT then the node should be flagged
1440               unhealthy.  Either WARN_LIMIT or UNHEALTHY_LIMIT may be
1441               left blank, meaning that check will be omitted.
1442             </para>
1443
1444             <para>
1445               Default is to warn for each filesystem containing a
1446               database directory (<envar>CTDB_DBDIR</envar>,
1447               <envar>CTDB_DBDIR_PERSISTENT</envar>,
1448               <envar>CTDB_DBDIR_STATE</envar>) with a threshold of
1449               90%.
1450             </para>
1451           </listitem>
1452         </varlistentry>
1453
1454         <varlistentry>
1455           <term>CTDB_MONITOR_MEMORY_USAGE=<parameter>MEM-LIMITS</parameter></term>
1456           <listitem>
1457             <para>
1458               MEM-LIMITS takes the form
1459               <parameter>WARN_LIMIT</parameter><optional>:<parameter>UNHEALTHY_LIMIT</parameter></optional>
1460               indicating that warnings should be logged if memory
1461               usage reaches WARN_LIMIT%.  If usage reaches
1462               UNHEALTHY_LIMIT then the node should be flagged
1463               unhealthy.  Either WARN_LIMIT or UNHEALTHY_LIMIT may be
1464               left blank, meaning that check will be omitted.
1465             </para>
1466             <para>
1467               Default is 80, so warnings will be logged when memory
1468               usage reaches 80%.
1469             </para>
1470           </listitem>
1471         </varlistentry>
1472
1473         <varlistentry>
1474           <term>CTDB_MONITOR_SWAP_USAGE=<parameter>SWAP-LIMITS</parameter></term>
1475           <listitem>
1476             <para>
1477               SWAP-LIMITS takes the form
1478               <parameter>WARN_LIMIT</parameter><optional>:<parameter>UNHEALTHY_LIMIT</parameter></optional>
1479                indicating that warnings should be logged if
1480               swap usage reaches WARN_LIMIT%.  If usage reaches
1481               UNHEALTHY_LIMIT then the node should be flagged
1482               unhealthy.  Either WARN_LIMIT or UNHEALTHY_LIMIT may be
1483               left blank, meaning that check will be omitted.
1484             </para>
1485             <para>
1486               Default is 25, so warnings will be logged when swap
1487               usage reaches 25%.
1488             </para>
1489           </listitem>
1490         </varlistentry>
1491
1492       </variablelist>
1493     </refsect2>
1494
1495     <refsect2>
1496       <title>MISCELLANEOUS SERVICE-RELATED CONFIGURATION</title>
1497
1498       <variablelist>
1499
1500         <varlistentry>
1501           <term>CTDB_MANAGED_SERVICES=<parameter>SERVICE-LIST</parameter></term>
1502           <listitem>
1503             <para>
1504               SERVICE-LIST is a space-separated list of SERVICEs that
1505               CTDB should manage.  This can be used as an alternative
1506               to the
1507               <varname>CTDB_MANAGES_<replaceable>SERVICE</replaceable></varname>
1508               variables.
1509             </para>
1510             <para>
1511               No default.
1512             </para>
1513           </listitem>
1514         </varlistentry>
1515
1516       </variablelist>
1517
1518     </refsect2>
1519
1520   </refsect1>
1521
1522   <refsect1>
1523     <title>
1524       TUNABLES CONFIGURATION
1525     </title>
1526
1527     <para>
1528       CTDB tunables (see
1529       <citerefentry><refentrytitle>ctdbd-tunables</refentrytitle>
1530       <manvolnum>7</manvolnum></citerefentry>) can be set from the
1531       configuration file.  They are set as follows:
1532
1533       <literallayout>
1534 CTDB_SET_<replaceable>TUNABLE</replaceable>=<replaceable>VALUE</replaceable>
1535       </literallayout>
1536     </para>
1537
1538     <para>
1539       For example:
1540
1541       <screen format="linespecific">
1542 CTDB_SET_MonitorInterval=20
1543       </screen>
1544     </para>
1545   </refsect1>
1546
1547   <refsect1>
1548     <title>
1549       DEBUG AND TEST
1550     </title>
1551
1552     <para>
1553       Variable in this section are for debugging and testing CTDB.
1554       They should not generally be needed.
1555     </para>
1556
1557     <variablelist>
1558
1559       <varlistentry>
1560         <term>CTDB_DEBUG_HUNG_SCRIPT=<parameter>FILENAME</parameter></term>
1561         <listitem>
1562           <para>
1563             FILENAME is a script to run to log debug information when
1564             an event script times out.
1565           </para>
1566           <para>
1567             Default is <filename><varname>CTDB_BASE</varname>/debug-hung-script.sh</filename>.
1568           </para>
1569         </listitem>
1570       </varlistentry>
1571
1572       <varlistentry>
1573         <term>CTDB_DEBUG_HUNG_SCRIPT_LOGFILE=<parameter>FILENAME</parameter></term>
1574         <listitem>
1575           <para>
1576             FILENAME specifies where log messages should go when
1577             debugging hung eventscripts.  This is a testing option.
1578             See also <citetitle>CTDB_DEBUG_HUNG_SCRIPT</citetitle>.
1579           </para>
1580           <para>
1581             No default.  Messages go to stdout/stderr and are logged
1582             to the same place as other CTDB log messages.
1583           </para>
1584         </listitem>
1585       </varlistentry>
1586
1587       <varlistentry>
1588         <term>CTDB_DEBUG_HUNG_SCRIPT_STACKPAT=<parameter>REGEXP</parameter></term>
1589         <listitem>
1590           <para>
1591             REGEXP specifies interesting processes for which stack
1592             traces should be logged when debugging hung eventscripts
1593             and those processes are matched in pstree output.  REGEXP
1594             is an extended regexp so choices are separated by pipes
1595             ('|').  However, REGEXP should not contain parentheses.
1596             See also <citetitle>CTDB_DEBUG_HUNG_SCRIPT</citetitle>.
1597           </para>
1598           <para>
1599             Default is "exportfs|rpcinfo".
1600           </para>
1601         </listitem>
1602       </varlistentry>
1603
1604       <varlistentry>
1605         <term>CTDB_DEBUG_LOCKS=<parameter>FILENAME</parameter></term>
1606         <listitem>
1607           <para>
1608             FILENAME is a script to run to log debug information when
1609             an CTDB fails to freeze databases during recovery.
1610           </para>
1611           <para>
1612             No default, usually
1613             <filename><varname>CTDB_BASE</varname>/debug_locks.sh</filename>.
1614           </para>
1615         </listitem>
1616       </varlistentry>
1617
1618       <varlistentry>
1619         <term>CTDB_SYS_ETCDIR=<parameter>DIRECTORY</parameter></term>
1620         <listitem>
1621           <para>
1622             DIRECTORY containing system configuration files.  This is
1623             used to provide alternate configuration when testing and
1624             should not need to be changed from the default.
1625           </para>
1626           <para>
1627             Default is <filename>/etc</filename>.
1628           </para>
1629         </listitem>
1630       </varlistentry>
1631
1632       <varlistentry>
1633         <term>CTDB_INIT_STYLE=debian|redhat|suse</term>
1634         <listitem>
1635           <para>
1636             This is the init style used by the Linux distribution (or
1637             other operating system) being used.  This is usually
1638             determined dynamically by checking the system.  This
1639             variable is used by the initscript to determine which init
1640             system primitives to use.  It is also used by some
1641             eventscripts to choose the name of initscripts for certain
1642             services, since these can vary between distributions.
1643           </para>
1644           <para>
1645             No fixed default.
1646           </para>
1647           <para>
1648             If this option needs to be changed from the calculated
1649             default for the initscript to function properly, then it
1650             must be set in the distribution-specific initscript
1651             configuration, such as
1652             <filename>/etc/sysconfig/ctdb</filename>
1653           </para>
1654         </listitem>
1655       </varlistentry>
1656
1657       <varlistentry>
1658         <term>CTDB_MAX_CORRUPT_DB_BACKUPS=<parameter>NUM</parameter></term>
1659         <listitem>
1660           <para>
1661             NUM is the maximum number of volatile TDB database backups
1662             to be kept (for each database) when a corrupt database is
1663             found during startup.  Volatile TDBs are zeroed during
1664             startup so backups are needed to debug any corruption that
1665             occurs before a restart.
1666           </para>
1667           <para>
1668             Default is 10.
1669           </para>
1670         </listitem>
1671       </varlistentry>
1672
1673       <varlistentry>
1674         <term>CTDB_MAX_OPEN_FILES=<parameter>NUM</parameter></term>
1675         <listitem>
1676           <para>
1677             NUM is the maximum number of open files.
1678           </para>
1679           <para>
1680             There is no default.
1681           </para>
1682         </listitem>
1683       </varlistentry>
1684
1685       <varlistentry>
1686         <term>CTDB_RC_LOCAL=<parameter>FILENAME</parameter></term>
1687         <listitem>
1688           <para>
1689             FILENAME is a script fragment to be sourced by the
1690             <filename>functions</filename> that is sourced by scripts.
1691             On example use would be to override function definitions
1692             in unit tests.  As a sanity check, this file must be
1693             executable for it to be used.
1694           </para>
1695           <para>
1696             No default.
1697           </para>
1698         </listitem>
1699       </varlistentry>
1700
1701       <varlistentry>
1702         <term>CTDB_RUN_TIMEOUT_MONITOR=yes|no</term>
1703         <listitem>
1704           <para>
1705             Whether CTDB should simulate timing out monitor events.
1706             This uses the <filename>99.timeout</filename> eventscript.
1707           </para>
1708           <para>
1709             Default is no.
1710           </para>
1711         </listitem>
1712       </varlistentry>
1713
1714       <varlistentry>
1715         <term>CTDB_SUPPRESS_COREFILE=yes|no</term>
1716         <listitem>
1717           <para>
1718             Whether CTDB core files should be suppressed.
1719           </para>
1720           <para>
1721             Default is no.
1722           </para>
1723         </listitem>
1724       </varlistentry>
1725
1726       <varlistentry>
1727         <term>CTDB_VALGRIND=yes|no|<parameter>COMMAND</parameter></term>
1728         <listitem>
1729           <para>
1730             If "yes", this causes
1731             <citerefentry><refentrytitle>ctdbd</refentrytitle>
1732             <manvolnum>1</manvolnum></citerefentry> to be run under
1733             <citerefentry><refentrytitle>valgrind</refentrytitle>
1734             <manvolnum>1</manvolnum></citerefentry> with logs going to
1735             <filename>/usr/local/var/log/ctdb_valgrind</filename>.  If neither
1736             "yes" nor "no" then the value is assumed to be a COMMAND
1737             (e.g. a <command>valgrind</command> variation, a
1738             <citerefentry><refentrytitle>gdb</refentrytitle>
1739             <manvolnum>1</manvolnum></citerefentry> command) that is
1740             used in place of the default <command>valgrind</command>
1741             command.  In either case, the <option>--valgrind</option>
1742             option is passed to <command>ctdbd</command>.
1743           </para>
1744           <para>
1745             Default is no.
1746           </para>
1747         </listitem>
1748       </varlistentry>
1749
1750       <varlistentry>
1751         <term>CTDB_VARDIR=<parameter>DIRECTORY</parameter></term>
1752         <listitem>
1753           <para>
1754             DIRECTORY containing CTDB files that are modified at
1755             runtime.
1756           </para>
1757           <para>
1758             Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
1759           </para>
1760         </listitem>
1761       </varlistentry>
1762
1763     </variablelist>
1764
1765   </refsect1>
1766
1767
1768   <refsect1>
1769     <title>FILES</title>
1770
1771     <simplelist>
1772       <member><filename>/usr/local/etc/ctdb/ctdbd.conf</filename></member>
1773       <member><filename>/etc/sysconfig/ctdb</filename></member>
1774       <member><filename>/etc/default/ctdb</filename></member>
1775       <member><filename>/usr/local/etc/ctdb/sysconfig/ctdb</filename></member>
1776     </simplelist>
1777   </refsect1>
1778
1779   <refsect1>
1780     <title>SEE ALSO</title>
1781     <para>
1782       <citerefentry><refentrytitle>ctdbd</refentrytitle>
1783       <manvolnum>1</manvolnum></citerefentry>,
1784
1785       <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
1786       <manvolnum>1</manvolnum></citerefentry>,
1787
1788       <citerefentry><refentrytitle>onnode</refentrytitle>
1789       <manvolnum>1</manvolnum></citerefentry>,
1790
1791       <citerefentry><refentrytitle>ctdb</refentrytitle>
1792       <manvolnum>7</manvolnum></citerefentry>,
1793
1794       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
1795       <manvolnum>7</manvolnum></citerefentry>,
1796
1797       <ulink url="http://ctdb.samba.org/"/>
1798     </para>
1799   </refsect1>
1800
1801   <refentryinfo>
1802     <author>
1803       <contrib>
1804         This documentation was written by
1805         Amitay Isaacs,
1806         Martin Schwenke
1807       </contrib>
1808     </author>
1809
1810     <copyright>
1811       <year>2007</year>
1812       <holder>Andrew Tridgell</holder>
1813       <holder>Ronnie Sahlberg</holder>
1814     </copyright>
1815     <legalnotice>
1816       <para>
1817         This program is free software; you can redistribute it and/or
1818         modify it under the terms of the GNU General Public License as
1819         published by the Free Software Foundation; either version 3 of
1820         the License, or (at your option) any later version.
1821       </para>
1822       <para>
1823         This program is distributed in the hope that it will be
1824         useful, but WITHOUT ANY WARRANTY; without even the implied
1825         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
1826         PURPOSE.  See the GNU General Public License for more details.
1827       </para>
1828       <para>
1829         You should have received a copy of the GNU General Public
1830         License along with this program; if not, see
1831         <ulink url="http://www.gnu.org/licenses"/>.
1832       </para>
1833     </legalnotice>
1834   </refentryinfo>
1835
1836 </refentry>