doc: regenerate docs
[metze/ctdb/wip.git] / doc / ctdb.1
1 '\" t
2 .\"     Title: ctdb
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5 .\"      Date: 09/14/2010
6 .\"    Manual: CTDB - clustered TDB database
7 .\"    Source: ctdb
8 .\"  Language: English
9 .\"
10 .TH "CTDB" "1" "09/14/2010" "ctdb" "CTDB \- clustered TDB database"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ctdb \- clustered tdb database management utility
32 .SH "SYNOPSIS"
33 .HP \w'\fBctdb\ [\ OPTIONS\ ]\ COMMAND\ \&.\&.\&.\fR\ 'u
34 \fBctdb [ OPTIONS ] COMMAND \&.\&.\&.\fR
35 .HP \w'\fBctdb\fR\ 'u
36 \fBctdb\fR [\-n\ <node>] [\-Y] [\-t\ <timeout>] [\-T\ <timelimit>] [\-?\ \-\-help] [\-\-usage] [\-d\ \-\-debug=<INTEGER>] [\-\-socket=<filename>]
37 .SH "DESCRIPTION"
38 .PP
39 ctdb is a utility to view and manage a ctdb cluster\&.
40 .SH "OPTIONS"
41 .PP
42 \-n <pnn>
43 .RS 4
44 This specifies the physical node number on which to execute the command\&. Default is to run the command on the daemon running on the local host\&.
45 .sp
46 The physical node number is an integer that describes the node in the cluster\&. The first node has physical node number 0\&.
47 .RE
48 .PP
49 \-Y
50 .RS 4
51 Produce output in machine readable form for easier parsing by scripts\&. Not all commands support this option\&.
52 .RE
53 .PP
54 \-t <timeout>
55 .RS 4
56 How long should ctdb wait for the local ctdb daemon to respond to a command before timing out\&. Default is 3 seconds\&.
57 .RE
58 .PP
59 \-T <timelimit>
60 .RS 4
61 A limit on how long the ctdb command will run for before it will be aborted\&. When this timelimit has been exceeded the ctdb command will terminate\&.
62 .RE
63 .PP
64 \-? \-\-help
65 .RS 4
66 Print some help text to the screen\&.
67 .RE
68 .PP
69 \-\-usage
70 .RS 4
71 Print useage information to the screen\&.
72 .RE
73 .PP
74 \-d \-\-debug=<debuglevel>
75 .RS 4
76 Change the debug level for the command\&. Default is 0\&.
77 .RE
78 .PP
79 \-\-socket=<filename>
80 .RS 4
81 Specify the socketname to use when connecting to the local ctdb daemon\&. The default is /tmp/ctdb\&.socket \&.
82 .sp
83 You only need to specify this parameter if you run multiple ctdb daemons on the same physical host and thus can not use the default name for the domain socket\&.
84 .RE
85 .SH "ADMINISTRATIVE COMMANDS"
86 .PP
87 These are commands used to monitor and administrate a CTDB cluster\&.
88 .SS "pnn"
89 .PP
90 This command displays the pnn of the current node\&.
91 .SS "status"
92 .PP
93 This command shows the current status of the ctdb node\&.
94 .sp
95 .it 1 an-trap
96 .nr an-no-space-flag 1
97 .nr an-break-flag 1
98 .br
99 .ps +1
100 \fBnode status\fR
101 .RS 4
102 .PP
103 Node status reflects the current status of the node\&. There are five possible states:
104 .PP
105 OK \- This node is fully functional\&.
106 .PP
107 DISCONNECTED \- This node could not be connected through the network and is currently not participating in the cluster\&. If there is a public IP address associated with this node it should have been taken over by a different node\&. No services are running on this node\&.
108 .PP
109 DISABLED \- This node has been administratively disabled\&. This node is still functional and participates in the CTDB cluster but its IP addresses have been taken over by a different node and no services are currently being hosted\&.
110 .PP
111 UNHEALTHY \- A service provided by this node is malfunctioning and should be investigated\&. The CTDB daemon itself is operational and participates in the cluster\&. Its public IP address has been taken over by a different node and no services are currnetly being hosted\&. All unhealthy nodes should be investigated and require an administrative action to rectify\&.
112 .PP
113 BANNED \- This node failed too many recovery attempts and has been banned from participating in the cluster for a period of RecoveryBanPeriod seconds\&. Any public IP address has been taken over by other nodes\&. This node does not provide any services\&. All banned nodes should be investigated and require an administrative action to rectify\&. This node does not perticipate in the CTDB cluster but can still be communicated with\&. I\&.e\&. ctdb commands can be sent to it\&.
114 .PP
115 STOPPED \- A node that is stopped does not host any public ip addresses, nor is it part of the VNNMAP\&. A stopped node can not become LVSMASTER, RECMASTER or NATGW\&. This node does not perticipate in the CTDB cluster but can still be communicated with\&. I\&.e\&. ctdb commands can be sent to it\&.
116 .PP
117 PARTIALLYONLINE \- A node that is partially online participates in a cluster like a node that is ok\&. Some interfaces to serve public ip addresses are down, but at least one interface is up\&. See also "ctdb ifaces"\&.
118 .RE
119 .sp
120 .it 1 an-trap
121 .nr an-no-space-flag 1
122 .nr an-break-flag 1
123 .br
124 .ps +1
125 \fBgeneration\fR
126 .RS 4
127 .PP
128 The generation id is a number that indicates the current generation of a cluster instance\&. Each time a cluster goes through a reconfiguration or a recovery its generation id will be changed\&.
129 .PP
130 This number does not have any particular meaning other than to keep track of when a cluster has gone through a recovery\&. It is a random number that represents the current instance of a ctdb cluster and its databases\&. CTDBD uses this number internally to be able to tell when commands to operate on the cluster and the databases was issued in a different generation of the cluster, to ensure that commands that operate on the databases will not survive across a cluster database recovery\&. After a recovery, all old outstanding commands will automatically become invalid\&.
131 .PP
132 Sometimes this number will be shown as "INVALID"\&. This only means that the ctdbd daemon has started but it has not yet merged with the cluster through a recovery\&. All nodes start with generation "INVALID" and are not assigned a real generation id until they have successfully been merged with a cluster through a recovery\&.
133 .RE
134 .sp
135 .it 1 an-trap
136 .nr an-no-space-flag 1
137 .nr an-break-flag 1
138 .br
139 .ps +1
140 \fBVNNMAP\fR
141 .RS 4
142 .PP
143 The list of Virtual Node Numbers\&. This is a list of all nodes that actively participates in the cluster and that share the workload of hosting the Clustered TDB database records\&. Only nodes that are participating in the vnnmap can become lmaster or dmaster for a database record\&.
144 .RE
145 .sp
146 .it 1 an-trap
147 .nr an-no-space-flag 1
148 .nr an-break-flag 1
149 .br
150 .ps +1
151 \fBRecovery mode\fR
152 .RS 4
153 .PP
154 This is the current recovery mode of the cluster\&. There are two possible modes:
155 .PP
156 NORMAL \- The cluster is fully operational\&.
157 .PP
158 RECOVERY \- The cluster databases have all been frozen, pausing all services while the cluster awaits a recovery process to complete\&. A recovery process should finish within seconds\&. If a cluster is stuck in the RECOVERY state this would indicate a cluster malfunction which needs to be investigated\&.
159 .PP
160 Once the recovery master detects an inconsistency, for example a node becomes disconnected/connected, the recovery daemon will trigger a cluster recovery process, where all databases are remerged across the cluster\&. When this process starts, the recovery master will first "freeze" all databases to prevent applications such as samba from accessing the databases and it will also mark the recovery mode as RECOVERY\&.
161 .PP
162 When CTDBD starts up, it will start in RECOVERY mode\&. Once the node has been merged into a cluster and all databases have been recovered, the node mode will change into NORMAL mode and the databases will be "thawed", allowing samba to access the databases again\&.
163 .RE
164 .sp
165 .it 1 an-trap
166 .nr an-no-space-flag 1
167 .nr an-break-flag 1
168 .br
169 .ps +1
170 \fBRecovery master\fR
171 .RS 4
172 .PP
173 This is the cluster node that is currently designated as the recovery master\&. This node is responsible of monitoring the consistency of the cluster and to perform the actual recovery process when reqired\&.
174 .PP
175 Only one node at a time can be the designated recovery master\&. Which node is designated the recovery master is decided by an election process in the recovery daemons running on each node\&.
176 .RE
177 .PP
178 Example: ctdb status
179 .PP
180 Example output:
181 .sp
182 .if n \{\
183 .RS 4
184 .\}
185 .nf
186 Number of nodes:4
187 pnn:0 11\&.1\&.2\&.200       OK (THIS NODE)
188 pnn:1 11\&.1\&.2\&.201       OK
189 pnn:2 11\&.1\&.2\&.202       OK
190 pnn:3 11\&.1\&.2\&.203       OK
191 Generation:1362079228
192 Size:4
193 hash:0 lmaster:0
194 hash:1 lmaster:1
195 hash:2 lmaster:2
196 hash:3 lmaster:3
197 Recovery mode:NORMAL (0)
198 Recovery master:0
199       
200 .fi
201 .if n \{\
202 .RE
203 .\}
204 .SS "recmaster"
205 .PP
206 This command shows the pnn of the node which is currently the recmaster\&.
207 .SS "uptime"
208 .PP
209 This command shows the uptime for the ctdb daemon\&. When the last recovery or ip\-failover completed and how long it took\&. If the "duration" is shown as a negative number, this indicates that there is a recovery/failover in progress and it started that many seconds ago\&.
210 .PP
211 Example: ctdb uptime
212 .PP
213 Example output:
214 .sp
215 .if n \{\
216 .RS 4
217 .\}
218 .nf
219 Current time of node          :                Thu Oct 29 10:38:54 2009
220 Ctdbd start time              : (000 16:54:28) Wed Oct 28 17:44:26 2009
221 Time of last recovery/failover: (000 16:53:31) Wed Oct 28 17:45:23 2009
222 Duration of last recovery/failover: 2\&.248552 seconds
223       
224 .fi
225 .if n \{\
226 .RE
227 .\}
228 .SS "listnodes"
229 .PP
230 This command shows lists the ip addresses of all the nodes in the cluster\&.
231 .PP
232 Example: ctdb listnodes
233 .PP
234 Example output:
235 .sp
236 .if n \{\
237 .RS 4
238 .\}
239 .nf
240 10\&.0\&.0\&.71
241 10\&.0\&.0\&.72
242 10\&.0\&.0\&.73
243 10\&.0\&.0\&.74
244       
245 .fi
246 .if n \{\
247 .RE
248 .\}
249 .SS "ping"
250 .PP
251 This command will "ping" all CTDB daemons in the cluster to verify that they are processing commands correctly\&.
252 .PP
253 Example: ctdb ping
254 .PP
255 Example output:
256 .sp
257 .if n \{\
258 .RS 4
259 .\}
260 .nf
261 response from 0 time=0\&.000054 sec  (3 clients)
262 response from 1 time=0\&.000144 sec  (2 clients)
263 response from 2 time=0\&.000105 sec  (2 clients)
264 response from 3 time=0\&.000114 sec  (2 clients)
265       
266 .fi
267 .if n \{\
268 .RE
269 .\}
270 .SS "ifaces"
271 .PP
272 This command will display the list of network interfaces, which could host public addresses, along with their status\&.
273 .PP
274 Example: ctdb ifaces
275 .PP
276 Example output:
277 .sp
278 .if n \{\
279 .RS 4
280 .\}
281 .nf
282 Interfaces on node 0
283 name:eth5 link:up references:2
284 name:eth4 link:down references:0
285 name:eth3 link:up references:1
286 name:eth2 link:up references:1
287       
288 .fi
289 .if n \{\
290 .RE
291 .\}
292 .PP
293 Example: ctdb ifaces \-Y
294 .PP
295 Example output:
296 .sp
297 .if n \{\
298 .RS 4
299 .\}
300 .nf
301 :Name:LinkStatus:References:
302 :eth5:1:2
303 :eth4:0:0
304 :eth3:1:1
305 :eth2:1:1
306       
307 .fi
308 .if n \{\
309 .RE
310 .\}
311 .SS "setifacelink <iface> <status>"
312 .PP
313 This command will set the status of a network interface\&. The status needs to be "up" or "down"\&. This is typically used in the 10\&.interfaces script in the "monitor" event\&.
314 .PP
315 Example: ctdb setifacelink eth0 up
316 .SS "ip"
317 .PP
318 This command will display the list of public addresses that are provided by the cluster and which physical node is currently serving this ip\&. By default this command will ONLY show those public addresses that are known to the node itself\&. To see the full list of all public ips across the cluster you must use "ctdb ip \-n all"\&.
319 .PP
320 Example: ctdb ip
321 .PP
322 Example output:
323 .sp
324 .if n \{\
325 .RS 4
326 .\}
327 .nf
328 Public IPs on node 0
329 172\&.31\&.91\&.82 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
330 172\&.31\&.91\&.83 node[0] active[eth3] available[eth2,eth3] configured[eth2,eth3]
331 172\&.31\&.91\&.84 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
332 172\&.31\&.91\&.85 node[0] active[eth2] available[eth2,eth3] configured[eth2,eth3]
333 172\&.31\&.92\&.82 node[1] active[] available[eth5] configured[eth4,eth5]
334 172\&.31\&.92\&.83 node[0] active[eth5] available[eth5] configured[eth4,eth5]
335 172\&.31\&.92\&.84 node[1] active[] available[eth5] configured[eth4,eth5]
336 172\&.31\&.92\&.85 node[0] active[eth5] available[eth5] configured[eth4,eth5]
337       
338 .fi
339 .if n \{\
340 .RE
341 .\}
342 .PP
343 Example: ctdb ip \-Y
344 .PP
345 Example output:
346 .sp
347 .if n \{\
348 .RS 4
349 .\}
350 .nf
351 :Public IP:Node:ActiveInterface:AvailableInterfaces:ConfiguredInterfaces:
352 :172\&.31\&.91\&.82:1::eth2,eth3:eth2,eth3:
353 :172\&.31\&.91\&.83:0:eth3:eth2,eth3:eth2,eth3:
354 :172\&.31\&.91\&.84:1::eth2,eth3:eth2,eth3:
355 :172\&.31\&.91\&.85:0:eth2:eth2,eth3:eth2,eth3:
356 :172\&.31\&.92\&.82:1::eth5:eth4,eth5:
357 :172\&.31\&.92\&.83:0:eth5:eth5:eth4,eth5:
358 :172\&.31\&.92\&.84:1::eth5:eth4,eth5:
359 :172\&.31\&.92\&.85:0:eth5:eth5:eth4,eth5:
360       
361 .fi
362 .if n \{\
363 .RE
364 .\}
365 .SS "ipinfo <ip>"
366 .PP
367 This command will display details about the specified public addresses\&.
368 .PP
369 Example: ctdb ipinfo 172\&.31\&.92\&.85
370 .PP
371 Example output:
372 .sp
373 .if n \{\
374 .RS 4
375 .\}
376 .nf
377 Public IP[172\&.31\&.92\&.85] info on node 0
378 IP:172\&.31\&.92\&.85
379 CurrentNode:0
380 NumInterfaces:2
381 Interface[1]: Name:eth4 Link:down References:0
382 Interface[2]: Name:eth5 Link:up References:2 (active)
383       
384 .fi
385 .if n \{\
386 .RE
387 .\}
388 .SS "scriptstatus"
389 .PP
390 This command displays which scripts where run in the previous monitoring cycle and the result of each script\&. If a script failed with an error, causing the node to become unhealthy, the output from that script is also shown\&.
391 .PP
392 Example: ctdb scriptstatus
393 .PP
394 Example output:
395 .sp
396 .if n \{\
397 .RS 4
398 .\}
399 .nf
400 7 scripts were executed last monitoring cycle
401 00\&.ctdb              Status:OK    Duration:0\&.056 Tue Mar 24 18:56:57 2009
402 10\&.interface         Status:OK    Duration:0\&.077 Tue Mar 24 18:56:57 2009
403 11\&.natgw             Status:OK    Duration:0\&.039 Tue Mar 24 18:56:57 2009
404 20\&.multipathd        Status:OK    Duration:0\&.038 Tue Mar 24 18:56:57 2009
405 31\&.clamd             Status:DISABLED
406 40\&.vsftpd            Status:OK    Duration:0\&.045 Tue Mar 24 18:56:57 2009
407 41\&.httpd             Status:OK    Duration:0\&.039 Tue Mar 24 18:56:57 2009
408 50\&.samba             Status:ERROR    Duration:0\&.082 Tue Mar 24 18:56:57 2009
409    OUTPUT:ERROR: Samba tcp port 445 is not responding
410       
411 .fi
412 .if n \{\
413 .RE
414 .\}
415 .SS "disablescript <script>"
416 .PP
417 This command is used to disable an eventscript\&.
418 .PP
419 This will take effect the next time the eventscripts are being executed so it can take a short while until this is reflected in \*(Aqscriptstatus\*(Aq\&.
420 .SS "enablescript <script>"
421 .PP
422 This command is used to enable an eventscript\&.
423 .PP
424 This will take effect the next time the eventscripts are being executed so it can take a short while until this is reflected in \*(Aqscriptstatus\*(Aq\&.
425 .SS "getvar <name>"
426 .PP
427 Get the runtime value of a tuneable variable\&.
428 .PP
429 Example: ctdb getvar MaxRedirectCount
430 .PP
431 Example output:
432 .sp
433 .if n \{\
434 .RS 4
435 .\}
436 .nf
437 MaxRedirectCount    = 3
438       
439 .fi
440 .if n \{\
441 .RE
442 .\}
443 .SS "setvar <name> <value>"
444 .PP
445 Set the runtime value of a tuneable variable\&.
446 .PP
447 Example: ctdb setvar MaxRedirectCount 5
448 .SS "listvars"
449 .PP
450 List all tuneable variables\&.
451 .PP
452 Example: ctdb listvars
453 .PP
454 Example output:
455 .sp
456 .if n \{\
457 .RS 4
458 .\}
459 .nf
460 MaxRedirectCount    = 3
461 SeqnumInterval      = 1000
462 ControlTimeout      = 60
463 TraverseTimeout     = 20
464 KeepaliveInterval   = 5
465 KeepaliveLimit      = 5
466 MaxLACount          = 7
467 RecoverTimeout      = 20
468 RecoverInterval     = 1
469 ElectionTimeout     = 3
470 TakeoverTimeout     = 5
471 MonitorInterval     = 15
472 TickleUpdateInterval = 20
473 EventScriptTimeout  = 30
474 EventScriptBanCount = 10
475 EventScriptUnhealthyOnTimeout = 0
476 RecoveryGracePeriod = 120
477 RecoveryBanPeriod   = 300
478 DatabaseHashSize    = 10000
479 DatabaseMaxDead     = 5
480 RerecoveryTimeout   = 10
481 EnableBans          = 1
482 DeterministicIPs    = 1
483 DisableWhenUnhealthy = 0
484 ReclockPingPeriod   = 60
485 NoIPFailback        = 0
486 VerboseMemoryNames  = 0
487 RecdPingTimeout     = 60
488 RecdFailCount       = 10
489 LogLatencyMs        = 0
490 RecLockLatencyMs    = 1000
491 RecoveryDropAllIPs  = 60
492 VerifyRecoveryLock  = 1
493 VacuumDefaultInterval = 300
494 VacuumMaxRunTime    = 30
495 RepackLimit         = 10000
496 VacuumLimit         = 5000
497 VacuumMinInterval   = 60
498 VacuumMaxInterval   = 600
499 MaxQueueDropMsg     = 1000
500 UseStatusEvents     = 0
501 AllowUnhealthyDBRead = 0
502       
503 .fi
504 .if n \{\
505 .RE
506 .\}
507 .SS "lvsmaster"
508 .PP
509 This command shows which node is currently the LVSMASTER\&. The LVSMASTER is the node in the cluster which drives the LVS system and which receives all incoming traffic from clients\&.
510 .PP
511 LVS is the mode where the entire CTDB/Samba cluster uses a single ip address for the entire cluster\&. In this mode all clients connect to one specific node which will then multiplex/loadbalance the clients evenly onto the other nodes in the cluster\&. This is an alternative to using public ip addresses\&. See the manpage for ctdbd for more information about LVS\&.
512 .SS "lvs"
513 .PP
514 This command shows which nodes in the cluster are currently active in the LVS configuration\&. I\&.e\&. which nodes we are currently loadbalancing the single ip address across\&.
515 .PP
516 LVS will by default only loadbalance across those nodes that are both LVS capable and also HEALTHY\&. Except if all nodes are UNHEALTHY in which case LVS will loadbalance across all UNHEALTHY nodes as well\&. LVS will never use nodes that are DISCONNECTED, STOPPED, BANNED or DISABLED\&.
517 .PP
518 Example output:
519 .sp
520 .if n \{\
521 .RS 4
522 .\}
523 .nf
524 2:10\&.0\&.0\&.13
525 3:10\&.0\&.0\&.14
526       
527 .fi
528 .if n \{\
529 .RE
530 .\}
531 .SS "getcapabilities"
532 .PP
533 This command shows the capabilities of the current node\&. Please see manpage for ctdbd for a full list of all capabilities and more detailed description\&.
534 .PP
535 RECMASTER and LMASTER capabilities are primarily used when CTDBD is used to create a cluster spanning across WAN links\&. In which case ctdbd acts as a WAN accelerator\&.
536 .PP
537 LVS capabile means that the node is participating in LVS, a mode where the entire CTDB cluster uses one single ip address for the entire cluster instead of using public ip address failover\&. This is an alternative to using a loadbalancing layer\-4 switch\&.
538 .PP
539 Example output:
540 .sp
541 .if n \{\
542 .RS 4
543 .\}
544 .nf
545 RECMASTER: YES
546 LMASTER: YES
547 LVS: NO
548       
549 .fi
550 .if n \{\
551 .RE
552 .\}
553 .SS "statistics"
554 .PP
555 Collect statistics from the CTDB daemon about how many calls it has served\&.
556 .PP
557 Example: ctdb statistics
558 .PP
559 Example output:
560 .sp
561 .if n \{\
562 .RS 4
563 .\}
564 .nf
565 CTDB version 1
566  num_clients                        3
567  frozen                             0
568  recovering                         0
569  client_packets_sent           360489
570  client_packets_recv           360466
571  node_packets_sent             480931
572  node_packets_recv             240120
573  keepalive_packets_sent             4
574  keepalive_packets_recv             3
575  node
576      req_call                       2
577      reply_call                     2
578      req_dmaster                    0
579      reply_dmaster                  0
580      reply_error                    0
581      req_message                   42
582      req_control               120408
583      reply_control             360439
584  client
585      req_call                       2
586      req_message                   24
587      req_control               360440
588  timeouts
589      call                           0
590      control                        0
591      traverse                       0
592  total_calls                        2
593  pending_calls                      0
594  lockwait_calls                     0
595  pending_lockwait_calls             0
596  memory_used                     5040
597  max_hop_count                      0
598  max_call_latency                   4\&.948321 sec
599  max_lockwait_latency               0\&.000000 sec
600       
601 .fi
602 .if n \{\
603 .RE
604 .\}
605 .SS "statisticsreset"
606 .PP
607 This command is used to clear all statistics counters in a node\&.
608 .PP
609 Example: ctdb statisticsreset
610 .SS "getreclock"
611 .PP
612 This command is used to show the filename of the reclock file that is used\&.
613 .PP
614 Example output:
615 .sp
616 .if n \{\
617 .RS 4
618 .\}
619 .nf
620 Reclock file:/gpfs/\&.ctdb/shared
621       
622 .fi
623 .if n \{\
624 .RE
625 .\}
626 .SS "setreclock [filename]"
627 .PP
628 This command is used to modify, or clear, the file that is used as the reclock file at runtime\&. When this command is used, the reclock file checks are disabled\&. To re\-enable the checks the administrator needs to activate the "VerifyRecoveryLock" tunable using "ctdb setvar"\&.
629 .PP
630 If run with no parameter this will remove the reclock file completely\&. If run with a parameter the parameter specifies the new filename to use for the recovery lock\&.
631 .PP
632 This command only affects the runtime settings of a ctdb node and will be lost when ctdb is restarted\&. For persistent changes to the reclock file setting you must edit /etc/sysconfig/ctdb\&.
633 .SS "getdebug"
634 .PP
635 Get the current debug level for the node\&. the debug level controls what information is written to the log file\&.
636 .PP
637 The debug levels are mapped to the corresponding syslog levels\&. When a debug level is set, only those messages at that level and higher levels will be printed\&.
638 .PP
639 The list of debug levels from highest to lowest are :
640 .PP
641 EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
642 .SS "setdebug <debuglevel>"
643 .PP
644 Set the debug level of a node\&. This controls what information will be logged\&.
645 .PP
646 The debuglevel is one of EMERG ALERT CRIT ERR WARNING NOTICE INFO DEBUG
647 .SS "getpid"
648 .PP
649 This command will return the process id of the ctdb daemon\&.
650 .SS "disable"
651 .PP
652 This command is used to administratively disable a node in the cluster\&. A disabled node will still participate in the cluster and host clustered TDB records but its public ip address has been taken over by a different node and it no longer hosts any services\&.
653 .SS "enable"
654 .PP
655 Re\-enable a node that has been administratively disabled\&.
656 .SS "stop"
657 .PP
658 This command is used to administratively STOP a node in the cluster\&. A STOPPED node is connected to the cluster but will not host any public ip addresse, nor does it participate in the VNNMAP\&. The difference between a DISABLED node and a STOPPED node is that a STOPPED node does not host any parts of the database which means that a recovery is required to stop/continue nodes\&.
659 .SS "continue"
660 .PP
661 Re\-start a node that has been administratively stopped\&.
662 .SS "addip <public_ip/mask> <iface>"
663 .PP
664 This command is used to add a new public ip to a node during runtime\&. This allows public addresses to be added to a cluster without having to restart the ctdb daemons\&.
665 .PP
666 Note that this only updates the runtime instance of ctdb\&. Any changes will be lost next time ctdb is restarted and the public addresses file is re\-read\&. If you want this change to be permanent you must also update the public addresses file manually\&.
667 .SS "delip <public_ip>"
668 .PP
669 This command is used to remove a public ip from a node during runtime\&. If this public ip is currently hosted by the node it being removed from, the ip will first be failed over to another node, if possible, before it is removed\&.
670 .PP
671 Note that this only updates the runtime instance of ctdb\&. Any changes will be lost next time ctdb is restarted and the public addresses file is re\-read\&. If you want this change to be permanent you must also update the public addresses file manually\&.
672 .SS "moveip <public_ip> <node>"
673 .PP
674 This command can be used to manually fail a public ip address to a specific node\&.
675 .PP
676 In order to manually override the "automatic" distribution of public ip addresses that ctdb normally provides, this command only works when you have changed the tunables for the daemon to:
677 .PP
678 DeterministicIPs = 0
679 .PP
680 NoIPFailback = 1
681 .SS "shutdown"
682 .PP
683 This command will shutdown a specific CTDB daemon\&.
684 .SS "recover"
685 .PP
686 This command will trigger the recovery daemon to do a cluster recovery\&.
687 .SS "ipreallocate"
688 .PP
689 This command will force the recovery master to perform a full ip reallocation process and redistribute all ip addresses\&. This is useful to "reset" the allocations back to its default state if they have been changed using the "moveip" command\&. While a "recover" will also perform this reallocation, a recovery is much more hevyweight since it will also rebuild all the databases\&.
690 .SS "setlmasterrole <on|off>"
691 .PP
692 This command is used ot enable/disable the LMASTER capability for a node at runtime\&. This capability determines whether or not a node can be used as an LMASTER for records in the database\&. A node that does not have the LMASTER capability will not show up in the vnnmap\&.
693 .PP
694 Nodes will by default have this capability, but it can be stripped off nodes by the setting in the sysconfig file or by using this command\&.
695 .PP
696 Once this setting has been enabled/disabled, you need to perform a recovery for it to take effect\&.
697 .PP
698 See also "ctdb getcapabilities"
699 .SS "setrecmasterrole <on|off>"
700 .PP
701 This command is used ot enable/disable the RECMASTER capability for a node at runtime\&. This capability determines whether or not a node can be used as an RECMASTER for the cluster\&. A node that does not have the RECMASTER capability can not win a recmaster election\&. A node that already is the recmaster for the cluster when the capability is stripped off the node will remain the recmaster until the next cluster election\&.
702 .PP
703 Nodes will by default have this capability, but it can be stripped off nodes by the setting in the sysconfig file or by using this command\&.
704 .PP
705 See also "ctdb getcapabilities"
706 .SS "killtcp <srcip:port> <dstip:port>"
707 .PP
708 This command will kill the specified TCP connection by issuing a TCP RST to the srcip:port endpoint\&. This is a command used by the ctdb eventscripts\&.
709 .SS "gratiousarp <ip> <interface>"
710 .PP
711 This command will send out a gratious arp for the specified interface through the specified interface\&. This command is mainly used by the ctdb eventscripts\&.
712 .SS "reloadnodes"
713 .PP
714 This command is used when adding new nodes, or removing existing nodes from an existing cluster\&.
715 .PP
716 Procedure to add a node:
717 .PP
718 1, To expand an existing cluster, first ensure with \*(Aqctdb status\*(Aq that all nodes are up and running and that they are all healthy\&. Do not try to expand a cluster unless it is completely healthy!
719 .PP
720 2, On all nodes, edit /etc/ctdb/nodes and add the new node as the last entry to the file\&. The new node MUST be added to the end of this file!
721 .PP
722 3, Verify that all the nodes have identical /etc/ctdb/nodes files after you edited them and added the new node!
723 .PP
724 4, Run \*(Aqctdb reloadnodes\*(Aq to force all nodes to reload the nodesfile\&.
725 .PP
726 5, Use \*(Aqctdb status\*(Aq on all nodes and verify that they now show the additional node\&.
727 .PP
728 6, Install and configure the new node and bring it online\&.
729 .PP
730 Procedure to remove a node:
731 .PP
732 1, To remove a node from an existing cluster, first ensure with \*(Aqctdb status\*(Aq that all nodes, except the node to be deleted, are up and running and that they are all healthy\&. Do not try to remove a node from a cluster unless the cluster is completely healthy!
733 .PP
734 2, Shutdown and poerwoff the node to be removed\&.
735 .PP
736 3, On all other nodes, edit the /etc/ctdb/nodes file and comment out the node to be removed\&. Do not delete the line for that node, just comment it out by adding a \*(Aq#\*(Aq at the beginning of the line\&.
737 .PP
738 4, Run \*(Aqctdb reloadnodes\*(Aq to force all nodes to reload the nodesfile\&.
739 .PP
740 5, Use \*(Aqctdb status\*(Aq on all nodes and verify that the deleted node no longer shows up in the list\&.\&.
741 .PP
742 .SS "tickle <srcip:port> <dstip:port>"
743 .PP
744 This command will will send a TCP tickle to the source host for the specified TCP connection\&. A TCP tickle is a TCP ACK packet with an invalid sequence and acknowledge number and will when received by the source host result in it sending an immediate correct ACK back to the other end\&.
745 .PP
746 TCP tickles are useful to "tickle" clients after a IP failover has occured since this will make the client immediately recognize the TCP connection has been disrupted and that the client will need to reestablish\&. This greatly speeds up the time it takes for a client to detect and reestablish after an IP failover in the ctdb cluster\&.
747 .SS "gettickles <ip>"
748 .PP
749 This command is used to show which TCP connections are registered with CTDB to be "tickled" if there is a failover\&.
750 .SS "repack [max_freelist]"
751 .PP
752 Over time, when records are created and deleted in a TDB, the TDB list of free space will become fragmented\&. This can lead to a slowdown in accessing TDB records\&. This command is used to defragment a TDB database and pruning the freelist\&.
753 .PP
754 If [max_freelist] is specified, then a database will only be repacked if it has more than this number of entries in the freelist\&.
755 .PP
756 During repacking of the database, the entire TDB database will be locked to prevent writes\&. If samba tries to write to a record in the database during a repack operation, samba will block until the repacking has completed\&.
757 .PP
758 This command can be disruptive and can cause samba to block for the duration of the repack operation\&. In general, a repack operation will take less than one second to complete\&.
759 .PP
760 A repack operation will only defragment the local TDB copy of the CTDB database\&. You need to run this command on all of the nodes to repack a CTDB database completely\&.
761 .PP
762 Example: ctdb repack 1000
763 .PP
764 By default, this operation is issued from the 00\&.ctdb event script every 5 minutes\&.
765 .SS "vacuum [max_records]"
766 .PP
767 Over time CTDB databases will fill up with empty deleted records which will lead to a progressive slow down of CTDB database access\&. This command is used to prune all databases and delete all empty records from the cluster\&.
768 .PP
769 By default, vacuum will delete all empty records from all databases\&. If [max_records] is specified, the command will only delete the first [max_records] empty records for each database\&.
770 .PP
771 Vacuum only deletes records where the local node is the lmaster\&. To delete all records from the entire cluster you need to run a vacuum from each node\&. This command is not disruptive\&. Samba is unaffected and will still be able to read/write records normally while the database is being vacuumed\&.
772 .PP
773 Example: ctdb vacuum
774 .PP
775 By default, this operation is issued from the 00\&.ctdb event script every 5 minutes\&.
776 .SS "backupdb <dbname> <file>"
777 .PP
778 This command can be used to copy the entire content of a database out to a file\&. This file can later be read back into ctdb using the restoredb command\&. This is mainly useful for backing up persistent databases such as secrets\&.tdb and similar\&.
779 .SS "restoredb <file> [<dbname>]"
780 .PP
781 This command restores a persistent database that was previously backed up using backupdb\&. By default the data will be restored back into the same database as it was created from\&. By specifying dbname you can restore the data into a different database\&.
782 .SS "wipedb <dbname>"
783 .PP
784 This command can be used to remove all content of a database\&.
785 .SS "getlog <level>"
786 .PP
787 In addition to the normal loggign to a log file, CTDBD also keeps a in\-memory ringbuffer containing the most recent log entries for all log levels (except DEBUG)\&.
788 .PP
789 This is useful since it allows for keeping continous logs to a file at a reasonable non\-verbose level, but shortly after an incident has occured, a much more detailed log can be pulled from memory\&. This can allow you to avoid having to reproduce an issue due to the on\-disk logs being of insufficient detail\&.
790 .PP
791 This command extracts all messages of level or lower log level from memory and prints it to the screen\&.
792 .SS "clearlog"
793 .PP
794 This command clears the in\-memory logging ringbuffer\&.
795 .SH "DEBUGGING COMMANDS"
796 .PP
797 These commands are primarily used for CTDB development and testing and should not be used for normal administration\&.
798 .SS "process\-exists <pid>"
799 .PP
800 This command checks if a specific process exists on the CTDB host\&. This is mainly used by Samba to check if remote instances of samba are still running or not\&.
801 .SS "getdbmap"
802 .PP
803 This command lists all clustered TDB databases that the CTDB daemon has attached to\&. Some databases are flagged as PERSISTENT, this means that the database stores data persistently and the data will remain across reboots\&. One example of such a database is secrets\&.tdb where information about how the cluster was joined to the domain is stored\&.
804 .PP
805 If a PERSISTENT database is not in a healthy state the database is flagged as UNHEALTHY\&. If there\*(Aqs at least one completely healthy node running in the cluster, it\*(Aqs possible that the content is restored by a recovery run automaticly\&. Otherwise an administrator needs to analyze the problem\&.
806 .PP
807 See also "ctdb getdbstatus", "ctdb backupdb", "ctdb restoredb", "ctdb dumpbackup", "ctdb wipedb", "ctdb setvar AllowUnhealthyDBRead 1" and (if samba or tdb\-utils are installed) "tdbtool check"\&.
808 .PP
809 Most databases are not persistent and only store the state information that the currently running samba daemons need\&. These databases are always wiped when ctdb/samba starts and when a node is rebooted\&.
810 .PP
811 Example: ctdb getdbmap
812 .PP
813 Example output:
814 .sp
815 .if n \{\
816 .RS 4
817 .\}
818 .nf
819 Number of databases:10
820 dbid:0x435d3410 name:notify\&.tdb path:/var/ctdb/notify\&.tdb\&.0 
821 dbid:0x42fe72c5 name:locking\&.tdb path:/var/ctdb/locking\&.tdb\&.0
822 dbid:0x1421fb78 name:brlock\&.tdb path:/var/ctdb/brlock\&.tdb\&.0 
823 dbid:0x17055d90 name:connections\&.tdb path:/var/ctdb/connections\&.tdb\&.0 
824 dbid:0xc0bdde6a name:sessionid\&.tdb path:/var/ctdb/sessionid\&.tdb\&.0 
825 dbid:0x122224da name:test\&.tdb path:/var/ctdb/test\&.tdb\&.0 
826 dbid:0x2672a57f name:idmap2\&.tdb path:/var/ctdb/persistent/idmap2\&.tdb\&.0 PERSISTENT
827 dbid:0xb775fff6 name:secrets\&.tdb path:/var/ctdb/persistent/secrets\&.tdb\&.0 PERSISTENT
828 dbid:0xe98e08b6 name:group_mapping\&.tdb path:/var/ctdb/persistent/group_mapping\&.tdb\&.0 PERSISTENT
829 dbid:0x7bbbd26c name:passdb\&.tdb path:/var/ctdb/persistent/passdb\&.tdb\&.0 PERSISTENT
830       
831 .fi
832 .if n \{\
833 .RE
834 .\}
835 .PP
836 Example output for an unhealthy database:
837 .sp
838 .if n \{\
839 .RS 4
840 .\}
841 .nf
842 Number of databases:1
843 dbid:0xb775fff6 name:secrets\&.tdb path:/var/ctdb/persistent/secrets\&.tdb\&.0 PERSISTENT UNHEALTHY
844       
845 .fi
846 .if n \{\
847 .RE
848 .\}
849 .PP
850 Example output for a healthy database as machinereadable output \-Y:
851 .sp
852 .if n \{\
853 .RS 4
854 .\}
855 .nf
856 :ID:Name:Path:Persistent:Unhealthy:
857 :0x7bbbd26c:passdb\&.tdb:/var/ctdb/persistent/passdb\&.tdb\&.0:1:0:
858       
859 .fi
860 .if n \{\
861 .RE
862 .\}
863 .SS "getdbstatus <dbname>"
864 .PP
865 This command displays more details about a database\&.
866 .PP
867 Example: ctdb getdbstatus test\&.tdb\&.0
868 .PP
869 Example output:
870 .sp
871 .if n \{\
872 .RS 4
873 .\}
874 .nf
875 dbid: 0x122224da
876 name: test\&.tdb
877 path: /var/ctdb/test\&.tdb\&.0
878 PERSISTENT: no
879 HEALTH: OK
880       
881 .fi
882 .if n \{\
883 .RE
884 .\}
885 .PP
886 Example: ctdb getdbstatus registry\&.tdb (with a corrupted TDB)
887 .PP
888 Example output:
889 .sp
890 .if n \{\
891 .RS 4
892 .\}
893 .nf
894 dbid: 0xf2a58948
895 name: registry\&.tdb
896 path: /var/ctdb/persistent/registry\&.tdb\&.0
897 PERSISTENT: yes
898 HEALTH: NO\-HEALTHY\-NODES \- ERROR \- Backup of corrupted TDB in \*(Aq/var/ctdb/persistent/registry\&.tdb\&.0\&.corrupted\&.20091208091949\&.0Z\*(Aq
899       
900 .fi
901 .if n \{\
902 .RE
903 .\}
904 .SS "catdb <dbname>"
905 .PP
906 This command will dump a clustered TDB database to the screen\&. This is a debugging command\&.
907 .SS "dumpdbbackup <backup\-file>"
908 .PP
909 This command will dump the content of database backup to the screen (similar to ctdb catdb)\&. This is a debugging command\&.
910 .SS "getmonmode"
911 .PP
912 This command returns the monutoring mode of a node\&. The monitoring mode is either ACTIVE or DISABLED\&. Normally a node will continously monitor that all other nodes that are expected are in fact connected and that they respond to commands\&.
913 .PP
914 ACTIVE \- This is the normal mode\&. The node is actively monitoring all other nodes, both that the transport is connected and also that the node responds to commands\&. If a node becomes unavailable, it will be marked as DISCONNECTED and a recovery is initiated to restore the cluster\&.
915 .PP
916 DISABLED \- This node is not monitoring that other nodes are available\&. In this mode a node failure will not be detected and no recovery will be performed\&. This mode is useful when for debugging purposes one wants to attach GDB to a ctdb process but wants to prevent the rest of the cluster from marking this node as DISCONNECTED and do a recovery\&.
917 .SS "setmonmode <0|1>"
918 .PP
919 This command can be used to explicitly disable/enable monitoring mode on a node\&. The main purpose is if one wants to attach GDB to a running ctdb daemon but wants to prevent the other nodes from marking it as DISCONNECTED and issuing a recovery\&. To do this, set monitoring mode to 0 on all nodes before attaching with GDB\&. Remember to set monitoring mode back to 1 afterwards\&.
920 .SS "attach <dbname> [persistent]"
921 .PP
922 This is a debugging command\&. This command will make the CTDB daemon create a new CTDB database and attach to it\&.
923 .SS "dumpmemory"
924 .PP
925 This is a debugging command\&. This command will make the ctdb daemon to write a fill memory allocation map to standard output\&.
926 .SS "rddumpmemory"
927 .PP
928 This is a debugging command\&. This command will dump the talloc memory allocation tree for the recovery daemon to standard output\&.
929 .SS "thaw"
930 .PP
931 Thaw a previously frozen node\&.
932 .SS "eventscript <arguments>"
933 .PP
934 This is a debugging command\&. This command can be used to manually invoke and run the eventscritps with arbitrary arguments\&.
935 .SS "ban <bantime|0>"
936 .PP
937 Administratively ban a node for bantime seconds\&. A bantime of 0 means that the node should be permanently banned\&.
938 .PP
939 A banned node does not participate in the cluster and does not host any records for the clustered TDB\&. Its ip address has been taken over by another node and no services are hosted\&.
940 .PP
941 Nodes are automatically banned if they are the cause of too many cluster recoveries\&.
942 .SS "unban"
943 .PP
944 This command is used to unban a node that has either been administratively banned using the ban command or has been automatically banned by the recovery daemon\&.
945 .SH "SEE ALSO"
946 .PP
947 ctdbd(1), onnode(1)
948 \m[blue]\fB\%http://ctdb.samba.org/\fR\m[]
949 .SH "COPYRIGHT/LICENSE"
950 .sp
951 .if n \{\
952 .RS 4
953 .\}
954 .nf
955 Copyright (C) Andrew Tridgell 2007
956 Copyright (C) Ronnie sahlberg 2007
957
958 This program is free software; you can redistribute it and/or modify
959 it under the terms of the GNU General Public License as published by
960 the Free Software Foundation; either version 3 of the License, or (at
961 your option) any later version\&.
962
963 This program is distributed in the hope that it will be useful, but
964 WITHOUT ANY WARRANTY; without even the implied warranty of
965 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\&.  See the GNU
966 General Public License for more details\&.
967
968 You should have received a copy of the GNU General Public License
969 along with this program; if not, see http://www\&.gnu\&.org/licenses/\&.
970 .fi
971 .if n \{\
972 .RE
973 .\}