smb3: rdma
[gd/slides/2016-02-devconf.git] / clustering-ctdb.wiki
1 ==== The Idea... ====
2
3 +<1->{
4 <[block]{Failover SMB clusters...}
5 Around 2006, it was quite customary to run Samba file servers in active-passive
6 failover clusters.
7 [block]>
8 }
9
10 +<2->{
11 <[block]{Clustered file systems...}
12 At that time, quite a few distributed/clustered file systems
13 were available: gfs2, gpfs (IBM), GlusterFS, lustre, ocfs2, ...
14 [block]>
15 }
16
17 +<3->{
18 <[block]{New Idea...}
19 Can we create '''all-active''' SMB clusters on top of that with Samba?
20 [block]>
21 }
22
23
24 ==== from 2007 : CTDB - clustered Samba ====
25
26
27 <[block]{Samba+CTDB: pioneer in scale-out SMB}
28 * 2006: prototypes
29 * 2007: CTDB first usable version (with patched Samba)
30 * 2008: Samba 3.2 first experimental support
31 * 2009: Samba 3.3 official support
32 [block]>
33
34
35 ==== Clustered SMB - Challenges ====
36
37 * SMB-clients not aware\! (Windows...) \\ %
38 ==> All nodes must appear as '''one''' SMB server!
39 * Nodes must share certain persistent data.
40 * Daemons must talk to each other cross-node. \\ %
41 ==> How do Samba daemons talk to each other on one node?
42
43
44 ==== Samba Daemons ====
45
46 <[center]
47 <<<samba-daemons-vfs-p1.png, width=.8\textwidth>>>
48 [center]>
49
50 ==== Samba - VFS ====
51
52 <[block]{Samba NTFS semantics - open files}
53 * share modes (whole file access block)
54 * mandatory locks (file range access block)
55 * oplocks/leases (client-side caching, break/revoke)
56 [block]>
57
58
59 ==== Samba Daemons ====
60
61 -<1>{
62 <[center]
63 <<<samba-daemons-vfs-p1.png, width=.8\textwidth>>>
64 [center]>
65 }
66
67 -<2>{
68 <[center]
69 <<<samba-daemons-vfs-p2.png, width=.8\textwidth>>>
70 [center]>
71 }
72
73 -<3>{
74 <[center]
75 <<<samba-daemons-vfs-p3.png, width=.8\textwidth>>>
76 [center]>
77 }
78
79 -<4>{
80 <[center]
81 <<<samba-daemons-vfs-p4.png, width=.8\textwidth>>>
82 [center]>
83 }
84
85
86 ==== smbd : local IPC ====
87
88 <[block]{messaging}
89 * unix domain socket based
90 * historical: signals
91 [block]>
92
93 <[block]{TDB}
94 * 'trivial' data base
95 * records: key-value
96 * concurrent access with record locks
97 * memory mapped
98 * ==> data store of the VFS layer
99 [block]>
100
101 ==== CTDB... ====
102
103 <[block]{extends the above IPC mechanisms across nodes}
104 * messages across nodes
105 * '''very special''' clustered TDB implementation \\ %
106   (What data may we lose when a node goes down?...)
107 [block]>
108
109 <[block]{additionally}
110 * also supports persistent DBs (secrets, registry, ...)
111 * simple cluster service and IP management software (optional)
112 [block]>
113
114
115 ==== CTDB - Samba Open Files DB ====
116
117
118 <[center]
119 <<<samba-open-files-db.png, width=\textwidth>>>
120 [center]>
121
122 ==== CTDB - Samba Open Files DB ====
123
124 <[block]{open files db entry}
125 * server id (node number, pid)
126 * file id
127 * access mask
128 * share mode
129 * flags
130 * time
131 * oplock/lease
132 * ...
133 [block]>
134
135
136 %%%==== Samba layers ====
137 %%%
138 %%%<[center]
139 %%%<<<samba-layers.png, width=.8\textwidth>>>
140 %%%[center]>
141
142
143 ==== CTDB Design - Daemons ====
144
145 <[center]
146 <<<ctdb-design-daemons.png, width=\textwidth>>>
147 [center]>
148
149
150 ==== CTDB Configuration ====
151
152 <[block]{@/etc/sysconfig/ctdb@}
153 <[code]
154 CTDB_RECOVERY_LOCK=FILENAME
155 CTDB_NODES=/etc/ctdb/nodes
156 [code]>
157 [block]>
158
159 <[block]{@/etc/ctdb/nodes@}
160 <[code]
161 10.11.12.13
162 10.11.12.14
163 10.11.12.15
164 [code]>
165 [block]>
166
167 <[block]{@/etc/samba/smb.conf@}
168 <[code]
169 \[global\]
170     clustering = yes
171 [code]>
172 [block]>
173
174 ==== CTDB Configuration - optional ====
175
176 <[block]{@/etc/sysconfig/ctdb@}
177 <[code]
178 ...
179 CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
180 CTDB_MANAGES_SAMBA=yes
181 CTDB_MANAGES_WINBIND=yes
182 [code]>
183 [block]>
184
185 <[block]{@/etc/ctdb/public\_addresses@}
186 <[code]
187 192.168.100.10/24 eth0
188 192.168.100.11/24 eth0
189 192.168.100.12/24 eth0
190 [code]>
191 [block]>
192
193 ==== CTDB - programs ====
194
195 * @ctdbd@
196 * @ctdb@
197 ** @status@
198 ** @scriptstatus@
199 ** @ip@
200 ** @enable/disable@
201 ** @getdbmap@
202 ** ...
203 * @onnode@
204 * @ltdbtool@
205 * @ping\_pong@
206
207 ==== CTDB Layout - Network ====
208
209 <[center]
210 <<<design-ctdb-three-nodes.png, width=.95\textwidth>>>
211 [center]>
212
213