gensec: Fix CID 242642 Unchecked return value
[Samba.git] / ctdb / doc / ctdbd.1.xml
blob558e5342b7df8fa7dc0f4f25a7d3ac1f310b55ce
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.1">
8   <refmeta>
9     <refentrytitle>ctdbd</refentrytitle>
10     <manvolnum>1</manvolnum>
11     <refmiscinfo class="source">ctdb</refmiscinfo>
12     <refmiscinfo class="manual">CTDB - clustered TDB database</refmiscinfo>
13   </refmeta>
15   <refnamediv>
16     <refname>ctdbd</refname>
17     <refpurpose>The CTDB cluster daemon</refpurpose>
18   </refnamediv>
20   <refsynopsisdiv>
21     <cmdsynopsis>
22       <command>ctdbd</command>
23       <arg rep="repeat"><replaceable>OPTION</replaceable></arg>
24     </cmdsynopsis>
25   </refsynopsisdiv>
27   <refsect1>
28     <title>DESCRIPTION</title>
29     <para>
30       ctdbd is the main CTDB daemon.
31     </para>
33     <para>
34       Note that ctdbd is not usually invoked directly.  It is invoked
35       via <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
36       <manvolnum>1</manvolnum></citerefentry> or via the initscript.
37     </para>
39     <para>
40       See <citerefentry><refentrytitle>ctdb</refentrytitle>
41       <manvolnum>7</manvolnum></citerefentry> for an overview of CTDB.
42     </para>
43   </refsect1>
45   <refsect1>
46     <title>GENERAL OPTIONS</title>
48     <variablelist>
49       <varlistentry>
50         <term>-d, --debug=<parameter>DEBUGLEVEL</parameter></term>
51         <listitem>
52           <para>
53             This option sets the debug level to DEBUGLEVEL, which
54             controls what will be written by the logging
55             subsystem.  The default is 2.
56           </para>
57           <para>
58             See the <citetitle>DEBUG LEVELS</citetitle> section in
59             <citerefentry><refentrytitle>ctdb</refentrytitle>
60             <manvolnum>7</manvolnum></citerefentry> for more
61             information.
62           </para>
63         </listitem>
64       </varlistentry>
66       <varlistentry>
67         <term>--dbdir=<parameter>DIRECTORY</parameter></term>
68         <listitem>
69           <para>
70             DIRECTORY on local storage where ctdbd keeps a local copy of
71             TDB databases.  This directory is local for each node and
72             should not be stored on the shared cluster filesystem.
73           </para>
74           <para>
75             This directory would usually be <filename>/var/lib/ctdb</filename>
76           </para>
77         </listitem>
78       </varlistentry>
80       <varlistentry>
81         <term>--dbdir-persistent=<parameter>DIRECTORY</parameter></term>
82         <listitem>
83           <para>
84             DIRECTORY on local storage where ctdbd keeps a local copy of
85             persistent TDB databases.  This directory is local for each
86             node and should not be stored on the shared cluster
87             filesystem.
88           </para>
89           <para>
90             This directory would usually be
91             <filename>/var/lib/ctdb/persistent</filename>
92           </para>
93         </listitem>
94       </varlistentry>
96       <varlistentry>
97         <term>--dbdir-state=<parameter>DIRECTORY</parameter></term>
98         <listitem>
99           <para>
100             DIRECTORY on local storage where ctdbd keep internal state
101             TDB files.  This directory is local for each node and
102             should not be stored on the shared cluster filesystem.
103           </para>
104           <para>
105             This directory would usually be
106             <filename>/var/lib/ctdb/state</filename>
107           </para>
108         </listitem>
109       </varlistentry>
111       <varlistentry>
112         <term>--event-script-dir=<parameter>DIRECTORY</parameter></term>
113         <listitem>
114           <para>
115             DIRECTORY where the CTDB event scripts are stored.  See the
116             <citetitle>EVENT SCRIPTS</citetitle> section in
117             <citerefentry><refentrytitle>ctdb</refentrytitle>
118             <manvolnum>7</manvolnum></citerefentry> for more information.
119           </para>
120           <para>
121             Default is <envar>CTDB_BASE</envar>/events.d, so usually
122             <filename>/etc/ctdb/events.d</filename>, which is part of
123             the CTDB installation.
124           </para>
125         </listitem>
126       </varlistentry>
128       <varlistentry>
129         <term>--listen=<parameter>IPADDR</parameter></term>
130         <listitem>
131           <para>
132             IPADDR is the private IP address that ctdbd will bind to.
133           </para>
134           <para>
135             By default ctdbd will select the first address from the
136             nodes list that in can bind to.  See also
137             <citetitle>--nlist</citetitle>.
138           </para>
139           <para>
140             This option is only required when automatic address
141             detection can not be used.  This can be the case when
142             running multiple ctdbd daemons/nodes on the same physical
143             host (usually for testing), using InfiniBand for the
144             private network or on Linux when sysctl
145             net.ipv4.ip_nonlocal_bind=1.
146           </para>
147         </listitem>
148       </varlistentry>
150       <varlistentry>
151         <term>--logging=<parameter>STRING</parameter></term>
152         <listitem>
153           <para>
154             STRING specifies where ctdbd will write its log. The
155             default is file:<filename>/var/log/log.ctdb</filename> or
156             similar - the prefix may differ depending on how CTDB was
157             built.
158           </para>
159           <para>
160             Valid values are:
161           </para>
162           <variablelist>
163             <varlistentry>
164               <term>file:<parameter>FILENAME</parameter></term>
165               <listitem>
166                 <para>
167                   FILENAME where ctdbd will write its log. This is usually
168                   <filename>/var/log/log.ctdb</filename>.
169                 </para>
170               </listitem>
171             </varlistentry>
172             <varlistentry>
173               <term>syslog<optional>:<parameter>METHOD</parameter></optional></term>
174               <listitem>
175                 <para>
176                   CTDB will log to syslog.  By default this will use
177                   the syslog(3) API.
178                 </para>
179                 <para>
180                   Under heavy loads syslog(3) can block if the syslog
181                   daemon processes messages too slowly.  This can
182                   cause CTDB to block when logging.
183                 </para>
184                 <para>
185                   If METHOD is specified then it specifies an
186                   extension that causes logging to be done in a
187                   non-blocking mode.  Note that <emphasis>this may
188                   cause messages to be dropped</emphasis>.  METHOD
189                   must be one of:
190                 </para>
191                 <variablelist>
192                   <varlistentry>
193                     <term>nonblocking</term>
194                     <listitem>
195                       <para>
196                         CTDB will log to syslog via
197                         <filename>/dev/log</filename> in non-blocking
198                         mode.
199                       </para>
200                     </listitem>
201                   </varlistentry>
202                   <varlistentry>
203                     <term>udp</term>
204                     <listitem>
205                       <para>
206                         CTDB will log to syslog via UDP to
207                         localhost:514.  The syslog daemon must be
208                         configured to listen on (at least)
209                         localhost:514.  Most syslog daemons will log
210                         the messages with hostname "localhost" - this
211                         is a limitation of the implementation, for
212                         compatibility with more syslog daemons.
213                       </para>
214                     </listitem>
215                   </varlistentry>
216                   <varlistentry>
217                     <term>udp-rfc5424</term>
218                     <listitem>
219                       <para>
220                         As with "udp" but messages are sent in RFC5424
221                         format.  This method will log the correct
222                         hostname but is not as widely implemented in
223                         syslog daemons.
224                       </para>
225                     </listitem>
226                   </varlistentry>
227                 </variablelist>
228               </listitem>
229             </varlistentry>
230           </variablelist>
231         </listitem>
232       </varlistentry>
234       <varlistentry>
235         <term>--lvs</term>
236         <listitem>
237           <para>
238             This option is used to activate the LVS capability on a CTDB
239             node.  Please see the <citetitle>LVS</citetitle> section in
240             <citerefentry><refentrytitle>ctdb</refentrytitle>
241             <manvolnum>7</manvolnum></citerefentry> for more
242             information.
243           </para>
244         </listitem>
245       </varlistentry>
247       <varlistentry>
248         <term>--max-persistent-check-errors=<parameter>NUM</parameter></term>
249         <listitem>
250           <para>
251             NUM specifies the maximum number of health check failures
252             allowed for persistent databases during startup.
253           </para>
254           <para>
255             The default value is 0.  Setting this to non-zero allows a
256             node with unhealthy persistent databases to startup and
257             join the cluster as long as there is another node with
258             healthy persistent databases.
259           </para>
260         </listitem>
261       </varlistentry>
263       <varlistentry>
264         <term>--nlist=<parameter>FILENAME</parameter></term>
265         <listitem>
266           <para>
267             FILENAME containing a list of the private IP addresses, one
268             per line, for each node in the cluster.  This file
269             <emphasis>must be the same on each node</emphasis> in the
270             cluster.
271           </para>
272           <para>
273             Default is <envar>CTDB_BASE</envar>/nodes, so usually
274             <filename>/etc/ctdb/nodes</filename>.
275           </para>
276         </listitem>
277       </varlistentry>
279       <varlistentry>
280         <term>--no-lmaster</term>
281         <listitem>
282           <para>
283             This argument specifies that this node can NOT become an lmaster
284             for records in the database. This means that it will never show up
285             in the vnnmap. This feature is primarily used for making a cluster
286             span across a WAN link and use CTDB as a WAN-accelerator.
287           </para>
288           <para>
289             Please see the <citetitle>REMOTE CLUSTER NODES</citetitle>
290             section in <citerefentry><refentrytitle>ctdb</refentrytitle>
291             <manvolnum>7</manvolnum></citerefentry> for more
292             information.
293           </para>
294         </listitem>
295       </varlistentry>
297       <varlistentry>
298         <term>--no-recmaster</term>
299         <listitem>
300           <para>
301             This argument specifies that this node can NOT become a recmaster
302             for the database. This feature is primarily used for making a cluster
303             span across a WAN link and use CTDB as a WAN-accelerator.
304           </para>
305           <para>
306             Please see the <citetitle>REMOTE CLUSTER NODES</citetitle>
307             section in <citerefentry><refentrytitle>ctdb</refentrytitle>
308             <manvolnum>7</manvolnum></citerefentry> for more
309             information.
310           </para>
311         </listitem>
312       </varlistentry>
314       <varlistentry>
315         <term>--notification-script=<parameter>FILENAME</parameter></term>
316         <listitem>
317           <para>
318             FILENAME specifying a script to be invoked by ctdbd when
319             certain state changes occur.
320           </para>
321           <para>
322             This file is usually
323             <filename>/etc/ctdb/notify.sh</filename>.
324           </para>
325           <para>
326             Please see the <citetitle>NOTIFICATION SCRIPT</citetitle>
327             section in <citerefentry><refentrytitle>ctdb</refentrytitle>
328             <manvolnum>7</manvolnum></citerefentry> for more
329             information.
330           </para>
331         </listitem>
332       </varlistentry>
334       <varlistentry>
335         <term>--pidfile=<parameter>FILENAME</parameter></term>
336         <listitem>
337           <para>
338             FILENAME for file containing process ID of main CTDB
339             daemon.  This file is automatically created and removed by
340             CTDB.
341           </para>
342           <para>
343             The default is to not create a PID file.
344           </para>
345         </listitem>
346       </varlistentry>
348       <varlistentry>
349         <term>--public_addresses=<parameter>FILENAME</parameter></term>
350         <listitem>
351           <para>
352             FILENAME specifying a file containing the public IP
353             addresses to use on the cluster when CTDB should use IP
354             takeover. This file contains a list of IP addresses,
355             netmasks and interfaces.  CTDB will distribute these public
356             IP addresses appropriately across the available nodes.
357           </para>
358           <para>
359             The IP addresses specified in this file can differ across
360             nodes.
361           </para>
362           <para>
363             This is usually the file
364             <filename>/etc/ctdb/public_addresses</filename>
365           </para>
366         </listitem>
367       </varlistentry>
369       <varlistentry>
370         <term>--public-interface=<parameter>INTERFACE</parameter></term>
371         <listitem>
372           <para>
373             INTERFACE on which to attach public IP addresses or on which
374             to attach the single-public-ip when used.
375           </para>
376           <para>
377             When using public IP addresses, this is only required if
378             interfaces are not explicitly specified in the public
379             addresses file.
380           </para>
381         </listitem>
382       </varlistentry>
384       <varlistentry>
385         <term>--reclock=<parameter>FILE</parameter></term>
386         <listitem>
387           <para>
388             FILE is the name of the recovery lock file, stored in
389             <emphasis>shared storage</emphasis>, that CTDB uses to
390             prevent split brains.
391           </para>
392           <para>
393             For information about the recovery lock please see the
394             <citetitle>RECOVERY LOCK</citetitle> section in
395             <citerefentry><refentrytitle>ctdb</refentrytitle>
396             <manvolnum>7</manvolnum></citerefentry>.
397           </para>
398         </listitem>
399       </varlistentry>
401       <varlistentry>
402         <term>--single-public-ip=<parameter>IPADDR</parameter></term>
403         <listitem>
404           <para>
405             IPADDR specifies the single IP that CTDB will use in
406             conjuction with LVS.
407           </para>
408           <para>
409             Please see the <citetitle>LVS</citetitle> section in
410             <citerefentry><refentrytitle>ctdb</refentrytitle>
411             <manvolnum>7</manvolnum></citerefentry> for more
412             information.
413           </para>
414         </listitem>
415       </varlistentry>
417       <varlistentry>
418         <term>--start-as-disabled</term>
419         <listitem>
420           <para>
421             This makes ctdbd start in the DISABLED state.
422           </para>
423           <para>
424             To allow the node to host public IP addresses and
425             services, it must be manually enabled using the
426             <command>ctdb enable</command> command.
427           </para>
428           <para>
429             Please see the <citetitle>NODE STATES</citetitle> section
430             in <citerefentry><refentrytitle>ctdb</refentrytitle>
431             <manvolnum>7</manvolnum></citerefentry> for more
432             information about the DISABLED state.
433           </para>
434         </listitem>
435       </varlistentry>
437       <varlistentry>
438         <term>--start-as-stopped</term>
439         <listitem>
440           <para>
441             This makes ctdbd start in the STOPPED state.
442           </para>
443           <para>
444             To allow the node to take part in the cluster it must be
445             manually continued with the the <command>ctdb
446             enable</command> command.
447           </para>
448           <para>
449             Please see the <citetitle>NODE STATES</citetitle> section
450             in <citerefentry><refentrytitle>ctdb</refentrytitle>
451             <manvolnum>7</manvolnum></citerefentry> for more
452             information about the STOPPED state.
453           </para>
454         </listitem>
455       </varlistentry>
457       <varlistentry>
458         <term>--syslog</term>
459         <listitem>
460           <para>
461             Send log messages to syslog instead of the CTDB logfile.
462             This option overrides --logfile.  The default is to log to
463             a file.
464           </para>
465         </listitem>
466       </varlistentry>
468       <varlistentry>
469         <term>--transport=tcp|infiniband</term>
470         <listitem>
471           <para>
472             This option specifies which transport to use for ctdbd
473             internode communications. The default is "tcp".
474           </para>
475           <para>
476             The "infiniband" support is not regularly tested.
477           </para>
478         </listitem>
479       </varlistentry>
481       <varlistentry>
482         <term>-?, --help</term>
483         <listitem>
484           <para>
485             Display a summary of options.
486           </para>
487         </listitem>
488       </varlistentry>
490     </variablelist>
491   </refsect1>
493   <refsect1>
494     <title>DEBUGGING OPTIONS</title>
496     <variablelist>
498       <varlistentry>
499         <term>-i, --interactive</term>
500         <listitem>
501           <para>
502             Enable interactive mode.  This will make ctdbd run in the
503             foreground and not detach from the terminal.  By default
504             ctdbd will detach itself and run in the background as a
505             daemon.
506           </para>
507         </listitem>
508       </varlistentry>
510       <varlistentry>
511         <term>--nopublicipcheck</term>
512         <listitem>
513           <para>
514             This option is used when testing with multiple local
515             daemons on a single machine.  It disables checks related
516             to public IP addresses.
517           </para>
518         </listitem>
519       </varlistentry>
521       <varlistentry>
522         <term>--nosetsched</term>
523         <listitem>
524           <para>
525             This is a debugging option. This option is only used when
526             debugging ctdbd.
527           </para>
528           <para>
529             Normally ctdbd will change its scheduler to run as a
530             real-time process. This is the default mode for a normal
531             ctdbd operation to gurarantee that ctdbd always gets the CPU
532             cycles that it needs.
533           </para>
534           <para>
535             This option is used to tell ctdbd to
536             <emphasis>not</emphasis> run as a real-time process and
537             instead run ctdbd as a normal userspace process.  This is
538             useful for debugging and when you want to run ctdbd under
539             valgrind or gdb. (You don't want to attach valgrind or gdb
540             to a real-time process.)
541           </para>
542         </listitem>
543       </varlistentry>
545       <varlistentry>
546         <term>--socket=<parameter>FILENAME</parameter></term>
547         <listitem>
548           <para>
549             FILENAME specifies the name of the Unix domain socket that
550             ctdbd will create. This socket is used by local clients to
551             communicate with ctdbd.
552           </para>
553           <para>
554             The default is <filename>/tmp/ctdb.socket</filename> . You
555             only need to use this option if you plan to run multiple
556             ctdbd daemons on the same physical host, usually for
557             testing.
558           </para>
559         </listitem>
560       </varlistentry>
562       <varlistentry>
563         <term>--script-log-level=<parameter>DEBUGLEVEL</parameter></term>
564         <listitem>
565           <para>
566             This option sets the debug level of event script output to
567             DEBUGLEVEL.  The default is ERR (0).
568           </para>
569           <para>
570             See the <citetitle>DEBUG LEVELS</citetitle> section in
571             <citerefentry><refentrytitle>ctdb</refentrytitle>
572             <manvolnum>7</manvolnum></citerefentry> for more
573             information.
574           </para>
575         </listitem>
576       </varlistentry>
578       <varlistentry>
579         <term>--sloppy-start</term>
580         <listitem>
581           <para>
582             This is debugging option.  This speeds up the initial
583             recovery during startup at the expense of some consistency
584             checking.  <emphasis>Don't use this option in
585             production</emphasis>.
586           </para>
587         </listitem>
588       </varlistentry>
590       <varlistentry>
591         <term>--torture</term>
592         <listitem>
593           <para>
594             This option is only used for development and testing of
595             CTDB.  It adds artificial errors and failures to the
596             common codepaths in ctdbd to verify that ctdbd can recover
597             correctly from failures.
598           </para>
599           <para>
600             <emphasis>Do not use this option</emphasis> unless you are
601             developing and testing new functionality in CTDB.
602           </para>
603         </listitem>
604       </varlistentry>
606       <varlistentry>
607         <term>--valgrinding</term>
608         <listitem>
609           <para>
610             This is a debugging option. This option is only used when
611             debugging ctdbd.  This enables additional debugging
612             capabilities and implies --nosetsched.
613           </para>
614         </listitem>
615       </varlistentry>
617     </variablelist>
618   </refsect1>
620   <refsect1>
621     <title>SEE ALSO</title>
622     <para>
623       <citerefentry><refentrytitle>ctdb</refentrytitle>
624       <manvolnum>1</manvolnum></citerefentry>,
626       <citerefentry><refentrytitle>ctdbd_wrapper</refentrytitle>
627       <manvolnum>1</manvolnum></citerefentry>,
629       <citerefentry><refentrytitle>onnode</refentrytitle>
630       <manvolnum>1</manvolnum></citerefentry>,
632       <citerefentry><refentrytitle>ctdb</refentrytitle>
633       <manvolnum>7</manvolnum></citerefentry>,
635       <citerefentry><refentrytitle>ctdb-tunables</refentrytitle>
636       <manvolnum>7</manvolnum></citerefentry>,
638       <ulink url="http://ctdb.samba.org/"/>
639     </para>
640   </refsect1>
642   <refentryinfo>
643     <author>
644       <contrib>
645         This documentation was written by
646         Ronnie Sahlberg,
647         Amitay Isaacs,
648         Martin Schwenke
649       </contrib>
650     </author>
652     <copyright>
653       <year>2007</year>
654       <holder>Andrew Tridgell</holder>
655       <holder>Ronnie Sahlberg</holder>
656     </copyright>
657     <legalnotice>
658       <para>
659         This program is free software; you can redistribute it and/or
660         modify it under the terms of the GNU General Public License as
661         published by the Free Software Foundation; either version 3 of
662         the License, or (at your option) any later version.
663       </para>
664       <para>
665         This program is distributed in the hope that it will be
666         useful, but WITHOUT ANY WARRANTY; without even the implied
667         warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
668         PURPOSE.  See the GNU General Public License for more details.
669       </para>
670       <para>
671         You should have received a copy of the GNU General Public
672         License along with this program; if not, see
673         <ulink url="http://www.gnu.org/licenses"/>.
674       </para>
675     </legalnotice>
676   </refentryinfo>
678 </refentry>