persistent_callback: print "no error message given" instead of "(null)"
[sahlberg/ctdb.git] / web / samba.html
1 <!--#set var="TITLE" value="CTDB and Samba" -->
2 <!--#include virtual="header.html" -->
3
4 <h1>Setting up clustered samba</h1>
5
6 It is assumed tou have already installed the ctdb version of samba and also installed, configured and tested CTDB.
7
8 <h2>Create a user account</h2>
9
10 First you need to initialise the Samba password database so that you have some user that can authenticate to the samba service.<br>
11 Do this by running:
12 <pre>
13   smbpasswd -a root
14 </pre>
15
16 Samba with clustering must use the tdbsam or ldap SAM passdb backends (it must not use the default smbpasswd backend), or must be configured to be a member of a domain.<br>
17 The rest of the configuration of Samba is exactly as it is done on a normal system.<br><br>
18 See the docs on http://samba.org/ for details.
19
20 <h2>Critical smb.conf parameters</h2>
21
22 A clustered Samba install must set some specific configuration parameters
23 <pre>
24   clustering = yes
25   idmap backend = tdb2
26   private dir = /a/directory/on/your/cluster/filesystem
27 </pre>
28
29 It is vital that the private directory is on shared storage. 
30
31 <h2>Using smbcontrol</h2>
32
33 You can check for connectivity to the smbd daemons on each node using smbcontrol
34 <pre>
35   smbcontrol smbd ping
36 </pre>
37
38 <h2>Using Samba4 smbtorture</h2>
39
40 The Samba4 version of smbtorture has several tests that can be used to benchmark a CIFS cluster.<br>
41 You can download Samba4 like this:
42 <pre>
43   svn co svn://svnanon.samba.org/samba/branches/SAMBA_4_0
44 </pre>
45 Then configure and compile it as usual.<br>
46 The particular tests that are helpful for cluster benchmarking are the RAW-BENCH-OPEN, RAW-BENCH-LOCK and BENCH-NBENCH tests.<br>
47 These tests take a unclist that allows you to spread the workload out over more than one node. For example:
48
49 <pre>
50   smbtorture //localhost/data -Uuser%password  RAW-BENCH-LOCK --unclist=unclist.txt --num-progs=32 -t60
51 </pre>
52
53 The file unclist.txt should contain a list of server names in your cluster prefixed by //. For example
54 <pre>
55  //192.168.1.1
56  //192.168.1.2
57  //192.168.2.1
58  //192.168.2.2
59 </pre>
60
61 For NBENCH testing you need a client.txt file.<br>
62 A suitable file can be found in the dbench distribution at http://samba.org/ftp/tridge/dbench/
63
64
65 <h3>CTDB_MANAGES_SAMBA</h3>
66 This is a parameter in /etc/sysconfig/ctdb<br><br>
67 When this parameter is set to "yes" CTDB will start/stop/restart the local samba daemon as the cluster configuration changes.<br><br>
68 When this parameter is set you should also make sure that samba is NOT started by default by the linux system when it boots, e.g.
69 <pre>
70   chkconfig smb off
71 </pre>
72 on a Redhat system and
73 <pre>
74   chkconfig smb off
75   chkconfig nmb off
76 </pre>
77 on a SuSE system.
78
79 Example:
80 <pre>
81   CTDB_MANAGES_SAMBA="yes"
82 </pre>
83
84 It is strongly recommended that you set this parameter to "yes" if you intend to use clustered samba.
85
86 <h3>CTDB_MANAGES_WINBIND</h3>
87 This is a parameter in /etc/sysconfig/ctdb<br><br>
88 When this parameter is set to "yes" CTDB will start/stop/restart the local winbind daemon as the cluster configuration changes.<br><br>
89 When this parameter is set you should also make sure that winbind is NOT started by default by the linux system when it boots:
90 <pre>
91   chkconfig winbind off
92 </pre>
93
94 Example:
95 <pre>
96   CTDB_MANAGES_WINBIND="yes"
97 </pre>
98
99 It is strongly recommended that you set this parameter to "yes" if you
100 intend to use clustered samba in DOMAIN or ADS security mode.
101
102 <!--#include virtual="footer.html" -->
103