ctdb: move slide
[obnox/slides/2016-02-devconf.git] / clustering-ctdb.wiki
index 4e0ba052177314114c22955434ff5056ceffc98d..dc08aaeb32317ef0a9731efce35da636e39096d2 100644 (file)
@@ -20,6 +20,7 @@ Can we create '''all-active''' SMB clusters on top of that with Samba?
 [block]>
 }
 
+
 ==== from 2007 : CTDB - clustered Samba ====
 
 
@@ -30,22 +31,183 @@ Can we create '''all-active''' SMB clusters on top of that with Samba?
 * 2009: Samba 3.3 official support
 [block]>
 
-==== Samba layers ====
+
+==== Clustered SMB - Challenges ====
+
+* SMB-clients not aware\! (Windows...) \\ %
+==> All nodes must appear as '''one''' SMB server!
+* Nodes must share certain persistent data.
+* Daemons must talk to each other cross-node. \\ %
+==> How do Samba daemons talk to each other on one node?
+
+
+==== Samba Daemons ====
 
 <[center]
-<<<samba-layers.png, width=.8\textwidth>>>
+<<<samba-daemons-vfs-p1.png, width=.8\textwidth>>>
 [center]>
 
-==== ctdb stuff ====
+==== Samba - VFS ====
+
+<[block]{Samba NTFS semantics - open files}
+* share modes (whole file access block)
+* mandatory locks (file range access block)
+* oplocks/leases (client-side caching, break/revoke)
+[block]>
+
+
+==== Samba Daemons ====
 
+-<1>{
 <[center]
-<<<design-ctdb-three-nodes.png, width=.95\textwidth>>>
+<<<samba-daemons-vfs-p1.png, width=.8\textwidth>>>
+[center]>
+}
+
+-<2>{
+<[center]
+<<<samba-daemons-vfs-p2.png, width=.8\textwidth>>>
+[center]>
+}
+
+-<3>{
+<[center]
+<<<samba-daemons-vfs-p3.png, width=.8\textwidth>>>
+[center]>
+}
+
+-<4>{
+<[center]
+<<<samba-daemons-vfs-p4.png, width=.8\textwidth>>>
+[center]>
+}
+
+
+==== smbd : local IPC ====
+
+<[block]{messaging}
+* unix domain socket based
+* historical: signals
+[block]>
+
+<[block]{TDB}
+* 'trivial' data base
+* records: key-value
+* concurrent access with record locks
+* memory mapped
+* ==> data store of the VFS layer
+[block]>
+
+==== CTDB... ====
+
+<[block]{extends the above IPC mechanisms across nodes}
+* messages across nodes
+* '''very special''' clustered TDB implementation \\ %
+  (What data may we lose when a node goes down?...)
+[block]>
+
+<[block]{additionally}
+* also supports persistent DBs (secrets, registry, ...)
+* simple cluster service and IP management software (optional)
+[block]>
+
+
+==== CTDB - Samba Open Files DB ====
+
+
+<[center]
+<<<samba-open-files-db.png, width=\textwidth>>>
 [center]>
 
-==== ctdb stuff ====
+==== CTDB - Samba Open Files DB ====
+
+<[block]{open files db entry}
+* server id (node number, pid)
+* file id
+* access mask
+* share mode
+* flags
+* time
+* oplock/lease
+* ...
+[block]>
+
+
+%%%==== Samba layers ====
+%%%
+%%%<[center]
+%%%<<<samba-layers.png, width=.8\textwidth>>>
+%%%[center]>
+
+
+==== CTDB Design - Daemons ====
 
 <[center]
 <<<ctdb-design-daemons.png, width=\textwidth>>>
 [center]>
 
 
+==== CTDB Layout - Network ====
+
+<[center]
+<<<design-ctdb-three-nodes.png, width=.95\textwidth>>>
+[center]>
+
+
+==== CTDB Configuration ====
+
+<[block]{@/etc/sysconfig/ctdb@}
+<[code]
+CTDB_RECOVERY_LOCK=FILENAME
+CTDB_NODES=/etc/ctdb/nodes
+[code]>
+[block]>
+
+<[block]{@/etc/ctdb/nodes@}
+<[code]
+10.11.12.13
+10.11.12.14
+10.11.12.15
+[code]>
+[block]>
+
+<[block]{@/etc/samba/smb.conf@}
+<[code]
+\[global\]
+    clustering = yes
+[code]>
+[block]>
+
+==== CTDB Configuration - optional ====
+
+<[block]{@/etc/sysconfig/ctdb@}
+<[code]
+...
+CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
+CTDB_MANAGES_SAMBA=yes
+CTDB_MANAGES_WINBIND=yes
+[code]>
+[block]>
+
+<[block]{@/etc/ctdb/public\_addresses@}
+<[code]
+192.168.100.10/24 eth0
+192.168.100.11/24 eth0
+192.168.100.12/24 eth0
+[code]>
+[block]>
+
+==== CTDB - programs ====
+
+* @ctdbd@
+* @ctdb@
+** @status@
+** @scriptstatus@
+** @ip@
+** @enable/disable@
+** @getdbmap@
+** ...
+* @onnode@
+* @ltdbtool@
+* @ping\_pong@
+