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