ctdb-scripts: Drop configuration variable CTDB_SERVICE_AUTOSTARTSTOP
[samba.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_SKIP_SHARE_CHECK=yes|no</term>
1107           <listitem>
1108             <para>
1109               As part of monitoring, should CTDB skip the check for
1110               the existence of each directory exported via NFS.  This
1111               may be desirable if there is a large number of exports.
1112             </para>
1113             <para>
1114               Default is no.
1115             </para>
1116           </listitem>
1117         </varlistentry>
1118
1119         <varlistentry>
1120           <term>CTDB_RPCINFO_LOCALHOST=<parameter>IPADDR</parameter>|<parameter>HOSTNAME</parameter></term>
1121           <listitem>
1122             <para>
1123               IPADDR or HOSTNAME indicates the address that
1124               <command>rpcinfo</command> should connect to when doing
1125               <command>rpcinfo</command> check on IPv4 RPC service during
1126               monitoring.  Optimally this would be "localhost".
1127               However, this can add some performance overheads.
1128             </para>
1129             <para>
1130               Default is "127.0.0.1".
1131             </para>
1132           </listitem>
1133         </varlistentry>
1134
1135         <varlistentry>
1136           <term>CTDB_RPCINFO_LOCALHOST6=<parameter>IPADDR</parameter>|<parameter>HOSTNAME</parameter></term>
1137           <listitem>
1138             <para>
1139               IPADDR or HOSTNAME indicates the address that
1140               <command>rpcinfo</command> should connect to when doing
1141               <command>rpcinfo</command> check on IPv6 RPC service
1142               during monitoring.  Optimally this would be "localhost6"
1143               (or similar).  However, this can add some performance
1144               overheads.
1145             </para>
1146             <para>
1147               Default is "::1".
1148             </para>
1149           </listitem>
1150         </varlistentry>
1151
1152         <varlistentry>
1153           <term>CTDB_NFS_STATE_FS_TYPE=<parameter>TYPE</parameter></term>
1154           <listitem>
1155             <para>
1156               The type of filesystem used for a clustered NFS' shared
1157               state. No default.
1158             </para>
1159           </listitem>
1160         </varlistentry>
1161
1162         <varlistentry>
1163           <term>CTDB_NFS_STATE_MNT=<parameter>DIR</parameter></term>
1164           <listitem>
1165             <para>
1166               The directory where a clustered NFS' shared state will be
1167               located. No default.
1168             </para>
1169           </listitem>
1170         </varlistentry>
1171
1172       </variablelist>
1173
1174     </refsect2>
1175
1176     <refsect2>
1177       <title>APACHE HTTPD</title>
1178
1179       <para>
1180         CTDB can manage the Apache web server.
1181       </para>
1182
1183       <refsect3>
1184         <title>Eventscript</title>
1185
1186         <simplelist>
1187           <member><filename>41.httpd</filename></member>
1188         </simplelist>
1189       </refsect3>
1190
1191       <variablelist>
1192         <varlistentry>
1193           <term>CTDB_MANAGES_HTTPD=yes|no</term>
1194           <listitem>
1195             <para>
1196               Should CTDB manage the Apache web server?
1197             </para>
1198             <para>
1199               Default is no.
1200             </para>
1201           </listitem>
1202         </varlistentry>
1203       </variablelist>
1204     </refsect2>
1205
1206     <refsect2>
1207       <title>CLAMAV</title>
1208
1209       <para>
1210         CTDB has support to manage the popular anti-virus daemon
1211         ClamAV.
1212       </para>
1213
1214       <refsect3>
1215         <title>Eventscript</title>
1216
1217         <simplelist>
1218           <member><filename>31.clamd</filename></member>
1219         </simplelist>
1220
1221         <para>
1222           This eventscript is not enabled by default.  Use
1223           <command>ctdb enablescript</command> to enable it.
1224         </para>
1225
1226       </refsect3>
1227
1228       <variablelist>
1229
1230         <varlistentry>
1231           <term>CTDB_MANAGES_CLAMD=yes|no</term>
1232           <listitem>
1233             <para>
1234               Should CTDB manage ClamAV?
1235             </para>
1236             <para>
1237               Default is no.
1238             </para>
1239           </listitem>
1240         </varlistentry>
1241
1242         <varlistentry>
1243           <term>CTDB_CLAMD_SOCKET=<parameter>FILENAME</parameter></term>
1244           <listitem>
1245             <para>
1246               FILENAME is the socket to monitor ClamAV.
1247             </para>
1248             <para>
1249               No default.
1250             </para>
1251           </listitem>
1252         </varlistentry>
1253
1254       </variablelist>
1255
1256     </refsect2>
1257
1258     <refsect2>
1259       <title>ISCSI</title>
1260
1261       <para>
1262         CTDB has support for managing the Linux iSCSI tgtd service.
1263       </para>
1264
1265       <refsect3>
1266         <title>Eventscript</title>
1267
1268         <simplelist>
1269           <member><filename>70.iscsi</filename></member>
1270         </simplelist>
1271       </refsect3>
1272
1273       <variablelist>
1274
1275         <varlistentry>
1276           <term>CTDB_MANAGES_ISCSI=yes|no</term>
1277           <listitem>
1278             <para>
1279               Should CTDB manage iSCSI tgtd?
1280             </para>
1281             <para>
1282               Default is no.
1283             </para>
1284           </listitem>
1285         </varlistentry>
1286
1287         <varlistentry>
1288           <term>CTDB_START_ISCSI_SCRIPTS=<parameter>DIRECTORY</parameter></term>
1289           <listitem>
1290             <para>
1291               DIRECTORY on shared storage containing scripts to start
1292               tgtd for each public IP address.
1293             </para>
1294             <para>
1295               No default.
1296             </para>
1297           </listitem>
1298         </varlistentry>
1299       </variablelist>
1300     </refsect2>
1301
1302     <refsect2>
1303       <title>MULTIPATHD</title>
1304
1305       <para>
1306         CTDB can monitor multipath devices to ensure that active paths
1307         are available.
1308       </para>
1309
1310       <refsect3>
1311         <title>Eventscript</title>
1312
1313         <simplelist>
1314           <member><filename>20.multipathd</filename></member>
1315         </simplelist>
1316
1317         <para>
1318           This eventscript is not enabled by default.  Use
1319           <command>ctdb enablescript</command> to enable it.
1320         </para>
1321       </refsect3>
1322
1323       <variablelist>
1324         <varlistentry>
1325           <term>CTDB_MONITOR_MPDEVICES=<parameter>MP-DEVICE-LIST</parameter></term>
1326           <listitem>
1327             <para>
1328               MP-DEVICE-LIST is a list of multipath devices for CTDB to monitor?
1329             </para>
1330             <para>
1331               No default.
1332             </para>
1333           </listitem>
1334         </varlistentry>
1335       </variablelist>
1336     </refsect2>
1337
1338     <refsect2>
1339       <title>VSFTPD</title>
1340
1341       <para>
1342         CTDB can manage the vsftpd FTP server.
1343       </para>
1344
1345       <refsect3>
1346         <title>Eventscript</title>
1347
1348         <simplelist>
1349           <member><filename>40.vsftpd</filename></member>
1350         </simplelist>
1351       </refsect3>
1352
1353       <variablelist>
1354         <varlistentry>
1355           <term>CTDB_MANAGES_VSFTPD=yes|no</term>
1356           <listitem>
1357             <para>
1358               Should CTDB manage the vsftpd FTP server?
1359             </para>
1360             <para>
1361               Default is no.
1362             </para>
1363           </listitem>
1364         </varlistentry>
1365       </variablelist>
1366     </refsect2>
1367
1368     <refsect2>
1369       <title>
1370         SYSTEM RESOURCE MONITORING CONFIGURATION
1371       </title>
1372
1373       <para>
1374         CTDB can experience seemingly random (performance and other)
1375         issues if system resources become too constrained.  Options in
1376         this section can be enabled to allow certain system resources
1377         to be checked.  They allows warnings to be logged and nodes to
1378         be marked unhealthy when system resource usage reaches the
1379         configured thresholds.
1380       </para>
1381
1382       <para>
1383         Some checks are enabled by default.  It is recommended that
1384         these checks remain enabled or are augmented by extra checks.
1385         There is no supported way of completely disabling the checks.
1386       </para>
1387
1388       <refsect3>
1389         <title>Eventscripts</title>
1390
1391         <simplelist>
1392           <member><filename>05.system</filename></member>
1393         </simplelist>
1394
1395         <para>
1396           Filesystem and memory usage monitoring is in
1397           <filename>05.system</filename>.
1398         </para>
1399       </refsect3>
1400
1401       <variablelist>
1402
1403         <varlistentry>
1404           <term>CTDB_MONITOR_FILESYSTEM_USAGE=<parameter>FS-LIMIT-LIST</parameter></term>
1405           <listitem>
1406             <para>
1407               FS-LIMIT-LIST is a space-separated list of
1408               <parameter>FILESYSTEM</parameter>:<parameter>WARN_LIMIT</parameter><optional>:<parameter>UNHEALTHY_LIMIT</parameter></optional>
1409               triples indicating that warnings should be logged if the
1410               space used on FILESYSTEM reaches WARN_LIMIT%.  If usage
1411               reaches UNHEALTHY_LIMIT then the node should be flagged
1412               unhealthy.  Either WARN_LIMIT or UNHEALTHY_LIMIT may be
1413               left blank, meaning that check will be omitted.
1414             </para>
1415
1416             <para>
1417               Default is to warn for each filesystem containing a
1418               database directory (<envar>CTDB_DBDIR</envar>,
1419               <envar>CTDB_DBDIR_PERSISTENT</envar>,
1420               <envar>CTDB_DBDIR_STATE</envar>) with a threshold of
1421               90%.
1422             </para>
1423           </listitem>
1424         </varlistentry>
1425
1426         <varlistentry>
1427           <term>CTDB_MONITOR_MEMORY_USAGE=<parameter>MEM-LIMITS</parameter></term>
1428           <listitem>
1429             <para>
1430               MEM-LIMITS takes the form
1431               <parameter>WARN_LIMIT</parameter><optional>:<parameter>UNHEALTHY_LIMIT</parameter></optional>
1432               indicating that warnings should be logged if memory
1433               usage reaches WARN_LIMIT%.  If usage reaches
1434               UNHEALTHY_LIMIT then the node should be flagged
1435               unhealthy.  Either WARN_LIMIT or UNHEALTHY_LIMIT may be
1436               left blank, meaning that check will be omitted.
1437             </para>
1438             <para>
1439               Default is 80, so warnings will be logged when memory
1440               usage reaches 80%.
1441             </para>
1442           </listitem>
1443         </varlistentry>
1444
1445         <varlistentry>
1446           <term>CTDB_MONITOR_SWAP_USAGE=<parameter>SWAP-LIMITS</parameter></term>
1447           <listitem>
1448             <para>
1449               SWAP-LIMITS takes the form
1450               <parameter>WARN_LIMIT</parameter><optional>:<parameter>UNHEALTHY_LIMIT</parameter></optional>
1451                indicating that warnings should be logged if
1452               swap usage reaches WARN_LIMIT%.  If usage reaches
1453               UNHEALTHY_LIMIT then the node should be flagged
1454               unhealthy.  Either WARN_LIMIT or UNHEALTHY_LIMIT may be
1455               left blank, meaning that check will be omitted.
1456             </para>
1457             <para>
1458               Default is 25, so warnings will be logged when swap
1459               usage reaches 25%.
1460             </para>
1461           </listitem>
1462         </varlistentry>
1463
1464       </variablelist>
1465     </refsect2>
1466
1467     <refsect2>
1468       <title>MISCELLANEOUS SERVICE-RELATED CONFIGURATION</title>
1469
1470       <variablelist>
1471
1472         <varlistentry>
1473           <term>CTDB_MANAGED_SERVICES=<parameter>SERVICE-LIST</parameter></term>
1474           <listitem>
1475             <para>
1476               SERVICE-LIST is a space-separated list of SERVICEs that
1477               CTDB should manage.  This can be used as an alternative
1478               to the
1479               <varname>CTDB_MANAGES_<replaceable>SERVICE</replaceable></varname>
1480               variables.
1481             </para>
1482             <para>
1483               No default.
1484             </para>
1485           </listitem>
1486         </varlistentry>
1487
1488       </variablelist>
1489
1490     </refsect2>
1491
1492   </refsect1>
1493
1494   <refsect1>
1495     <title>
1496       TUNABLES CONFIGURATION
1497     </title>
1498
1499     <para>
1500       CTDB tunables (see
1501       <citerefentry><refentrytitle>ctdbd-tunables</refentrytitle>
1502       <manvolnum>7</manvolnum></citerefentry>) can be set from the
1503       configuration file.  They are set as follows:
1504
1505       <literallayout>
1506 CTDB_SET_<replaceable>TUNABLE</replaceable>=<replaceable>VALUE</replaceable>
1507       </literallayout>
1508     </para>
1509
1510     <para>
1511       For example:
1512
1513       <screen format="linespecific">
1514 CTDB_SET_MonitorInterval=20
1515       </screen>
1516     </para>
1517   </refsect1>
1518
1519   <refsect1>
1520     <title>
1521       DEBUG AND TEST
1522     </title>
1523
1524     <para>
1525       Variable in this section are for debugging and testing CTDB.
1526       They should not generally be needed.
1527     </para>
1528
1529     <variablelist>
1530
1531       <varlistentry>
1532         <term>CTDB_DEBUG_HUNG_SCRIPT=<parameter>FILENAME</parameter></term>
1533         <listitem>
1534           <para>
1535             FILENAME is a script to run to log debug information when
1536             an event script times out.
1537           </para>
1538           <para>
1539             Default is <filename><varname>CTDB_BASE</varname>/debug-hung-script.sh</filename>.
1540           </para>
1541         </listitem>
1542       </varlistentry>
1543
1544       <varlistentry>
1545         <term>CTDB_DEBUG_HUNG_SCRIPT_LOGFILE=<parameter>FILENAME</parameter></term>
1546         <listitem>
1547           <para>
1548             FILENAME specifies where log messages should go when
1549             debugging hung eventscripts.  This is a testing option.
1550             See also <citetitle>CTDB_DEBUG_HUNG_SCRIPT</citetitle>.
1551           </para>
1552           <para>
1553             No default.  Messages go to stdout/stderr and are logged
1554             to the same place as other CTDB log messages.
1555           </para>
1556         </listitem>
1557       </varlistentry>
1558
1559       <varlistentry>
1560         <term>CTDB_DEBUG_HUNG_SCRIPT_STACKPAT=<parameter>REGEXP</parameter></term>
1561         <listitem>
1562           <para>
1563             REGEXP specifies interesting processes for which stack
1564             traces should be logged when debugging hung eventscripts
1565             and those processes are matched in pstree output.  REGEXP
1566             is an extended regexp so choices are separated by pipes
1567             ('|').  However, REGEXP should not contain parentheses.
1568             See also <citetitle>CTDB_DEBUG_HUNG_SCRIPT</citetitle>.
1569           </para>
1570           <para>
1571             Default is "exportfs|rpcinfo".
1572           </para>
1573         </listitem>
1574       </varlistentry>
1575
1576       <varlistentry>
1577         <term>CTDB_DEBUG_LOCKS=<parameter>FILENAME</parameter></term>
1578         <listitem>
1579           <para>
1580             FILENAME is a script to run to log debug information when
1581             an CTDB fails to freeze databases during recovery.
1582           </para>
1583           <para>
1584             No default, usually
1585             <filename><varname>CTDB_BASE</varname>/debug_locks.sh</filename>.
1586           </para>
1587         </listitem>
1588       </varlistentry>
1589
1590       <varlistentry>
1591         <term>CTDB_SYS_ETCDIR=<parameter>DIRECTORY</parameter></term>
1592         <listitem>
1593           <para>
1594             DIRECTORY containing system configuration files.  This is
1595             used to provide alternate configuration when testing and
1596             should not need to be changed from the default.
1597           </para>
1598           <para>
1599             Default is <filename>/etc</filename>.
1600           </para>
1601         </listitem>
1602       </varlistentry>
1603
1604       <varlistentry>
1605         <term>CTDB_INIT_STYLE=debian|redhat|suse</term>
1606         <listitem>
1607           <para>
1608             This is the init style used by the Linux distribution (or
1609             other operating system) being used.  This is usually
1610             determined dynamically by checking the system.  This
1611             variable is used by the initscript to determine which init
1612             system primitives to use.  It is also used by some
1613             eventscripts to choose the name of initscripts for certain
1614             services, since these can vary between distributions.
1615           </para>
1616           <para>
1617             No fixed default.
1618           </para>
1619           <para>
1620             If this option needs to be changed from the calculated
1621             default for the initscript to function properly, then it
1622             must be set in the distribution-specific initscript
1623             configuration, such as
1624             <filename>/etc/sysconfig/ctdb</filename>
1625           </para>
1626         </listitem>
1627       </varlistentry>
1628
1629       <varlistentry>
1630         <term>CTDB_MAX_CORRUPT_DB_BACKUPS=<parameter>NUM</parameter></term>
1631         <listitem>
1632           <para>
1633             NUM is the maximum number of volatile TDB database backups
1634             to be kept (for each database) when a corrupt database is
1635             found during startup.  Volatile TDBs are zeroed during
1636             startup so backups are needed to debug any corruption that
1637             occurs before a restart.
1638           </para>
1639           <para>
1640             Default is 10.
1641           </para>
1642         </listitem>
1643       </varlistentry>
1644
1645       <varlistentry>
1646         <term>CTDB_MAX_OPEN_FILES=<parameter>NUM</parameter></term>
1647         <listitem>
1648           <para>
1649             NUM is the maximum number of open files.
1650           </para>
1651           <para>
1652             There is no default.
1653           </para>
1654         </listitem>
1655       </varlistentry>
1656
1657       <varlistentry>
1658         <term>CTDB_RC_LOCAL=<parameter>FILENAME</parameter></term>
1659         <listitem>
1660           <para>
1661             FILENAME is a script fragment to be sourced by the
1662             <filename>functions</filename> that is sourced by scripts.
1663             On example use would be to override function definitions
1664             in unit tests.  As a sanity check, this file must be
1665             executable for it to be used.
1666           </para>
1667           <para>
1668             No default.
1669           </para>
1670         </listitem>
1671       </varlistentry>
1672
1673       <varlistentry>
1674         <term>CTDB_RUN_TIMEOUT_MONITOR=yes|no</term>
1675         <listitem>
1676           <para>
1677             Whether CTDB should simulate timing out monitor events.
1678             This uses the <filename>99.timeout</filename> eventscript.
1679           </para>
1680           <para>
1681             Default is no.
1682           </para>
1683         </listitem>
1684       </varlistentry>
1685
1686       <varlistentry>
1687         <term>CTDB_SCRIPT_DEBUGLEVEL=<parameter>DEBUGLEVEL</parameter></term>
1688         <listitem>
1689           <para>
1690             DEBUGLEVEL is the level debugging messages printed by CTDB
1691             scripts.  Setting this to a higher level (e.g. DEBUG) will
1692             cause some scripts to log more messages.
1693           </para>
1694           <para>
1695             Default is NOTICE.
1696           </para>
1697         </listitem>
1698       </varlistentry>
1699
1700       <varlistentry>
1701         <term>CTDB_SUPPRESS_COREFILE=yes|no</term>
1702         <listitem>
1703           <para>
1704             Whether CTDB core files should be suppressed.
1705           </para>
1706           <para>
1707             Default is no.
1708           </para>
1709         </listitem>
1710       </varlistentry>
1711
1712       <varlistentry>
1713         <term>CTDB_VALGRIND=yes|no|<parameter>COMMAND</parameter></term>
1714         <listitem>
1715           <para>
1716             If "yes", this causes
1717             <citerefentry><refentrytitle>ctdbd</refentrytitle>
1718             <manvolnum>1</manvolnum></citerefentry> to be run under
1719             <citerefentry><refentrytitle>valgrind</refentrytitle>
1720             <manvolnum>1</manvolnum></citerefentry> with logs going to
1721             <filename>/usr/local/var/log/ctdb_valgrind</filename>.  If neither
1722             "yes" nor "no" then the value is assumed to be a COMMAND
1723             (e.g. a <command>valgrind</command> variation, a
1724             <citerefentry><refentrytitle>gdb</refentrytitle>
1725             <manvolnum>1</manvolnum></citerefentry> command) that is
1726             used in place of the default <command>valgrind</command>
1727             command.  In either case, the <option>--valgrind</option>
1728             option is passed to <command>ctdbd</command>.
1729           </para>
1730           <para>
1731             Default is no.
1732           </para>
1733         </listitem>
1734       </varlistentry>
1735
1736       <varlistentry>
1737         <term>CTDB_VARDIR=<parameter>DIRECTORY</parameter></term>
1738         <listitem>
1739           <para>
1740             DIRECTORY containing CTDB files that are modified at
1741             runtime.
1742           </para>
1743           <para>
1744             Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
1745           </para>
1746         </listitem>
1747       </varlistentry>
1748
1749     </variablelist>
1750
1751   </refsect1>
1752
1753
1754   <refsect1>
1755     <title>FILES</title>
1756
1757     <simplelist>
1758       <member><filename>/usr/local/etc/ctdb/ctdbd.conf</filename></member>
1759       <member><filename>/etc/sysconfig/ctdb</filename></member>
1760       <member><filename>/etc/default/ctdb</filename></member>
1761       <member><filename>/usr/local/etc/ctdb/sysconfig/ctdb</filename></member>
1762     </simplelist>
1763   </refsect1>
1764
1765   <refsect1>
1766     <title>SEE ALSO</title>
1767     <para>
1768       <citerefentry><refentrytitle>ctdbd</refentrytitle>
1769       <manvolnum>1</manvolnum></citerefentry>,
1770
1771       <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
1772       <manvolnum>1</manvolnum></citerefentry>,
1773
1774       <citerefentry><refentrytitle>onnode</refentrytitle>
1775       <manvolnum>1</manvolnum></citerefentry>,
1776
1777       <citerefentry><refentrytitle>ctdb</refentrytitle>
1778       <manvolnum>7</manvolnum></citerefentry>,
1779
1780       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
1781       <manvolnum>7</manvolnum></citerefentry>,
1782
1783       <ulink url="http://ctdb.samba.org/"/>
1784     </para>
1785   </refsect1>
1786
1787   <refentryinfo>
1788     <author>
1789       <contrib>
1790         This documentation was written by
1791         Amitay Isaacs,
1792         Martin Schwenke
1793       </contrib>
1794     </author>
1795
1796     <copyright>
1797       <year>2007</year>
1798       <holder>Andrew Tridgell</holder>
1799       <holder>Ronnie Sahlberg</holder>
1800     </copyright>
1801     <legalnotice>
1802       <para>
1803         This program is free software; you can redistribute it and/or
1804         modify it under the terms of the GNU General Public License as
1805         published by the Free Software Foundation; either version 3 of
1806         the License, or (at your option) any later version.
1807       </para>
1808       <para>
1809         This program is distributed in the hope that it will be
1810         useful, but WITHOUT ANY WARRANTY; without even the implied
1811         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
1812         PURPOSE.  See the GNU General Public License for more details.
1813       </para>
1814       <para>
1815         You should have received a copy of the GNU General Public
1816         License along with this program; if not, see
1817         <ulink url="http://www.gnu.org/licenses"/>.
1818       </para>
1819     </legalnotice>
1820   </refentryinfo>
1821
1822 </refentry>