ctdb-daemon: Fix CID 1364527/8/9: Null pointer dereferences (NULL_RETURNS)
[Samba.git] / ctdb / doc / ctdbd.conf.5.xml
blob2ec76fd3086a6355760467edb9aa2bf73df6b74f
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">
6 <refentry id="ctdbd.conf.5">
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>
15   <refnamediv>
16     <refname>ctdbd.conf</refname>
17     <refpurpose>CTDB daemon configuration file</refpurpose>
18   </refnamediv>
20   <refsect1>
21     <title>DESCRIPTION</title>
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>
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>
36     <para>
37       CTDB configuration variables are grouped into several categories below.
38     </para>
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>
51   </refsect1>
53   <refsect1>
54     <title>
55       INITSCRIPT CONFIGURATION
56     </title>
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>
65     <variablelist>
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>
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>
85     </variablelist>
86   </refsect1>
88   <refsect1>
89     <title>
90       GLOBAL CONFIGURATION
91     </title>
93     <para>
94       These options may be used in the initscripts, daemon and
95       scripts.
96     </para>
98     <variablelist>
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>
109     </variablelist>
110   </refsect1>
112   <refsect1>
113     <title>
114       DAEMON CONFIGURATION
115     </title>
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>
130     <para>
131       Many of these variables are also used by event scripts.
132     </para>
134     <variablelist>
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>
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>
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>
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>
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>
202       <varlistentry>
203         <term>CTDB_DEBUGLEVEL=<parameter>DEBUGLEVEL</parameter></term>
204         <listitem>
205           <para>
206             Default is NOTICE (2).  Corresponds to <option>-d</option> or
207             <option>--debug</option>.
208           </para>
209         </listitem>
210       </varlistentry>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
417       <varlistentry>
418         <term>CTDB_SCRIPT_LOG_LEVEL=<parameter>DEBUGLEVEL</parameter></term>
419         <listitem>
420           <para>
421             Defaults to ERR (0).  Corresponds to
422             <option>--script-log-level</option>.
423           </para>
424         </listitem>
425       </varlistentry>
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>
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>
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>
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>
475     </variablelist>
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>
486     <variablelist>
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>
498           <para>
499             Defaults is 30.
500           </para>
501         </listitem>
502       </varlistentry>
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>
516           <para>
517             Defaults is 10.
518           </para>
519         </listitem>
520       </varlistentry>
522     </variablelist>
523   </refsect1>
525   <refsect1>
526     <title>NETWORK CONFIGURATION</title>
528     <refsect2>
529       <title>NAT GATEWAY</title>
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>
544       <variablelist>
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>
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>
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>
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>
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>
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>
673       </variablelist>
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>
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>
703     </refsect2>
705     <refsect2>
706       <title>POLICY ROUTING</title>
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>
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>
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>
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>
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>
751             <para>
752               No default, usually
753               <filename>/usr/local/etc/ctdb/policy_routing</filename> when enabled.
754             </para>
755           </listitem>
756         </varlistentry>
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>
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>
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>
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>
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>
809             <para>
810               No default, usually 1000 and 9000.
811             </para>
812           </listitem>
813         </varlistentry>
814       </variablelist>
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>
826     </refsect2>
828     <refsect2>
829       <title>LVS</title>
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>
837       <refsect3>
838         <title>Eventscript</title>
840         <simplelist>
841           <member><filename>91.lvs</filename></member>
842         </simplelist>
843       </refsect3>
845       <variablelist>
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>
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>
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>
900       </variablelist>
901     </refsect2>
903     <refsect2>
904       <title>MISCELLANEOUS NETWORK CONFIGURATION</title>
906       <variablelist>
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>
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>
926             <para>
927               Default is "no".
928             </para>
929           </listitem>
930         </varlistentry>
932       </variablelist>
933     </refsect2>
935   </refsect1>
937   <refsect1>
938     <title>SERVICE CONFIGURATION</title>
940     <para>
941       CTDB can be configured to manage and/or monitor various NAS (and
942       other) services via its eventscripts.
943     </para>
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>
953     <refsect2>
954       <title>SAMBA</title>
956       <refsect3>
957         <title>Eventscripts</title>
959         <simplelist>
960           <member><filename>49.winbind</filename></member>
961           <member><filename>50.samba</filename></member>
962         </simplelist>
963       </refsect3>
965       <variablelist>
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>
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>
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>
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>
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>
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>
1054       </variablelist>
1056     </refsect2>
1058     <refsect2>
1059       <title>NFS</title>
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>
1068       <refsect3>
1069         <title>Eventscript</title>
1071         <simplelist>
1072           <member><filename>60.nfs</filename></member>
1073         </simplelist>
1074       </refsect3>
1076       <variablelist>
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>
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>
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>
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>
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>
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>
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>
1172       </variablelist>
1174     </refsect2>
1176     <refsect2>
1177       <title>APACHE HTTPD</title>
1179       <para>
1180         CTDB can manage the Apache web server.
1181       </para>
1183       <refsect3>
1184         <title>Eventscript</title>
1186         <simplelist>
1187           <member><filename>41.httpd</filename></member>
1188         </simplelist>
1189       </refsect3>
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>
1206     <refsect2>
1207       <title>CLAMAV</title>
1209       <para>
1210         CTDB has support to manage the popular anti-virus daemon
1211         ClamAV.
1212       </para>
1214       <refsect3>
1215         <title>Eventscript</title>
1217         <simplelist>
1218           <member><filename>31.clamd</filename></member>
1219         </simplelist>
1221         <para>
1222           This eventscript is not enabled by default.  Use
1223           <command>ctdb enablescript</command> to enable it.
1224         </para>
1226       </refsect3>
1228       <variablelist>
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>
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>
1254       </variablelist>
1256     </refsect2>
1258     <refsect2>
1259       <title>ISCSI</title>
1261       <para>
1262         CTDB has support for managing the Linux iSCSI tgtd service.
1263       </para>
1265       <refsect3>
1266         <title>Eventscript</title>
1268         <simplelist>
1269           <member><filename>70.iscsi</filename></member>
1270         </simplelist>
1271       </refsect3>
1273       <variablelist>
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>
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>
1302     <refsect2>
1303       <title>MULTIPATHD</title>
1305       <para>
1306         CTDB can monitor multipath devices to ensure that active paths
1307         are available.
1308       </para>
1310       <refsect3>
1311         <title>Eventscript</title>
1313         <simplelist>
1314           <member><filename>20.multipathd</filename></member>
1315         </simplelist>
1317         <para>
1318           This eventscript is not enabled by default.  Use
1319           <command>ctdb enablescript</command> to enable it.
1320         </para>
1321       </refsect3>
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>
1338     <refsect2>
1339       <title>VSFTPD</title>
1341       <para>
1342         CTDB can manage the vsftpd FTP server.
1343       </para>
1345       <refsect3>
1346         <title>Eventscript</title>
1348         <simplelist>
1349           <member><filename>40.vsftpd</filename></member>
1350         </simplelist>
1351       </refsect3>
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>
1368     <refsect2>
1369       <title>
1370         SYSTEM RESOURCE MONITORING CONFIGURATION
1371       </title>
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>
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>
1388       <refsect3>
1389         <title>Eventscripts</title>
1391         <simplelist>
1392           <member><filename>05.system</filename></member>
1393         </simplelist>
1395         <para>
1396           Filesystem and memory usage monitoring is in
1397           <filename>05.system</filename>.
1398         </para>
1399       </refsect3>
1401       <variablelist>
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>
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>
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>
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>
1464       </variablelist>
1465     </refsect2>
1467     <refsect2>
1468       <title>MISCELLANEOUS SERVICE-RELATED CONFIGURATION</title>
1470       <variablelist>
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>
1488         <varlistentry>
1489           <term>CTDB_SERVICE_AUTOSTARTSTOP=yes|no</term>
1490           <listitem>
1491             <para>
1492               When CTDB should start and stop services if they become
1493               managed or unmanaged.
1494             </para>
1495             <para>
1496               Default is no.
1497             </para>
1498           </listitem>
1499         </varlistentry>
1501       </variablelist>
1503     </refsect2>
1505   </refsect1>
1507   <refsect1>
1508     <title>
1509       TUNABLES CONFIGURATION
1510     </title>
1512     <para>
1513       CTDB tunables (see
1514       <citerefentry><refentrytitle>ctdbd-tunables</refentrytitle>
1515       <manvolnum>7</manvolnum></citerefentry>) can be set from the
1516       configuration file.  They are set as follows:
1518       <literallayout>
1519 CTDB_SET_<replaceable>TUNABLE</replaceable>=<replaceable>VALUE</replaceable>
1520       </literallayout>
1521     </para>
1523     <para>
1524       For example:
1526       <screen format="linespecific">
1527 CTDB_SET_MonitorInterval=20
1528       </screen>
1529     </para>
1530   </refsect1>
1532   <refsect1>
1533     <title>
1534       DEBUG AND TEST
1535     </title>
1537     <para>
1538       Variable in this section are for debugging and testing CTDB.
1539       They should not generally be needed.
1540     </para>
1542     <variablelist>
1544       <varlistentry>
1545         <term>CTDB_DEBUG_HUNG_SCRIPT=<parameter>FILENAME</parameter></term>
1546         <listitem>
1547           <para>
1548             FILENAME is a script to run to log debug information when
1549             an event script times out.
1550           </para>
1551           <para>
1552             Default is <filename><varname>CTDB_BASE</varname>/debug-hung-script.sh</filename>.
1553           </para>
1554         </listitem>
1555       </varlistentry>
1557       <varlistentry>
1558         <term>CTDB_DEBUG_HUNG_SCRIPT_LOGFILE=<parameter>FILENAME</parameter></term>
1559         <listitem>
1560           <para>
1561             FILENAME specifies where log messages should go when
1562             debugging hung eventscripts.  This is a testing option.
1563             See also <citetitle>CTDB_DEBUG_HUNG_SCRIPT</citetitle>.
1564           </para>
1565           <para>
1566             No default.  Messages go to stdout/stderr and are logged
1567             to the same place as other CTDB log messages.
1568           </para>
1569         </listitem>
1570       </varlistentry>
1572       <varlistentry>
1573         <term>CTDB_DEBUG_HUNG_SCRIPT_STACKPAT=<parameter>REGEXP</parameter></term>
1574         <listitem>
1575           <para>
1576             REGEXP specifies interesting processes for which stack
1577             traces should be logged when debugging hung eventscripts
1578             and those processes are matched in pstree output.  REGEXP
1579             is an extended regexp so choices are separated by pipes
1580             ('|').  However, REGEXP should not contain parentheses.
1581             See also <citetitle>CTDB_DEBUG_HUNG_SCRIPT</citetitle>.
1582           </para>
1583           <para>
1584             Default is "exportfs|rpcinfo".
1585           </para>
1586         </listitem>
1587       </varlistentry>
1589       <varlistentry>
1590         <term>CTDB_DEBUG_LOCKS=<parameter>FILENAME</parameter></term>
1591         <listitem>
1592           <para>
1593             FILENAME is a script to run to log debug information when
1594             an CTDB fails to freeze databases during recovery.
1595           </para>
1596           <para>
1597             No default, usually
1598             <filename><varname>CTDB_BASE</varname>/debug_locks.sh</filename>.
1599           </para>
1600         </listitem>
1601       </varlistentry>
1603       <varlistentry>
1604         <term>CTDB_SYS_ETCDIR=<parameter>DIRECTORY</parameter></term>
1605         <listitem>
1606           <para>
1607             DIRECTORY containing system configuration files.  This is
1608             used to provide alternate configuration when testing and
1609             should not need to be changed from the default.
1610           </para>
1611           <para>
1612             Default is <filename>/etc</filename>.
1613           </para>
1614         </listitem>
1615       </varlistentry>
1617       <varlistentry>
1618         <term>CTDB_INIT_STYLE=debian|redhat|suse</term>
1619         <listitem>
1620           <para>
1621             This is the init style used by the Linux distribution (or
1622             other operating system) being used.  This is usually
1623             determined dynamically by checking the system.  This
1624             variable is used by the initscript to determine which init
1625             system primitives to use.  It is also used by some
1626             eventscripts to choose the name of initscripts for certain
1627             services, since these can vary between distributions.
1628           </para>
1629           <para>
1630             No fixed default.
1631           </para>
1632           <para>
1633             If this option needs to be changed from the calculated
1634             default for the initscript to function properly, then it
1635             must be set in the distribution-specific initscript
1636             configuration, such as
1637             <filename>/etc/sysconfig/ctdb</filename>
1638           </para>
1639         </listitem>
1640       </varlistentry>
1642       <varlistentry>
1643         <term>CTDB_MAX_CORRUPT_DB_BACKUPS=<parameter>NUM</parameter></term>
1644         <listitem>
1645           <para>
1646             NUM is the maximum number of volatile TDB database backups
1647             to be kept (for each database) when a corrupt database is
1648             found during startup.  Volatile TDBs are zeroed during
1649             startup so backups are needed to debug any corruption that
1650             occurs before a restart.
1651           </para>
1652           <para>
1653             Default is 10.
1654           </para>
1655         </listitem>
1656       </varlistentry>
1658       <varlistentry>
1659         <term>CTDB_MAX_OPEN_FILES=<parameter>NUM</parameter></term>
1660         <listitem>
1661           <para>
1662             NUM is the maximum number of open files.
1663           </para>
1664           <para>
1665             There is no default.
1666           </para>
1667         </listitem>
1668       </varlistentry>
1670       <varlistentry>
1671         <term>CTDB_RC_LOCAL=<parameter>FILENAME</parameter></term>
1672         <listitem>
1673           <para>
1674             FILENAME is a script fragment to be sourced by the
1675             <filename>functions</filename> that is sourced by scripts.
1676             On example use would be to override function definitions
1677             in unit tests.  As a sanity check, this file must be
1678             executable for it to be used.
1679           </para>
1680           <para>
1681             No default.
1682           </para>
1683         </listitem>
1684       </varlistentry>
1686       <varlistentry>
1687         <term>CTDB_RUN_TIMEOUT_MONITOR=yes|no</term>
1688         <listitem>
1689           <para>
1690             Whether CTDB should simulate timing out monitor events.
1691             This uses the <filename>99.timeout</filename> eventscript.
1692           </para>
1693           <para>
1694             Default is no.
1695           </para>
1696         </listitem>
1697       </varlistentry>
1699       <varlistentry>
1700         <term>CTDB_SCRIPT_DEBUGLEVEL=<parameter>NUM</parameter></term>
1701         <listitem>
1702           <para>
1703             NUM is the level debugging messages printed by CTDB
1704             scripts.  Setting this to a higher number (e.g. 4) will
1705             cause some scripts to log more messages.
1706           </para>
1707           <para>
1708             Default is 2.
1709           </para>
1710         </listitem>
1711       </varlistentry>
1713       <varlistentry>
1714         <term>CTDB_SUPPRESS_COREFILE=yes|no</term>
1715         <listitem>
1716           <para>
1717             Whether CTDB core files should be suppressed.
1718           </para>
1719           <para>
1720             Default is no.
1721           </para>
1722         </listitem>
1723       </varlistentry>
1725       <varlistentry>
1726         <term>CTDB_VALGRIND=yes|no|<parameter>COMMAND</parameter></term>
1727         <listitem>
1728           <para>
1729             If "yes", this causes
1730             <citerefentry><refentrytitle>ctdbd</refentrytitle>
1731             <manvolnum>1</manvolnum></citerefentry> to be run under
1732             <citerefentry><refentrytitle>valgrind</refentrytitle>
1733             <manvolnum>1</manvolnum></citerefentry> with logs going to
1734             <filename>/usr/local/var/log/ctdb_valgrind</filename>.  If neither
1735             "yes" nor "no" then the value is assumed to be a COMMAND
1736             (e.g. a <command>valgrind</command> variation, a
1737             <citerefentry><refentrytitle>gdb</refentrytitle>
1738             <manvolnum>1</manvolnum></citerefentry> command) that is
1739             used in place of the default <command>valgrind</command>
1740             command.  In either case, the <option>--valgrind</option>
1741             option is passed to <command>ctdbd</command>.
1742           </para>
1743           <para>
1744             Default is no.
1745           </para>
1746         </listitem>
1747       </varlistentry>
1749       <varlistentry>
1750         <term>CTDB_VARDIR=<parameter>DIRECTORY</parameter></term>
1751         <listitem>
1752           <para>
1753             DIRECTORY containing CTDB files that are modified at
1754             runtime.
1755           </para>
1756           <para>
1757             Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
1758           </para>
1759         </listitem>
1760       </varlistentry>
1762     </variablelist>
1764   </refsect1>
1767   <refsect1>
1768     <title>FILES</title>
1770     <simplelist>
1771       <member><filename>/usr/local/etc/ctdb/ctdbd.conf</filename></member>
1772       <member><filename>/etc/sysconfig/ctdb</filename></member>
1773       <member><filename>/etc/default/ctdb</filename></member>
1774       <member><filename>/usr/local/etc/ctdb/sysconfig/ctdb</filename></member>
1775     </simplelist>
1776   </refsect1>
1778   <refsect1>
1779     <title>SEE ALSO</title>
1780     <para>
1781       <citerefentry><refentrytitle>ctdbd</refentrytitle>
1782       <manvolnum>1</manvolnum></citerefentry>,
1784       <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
1785       <manvolnum>1</manvolnum></citerefentry>,
1787       <citerefentry><refentrytitle>onnode</refentrytitle>
1788       <manvolnum>1</manvolnum></citerefentry>,
1790       <citerefentry><refentrytitle>ctdb</refentrytitle>
1791       <manvolnum>7</manvolnum></citerefentry>,
1793       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
1794       <manvolnum>7</manvolnum></citerefentry>,
1796       <ulink url="http://ctdb.samba.org/"/>
1797     </para>
1798   </refsect1>
1800   <refentryinfo>
1801     <author>
1802       <contrib>
1803         This documentation was written by
1804         Amitay Isaacs,
1805         Martin Schwenke
1806       </contrib>
1807     </author>
1809     <copyright>
1810       <year>2007</year>
1811       <holder>Andrew Tridgell</holder>
1812       <holder>Ronnie Sahlberg</holder>
1813     </copyright>
1814     <legalnotice>
1815       <para>
1816         This program is free software; you can redistribute it and/or
1817         modify it under the terms of the GNU General Public License as
1818         published by the Free Software Foundation; either version 3 of
1819         the License, or (at your option) any later version.
1820       </para>
1821       <para>
1822         This program is distributed in the hope that it will be
1823         useful, but WITHOUT ANY WARRANTY; without even the implied
1824         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
1825         PURPOSE.  See the GNU General Public License for more details.
1826       </para>
1827       <para>
1828         You should have received a copy of the GNU General Public
1829         License along with this program; if not, see
1830         <ulink url="http://www.gnu.org/licenses"/>.
1831       </para>
1832     </legalnotice>
1833   </refentryinfo>
1835 </refentry>