source: vendor/current/ctdb/web/testing.html

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 3.1 KB
Line 
1<!--#set var="TITLE" value="CTDB Testing" -->
2<!--#include virtual="header.html" -->
3
4<H2 align="center">Starting and testing CTDB</h2>
5
6The CTDB log is in /var/log/log.ctdb so look in this file if something
7did not start correctly.<p>
8
9You can ensure that ctdb is running on all nodes using
10<pre>
11 onnode all service ctdb start
12</pre>
13Verify that the CTDB daemon started properly. There should normally be at least 2 processes started for CTDB, one for the main daemon and one for the recovery daemon.
14<pre>
15 onnode all pidof ctdbd
16</pre>
17
18Once all CTDB nodes have started, verify that they are correctly
19talking to each other.<p>
20
21There should be one TCP connection from the private ip address on each
22node to TCP port 4379 on each of the other nodes in the cluster.
23<pre>
24 onnode all netstat -tn | grep 4379
25</pre>
26
27
28<h2>Automatically restarting CTDB</h2>
29
30If you wish to cope with software faults in ctdb, or want ctdb to
31automatically restart when an administration kills it, then you may
32wish to add a cron entry for root like this:
33
34<pre>
35 * * * * * /etc/init.d/ctdb cron > /dev/null 2>&1
36</pre>
37
38
39<h2>Testing CTDB</h2>
40
41Once your cluster is up and running, you may wish to know how to test that it is functioning correctly. The following tests may help with that
42
43<h3>The ctdb tool</h3>
44
45The ctdb package comes with a utility called ctdb that can be used to
46view the behaviour of the ctdb cluster.<p>
47
48If you run it with no options it will provide some terse usage information. The most commonly used commands are:
49<pre>
50 ctdb status
51 ctdb ip
52 ctdb ping
53</pre>
54
55<h3>ctdb status</h3>
56
57The status command provides basic information about the cluster and the status of the nodes. when you run it you will get some output like:
58
59<pre>
60<strong>Number of nodes:4
61vnn:0 10.1.1.1 OK (THIS NODE)
62vnn:1 10.1.1.2 OK
63vnn:2 10.1.1.3 OK
64vnn:3 10.1.1.4 OK</strong>
65Generation:1362079228
66Size:4
67hash:0 lmaster:0
68hash:1 lmaster:1
69hash:2 lmaster:2
70hash:3 lmaster:3
71<strong>Recovery mode:NORMAL (0)</strong>
72Recovery master:0
73</pre>
74
75The important parts are in bold. This tells us that all 4 nodes are in
76a healthy state.<p>
77
78It also tells us that recovery mode is normal, which means that the
79cluster has finished a recovery and is running in a normal fully
80operational state.<p>
81
82Recovery state will briefly change to "RECOVERY" when there ahs been a
83node failure or something is wrong with the cluster.<p>
84
85If the cluster remains in RECOVERY state for very long (many seconds)
86there might be something wrong with the configuration. See
87/var/log/log.ctdb.
88
89<h3>ctdb ip</h3>
90
91This command prints the current status of the public ip addresses and which physical node is currently serving that ip.
92
93<pre>
94Number of nodes:4
95192.168.1.1 0
96192.168.1.2 1
97192.168.2.1 2
98192.168.2.1 3
99</pre>
100
101<h3>ctdb ping</h3>
102this command tries to "ping" the local CTDB daemon.
103<pre>
104 onnode -q all ctdb ping
105
106 response from 0 time=0.000050 sec (13 clients)
107 response from 1 time=0.000154 sec (27 clients)
108 response from 2 time=0.000114 sec (17 clients)
109 response from 3 time=0.000115 sec (59 clients)
110</pre>
111
112<!--#include virtual="footer.html" -->
Note: See TracBrowser for help on using the repository browser.