4 <[block]{Failover SMB clusters...}
5 Around 2006, it was quite customary to run Samba file servers in active-passive
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, ...
19 Can we create '''all-active''' SMB clusters on top of that with Samba?
24 ==== from 2007 : CTDB - clustered Samba ====
27 <[block]{Samba+CTDB: pioneer in scale-out SMB}
29 * 2007: CTDB first usable version (with patched Samba)
30 * 2008: Samba 3.2 first experimental support
31 * 2009: Samba 3.3 official support
35 ==== Clustered SMB - Challenges ====
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?
44 ==== Samba Daemons ====
47 <<<samba-daemons-vfs-p1.png, width=.8\textwidth>>>
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)
59 ==== Samba Daemons ====
63 <<<samba-daemons-vfs-p1.png, width=.8\textwidth>>>
69 <<<samba-daemons-vfs-p2.png, width=.8\textwidth>>>
75 <<<samba-daemons-vfs-p3.png, width=.8\textwidth>>>
81 <<<samba-daemons-vfs-p4.png, width=.8\textwidth>>>
86 ==== smbd : local IPC ====
89 * unix domain socket based
96 * concurrent access with record locks
98 * ==> data store of the VFS layer
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?...)
109 <[block]{additionally}
110 * also supports persistent DBs (secrets, registry, ...)
111 * simple cluster service and IP management software (optional)
115 ==== CTDB - Samba Open Files DB ====
119 <<<samba-open-files-db.png, width=\textwidth>>>
122 ==== CTDB - Samba Open Files DB ====
124 <[block]{open files db entry}
125 * server id (node number, pid)
136 %%%==== Samba layers ====
139 %%%<<<samba-layers.png, width=.8\textwidth>>>
143 ==== CTDB Design - Daemons ====
146 <<<ctdb-design-daemons.png, width=\textwidth>>>
150 ==== CTDB Configuration ====
152 <[block]{@/etc/sysconfig/ctdb@}
154 CTDB_RECOVERY_LOCK=FILENAME
155 CTDB_NODES=/etc/ctdb/nodes
159 <[block]{@/etc/ctdb/nodes@}
167 <[block]{@/etc/samba/smb.conf@}
174 ==== CTDB Configuration - optional ====
176 <[block]{@/etc/sysconfig/ctdb@}
179 CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
180 CTDB_MANAGES_SAMBA=yes
181 CTDB_MANAGES_WINBIND=yes
185 <[block]{@/etc/ctdb/public\_addresses@}
187 192.168.100.10/24 eth0
188 192.168.100.11/24 eth0
189 192.168.100.12/24 eth0
193 ==== CTDB - programs ====
207 ==== CTDB Layout - Network ====
210 <<<design-ctdb-three-nodes.png, width=.95\textwidth>>>