clustering samba with ctdb a tutorial at sambaxp 2010obnox/presentations/sambaxp... · a tutorial...

217
Clustering Samba With CTDB A Tutorial At sambaXP 2010 Michael Adam [email protected] SerNet / Samba Team 2010-05-05

Upload: others

Post on 25-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustering Samba With CTDBA Tutorial At sambaXP 2010

Michael Adam

[email protected]

SerNet / Samba Team

2010-05-05

Page 2: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Outline

Outline

1 Cluster ChallengesIntroductionChallenges For Samba

2 CTDBThe CTDB ProjectCTDB DesignSetting Up CTDB

3 Clustered SambaGetting Sources and BinariesClustered File SystemsSamba ConfigurationCTDB manages...Registry Configuration

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 2 / 43

Page 3: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges

Outline

1 Cluster ChallengesIntroductionChallenges For Samba

2 CTDBThe CTDB ProjectCTDB DesignSetting Up CTDB

3 Clustered SambaGetting Sources and BinariesClustered File SystemsSamba ConfigurationCTDB manages...Registry Configuration

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 3 / 43

Page 4: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Ideas

quite common: clustered web servers and database servers...

idea: share a cluster file system as a network service (NFS/CIFS)

i.e. turn your SAN into a clustered NAS

⇒ we want to cluster Samba/nfs in an all-active fashion

with CTDB, we can cluster Samba (and nfs, and ...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 4 / 43

Page 5: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Ideas

quite common: clustered web servers and database servers...

idea: share a cluster file system as a network service (NFS/CIFS)

i.e. turn your SAN into a clustered NAS

⇒ we want to cluster Samba/nfs in an all-active fashion

with CTDB, we can cluster Samba (and nfs, and ...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 4 / 43

Page 6: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Ideas

quite common: clustered web servers and database servers...

idea: share a cluster file system as a network service (NFS/CIFS)

i.e. turn your SAN into a clustered NAS

⇒ we want to cluster Samba/nfs in an all-active fashion

with CTDB, we can cluster Samba (and nfs, and ...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 4 / 43

Page 7: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Ideas

quite common: clustered web servers and database servers...

idea: share a cluster file system as a network service (NFS/CIFS)

i.e. turn your SAN into a clustered NAS

⇒ we want to cluster Samba/nfs in an all-active fashion

with CTDB, we can cluster Samba (and nfs, and ...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 4 / 43

Page 8: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Ideas

quite common: clustered web servers and database servers...

idea: share a cluster file system as a network service (NFS/CIFS)

i.e. turn your SAN into a clustered NAS

⇒ we want to cluster Samba/nfs in an all-active fashion

with CTDB, we can cluster Samba (and nfs, and ...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 4 / 43

Page 9: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Starting Points

Samba daemons on cluster nodes need to act as one CIFS server:

consistent view of file ownershipwindows file lock coherence

hence we need IPC of Samba daemons between nodes

furthermode share some persistent data

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 5 / 43

Page 10: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Starting Points

Samba daemons on cluster nodes need to act as one CIFS server:

consistent view of file ownershipwindows file lock coherence

hence we need IPC of Samba daemons between nodes

furthermode share some persistent data

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 5 / 43

Page 11: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Starting Points

Samba daemons on cluster nodes need to act as one CIFS server:

consistent view of file ownershipwindows file lock coherence

hence we need IPC of Samba daemons between nodes

furthermode share some persistent data

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 5 / 43

Page 12: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Starting Points

Samba daemons on cluster nodes need to act as one CIFS server:

consistent view of file ownershipwindows file lock coherence

hence we need IPC of Samba daemons between nodes

furthermode share some persistent data

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 5 / 43

Page 13: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Introduction

Starting Points

Samba daemons on cluster nodes need to act as one CIFS server:

consistent view of file ownershipwindows file lock coherence

hence we need IPC of Samba daemons between nodes

furthermode share some persistent data

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 5 / 43

Page 14: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 15: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 16: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 17: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 18: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 19: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 20: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 21: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 22: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 23: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 24: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Challenges For Samba

IPC: messaging (messages.tdb and signals)

IPC: share volatile session data:

SMB sessions (sessionid.tdb)share connections (connections.tdb)share modes (locking.tdb)byte range locks (brlock.tdb)

share certain persistent data:

user database (passdb.tdb)domain join information (secrets.tdb)id mapping tables (winbindd idmap.tdb)registry (registry.tdb)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 6 / 43

Page 25: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 26: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 27: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 28: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 29: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 30: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 31: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 32: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 33: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 34: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 35: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs

most problems are about distributing TDBs in the cluster

TDB: small fast Berkeley-DB-style database with record locks andmemory mapping

volatile (“normal”) TDBs:

read and written very frequentlynot all data must be known to every node (or smbd process) at eachpoint in timeR/W performance critical for overall fileserver performanceespecially important for the Windows locks

persistent TDBs:

read frequentlywritten rather rarelydata consistency very important

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 7 / 43

Page 36: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 37: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 38: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 39: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 40: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 41: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 42: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

TDBs And Clustering

TDB R/W performance critical for Samba performance

TDB R/W operations: excessive use of POSIX fcntl byte rangelocks

fcntl locks are usually slow on cluster file systems

the more nodes, the slower...

⇒ naive approach of putting TDBs on cluster storage works inprinciple but scales very badly

Usual clustered data bases are also too slow.

A more clever approach is needed.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 8 / 43

Page 43: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Goals

Cluster Samba So That:

One node is not slower than an unclustered Samba server.n + 1 nodes should be faster than n nodes.

This in requires a clustered TDB implementation ...

... and messaging solution.

This is what CTDB provides.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 9 / 43

Page 44: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Goals

Cluster Samba So That:

One node is not slower than an unclustered Samba server.n + 1 nodes should be faster than n nodes.

This in requires a clustered TDB implementation ...

... and messaging solution.

This is what CTDB provides.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 9 / 43

Page 45: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Goals

Cluster Samba So That:

One node is not slower than an unclustered Samba server.n + 1 nodes should be faster than n nodes.

This in requires a clustered TDB implementation ...

... and messaging solution.

This is what CTDB provides.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 9 / 43

Page 46: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Goals

Cluster Samba So That:

One node is not slower than an unclustered Samba server.n + 1 nodes should be faster than n nodes.

This in requires a clustered TDB implementation ...

... and messaging solution.

This is what CTDB provides.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 9 / 43

Page 47: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Goals

Cluster Samba So That:

One node is not slower than an unclustered Samba server.n + 1 nodes should be faster than n nodes.

This in requires a clustered TDB implementation ...

... and messaging solution.

This is what CTDB provides.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 9 / 43

Page 48: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Cluster Challenges Challenges For Samba

Goals

Cluster Samba So That:

One node is not slower than an unclustered Samba server.n + 1 nodes should be faster than n nodes.

This in requires a clustered TDB implementation ...

... and messaging solution.

This is what CTDB provides.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 9 / 43

Page 49: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB

Outline

1 Cluster ChallengesIntroductionChallenges For Samba

2 CTDBThe CTDB ProjectCTDB DesignSetting Up CTDB

3 Clustered SambaGetting Sources and BinariesClustered File SystemsSamba ConfigurationCTDB manages...Registry Configuration

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 10 / 43

Page 50: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 51: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 52: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 53: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 54: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 55: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 56: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project

started in 2006

first prototype in vl-messaging SVN branch

Volker Lendecke, Andrew Tridgell, ...

first usable version of CTDB: April 2007

meanwhile: Ronnie Sahlberg project maintainer

git://git.samba.org/sahlberg/ctdb.git

http://ctdb.samba.org/packages/ (RPMs, Sources)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 11 / 43

Page 57: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Relases

to be honest: There is no real release process.

version number and changelog in packaging/RPM/ctdb.spec.in

version in the master branch is incremented more or less frequently

some versions stabilize in extra branches: 1.0.69, 1.0.82, 1.0.108,1.0.112, ...

Hint: packagers better check with developers for advice on versions!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 12 / 43

Page 58: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Relases

to be honest: There is no real release process.

version number and changelog in packaging/RPM/ctdb.spec.in

version in the master branch is incremented more or less frequently

some versions stabilize in extra branches: 1.0.69, 1.0.82, 1.0.108,1.0.112, ...

Hint: packagers better check with developers for advice on versions!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 12 / 43

Page 59: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Relases

to be honest: There is no real release process.

version number and changelog in packaging/RPM/ctdb.spec.in

version in the master branch is incremented more or less frequently

some versions stabilize in extra branches: 1.0.69, 1.0.82, 1.0.108,1.0.112, ...

Hint: packagers better check with developers for advice on versions!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 12 / 43

Page 60: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Relases

to be honest: There is no real release process.

version number and changelog in packaging/RPM/ctdb.spec.in

version in the master branch is incremented more or less frequently

some versions stabilize in extra branches: 1.0.69, 1.0.82, 1.0.108,1.0.112, ...

Hint: packagers better check with developers for advice on versions!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 12 / 43

Page 61: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Relases

to be honest: There is no real release process.

version number and changelog in packaging/RPM/ctdb.spec.in

version in the master branch is incremented more or less frequently

some versions stabilize in extra branches: 1.0.69, 1.0.82, 1.0.108,1.0.112, ...

Hint: packagers better check with developers for advice on versions!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 12 / 43

Page 62: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Community

#ctdb channel on freenode

samba-technical mailing list

feedback and contributions by packagers

increasing development activity, number of developers

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 13 / 43

Page 63: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Community

#ctdb channel on freenode

samba-technical mailing list

feedback and contributions by packagers

increasing development activity, number of developers

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 13 / 43

Page 64: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Community

#ctdb channel on freenode

samba-technical mailing list

feedback and contributions by packagers

increasing development activity, number of developers

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 13 / 43

Page 65: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB The CTDB Project

The CTDB Project - Community

#ctdb channel on freenode

samba-technical mailing list

feedback and contributions by packagers

increasing development activity, number of developers

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 13 / 43

Page 66: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Warning

A Word Of Warning

Client connections are not spread over multiple cluster nodes.

I.e., each single client connection (CIFS, nfs, ...) is serverd by onenode just as a non-clustered file server would server the connection.

Hence a single connection is not faster than on a non-clustered fileserver, but the sum should (possibly) be faster.

In case of failover, connections are not migrated: clients need toreconnect.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 14 / 43

Page 67: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Warning

A Word Of Warning

Client connections are not spread over multiple cluster nodes.

I.e., each single client connection (CIFS, nfs, ...) is serverd by onenode just as a non-clustered file server would server the connection.

Hence a single connection is not faster than on a non-clustered fileserver, but the sum should (possibly) be faster.

In case of failover, connections are not migrated: clients need toreconnect.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 14 / 43

Page 68: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Warning

A Word Of Warning

Client connections are not spread over multiple cluster nodes.

I.e., each single client connection (CIFS, nfs, ...) is serverd by onenode just as a non-clustered file server would server the connection.

Hence a single connection is not faster than on a non-clustered fileserver, but the sum should (possibly) be faster.

In case of failover, connections are not migrated: clients need toreconnect.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 14 / 43

Page 69: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Warning

A Word Of Warning

Client connections are not spread over multiple cluster nodes.

I.e., each single client connection (CIFS, nfs, ...) is serverd by onenode just as a non-clustered file server would server the connection.

Hence a single connection is not faster than on a non-clustered fileserver, but the sum should (possibly) be faster.

In case of failover, connections are not migrated: clients need toreconnect.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 14 / 43

Page 70: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 71: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 72: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 73: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 74: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 75: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 76: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – General

one daemon ctdbd on each node (and temporary forks)

smbd talks to local ctdbd for messaging and TDB access

ctdbd handles metadata of TDBs via the network

ctdbd keeps local TDB copy (LTDB) for fast data reads/writes

the actual record read and write ops are directly to the LTDB

normal and persistent TDBs are handled differently

HA and cluster management features: monitor and fail over/back IPaddresses and Samba, NFS and other services

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 15 / 43

Page 77: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – normal TDBs

one node does not need to know all records all the time:

the records related to connections to a node are node specific

when a node goes down:

⇒ we may, even should lose records specific to that node

a node only has those records in its LTDB that is has already accessed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 16 / 43

Page 78: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – normal TDBs

one node does not need to know all records all the time:

the records related to connections to a node are node specific

when a node goes down:

⇒ we may, even should lose records specific to that node

a node only has those records in its LTDB that is has already accessed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 16 / 43

Page 79: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – normal TDBs

one node does not need to know all records all the time:

the records related to connections to a node are node specific

when a node goes down:

⇒ we may, even should lose records specific to that node

a node only has those records in its LTDB that is has already accessed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 16 / 43

Page 80: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – normal TDBs

one node does not need to know all records all the time:

the records related to connections to a node are node specific

when a node goes down:

⇒ we may, even should lose records specific to that node

a node only has those records in its LTDB that is has already accessed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 16 / 43

Page 81: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – normal TDBs

one node does not need to know all records all the time:

the records related to connections to a node are node specific

when a node goes down:

⇒ we may, even should lose records specific to that node

a node only has those records in its LTDB that is has already accessed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 16 / 43

Page 82: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 83: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 84: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 85: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 86: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 87: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 88: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 89: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 90: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 91: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 92: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 93: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design - Record Roles

nodes can carry certain roles with respect to a record:

DMASTER (data master):

has the current, authoritative copy of a recordmoves around as nodes write to the record

LMASTER (location master):

knows the location of a record’s DMASTERis fixed (calculated by record hash)LMASTER roles distributed across active nodes

R/W operation to a record:

check if we are DMASTERif not, request DMASTER role and current copy of record over network(via LMASTER)read/write locally

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 17 / 43

Page 94: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery

what happens if a node goes down?

data master for some records will be lost

one node – the recovery master – performs recovery

recovery master collects most recent copy of all records from all nodes

additional TDB header record sequence number determines recentness

at the end, the recovery master is data master for all records

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 18 / 43

Page 95: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery

what happens if a node goes down?

data master for some records will be lost

one node – the recovery master – performs recovery

recovery master collects most recent copy of all records from all nodes

additional TDB header record sequence number determines recentness

at the end, the recovery master is data master for all records

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 18 / 43

Page 96: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery

what happens if a node goes down?

data master for some records will be lost

one node – the recovery master – performs recovery

recovery master collects most recent copy of all records from all nodes

additional TDB header record sequence number determines recentness

at the end, the recovery master is data master for all records

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 18 / 43

Page 97: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery

what happens if a node goes down?

data master for some records will be lost

one node – the recovery master – performs recovery

recovery master collects most recent copy of all records from all nodes

additional TDB header record sequence number determines recentness

at the end, the recovery master is data master for all records

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 18 / 43

Page 98: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery

what happens if a node goes down?

data master for some records will be lost

one node – the recovery master – performs recovery

recovery master collects most recent copy of all records from all nodes

additional TDB header record sequence number determines recentness

at the end, the recovery master is data master for all records

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 18 / 43

Page 99: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery

what happens if a node goes down?

data master for some records will be lost

one node – the recovery master – performs recovery

recovery master collects most recent copy of all records from all nodes

additional TDB header record sequence number determines recentness

at the end, the recovery master is data master for all records

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 18 / 43

Page 100: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery Election / Recovery Lock

recovery master is determined by an election process

if the cluster file system supports POSIX fcntl byte range locks,then CTDB can use it for split brain prevention:

election process can involve one file on shared storage:the recovery lock file

nodes compete with POSIX fcntl byte range locks

finally, the newly elected recovery master holds lock on the recoverylock file

⇒ CTDB has no split brain (other than the file system)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 19 / 43

Page 101: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery Election / Recovery Lock

recovery master is determined by an election process

if the cluster file system supports POSIX fcntl byte range locks,then CTDB can use it for split brain prevention:

election process can involve one file on shared storage:the recovery lock file

nodes compete with POSIX fcntl byte range locks

finally, the newly elected recovery master holds lock on the recoverylock file

⇒ CTDB has no split brain (other than the file system)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 19 / 43

Page 102: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery Election / Recovery Lock

recovery master is determined by an election process

if the cluster file system supports POSIX fcntl byte range locks,then CTDB can use it for split brain prevention:

election process can involve one file on shared storage:the recovery lock file

nodes compete with POSIX fcntl byte range locks

finally, the newly elected recovery master holds lock on the recoverylock file

⇒ CTDB has no split brain (other than the file system)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 19 / 43

Page 103: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery Election / Recovery Lock

recovery master is determined by an election process

if the cluster file system supports POSIX fcntl byte range locks,then CTDB can use it for split brain prevention:

election process can involve one file on shared storage:the recovery lock file

nodes compete with POSIX fcntl byte range locks

finally, the newly elected recovery master holds lock on the recoverylock file

⇒ CTDB has no split brain (other than the file system)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 19 / 43

Page 104: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery Election / Recovery Lock

recovery master is determined by an election process

if the cluster file system supports POSIX fcntl byte range locks,then CTDB can use it for split brain prevention:

election process can involve one file on shared storage:the recovery lock file

nodes compete with POSIX fcntl byte range locks

finally, the newly elected recovery master holds lock on the recoverylock file

⇒ CTDB has no split brain (other than the file system)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 19 / 43

Page 105: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Recovery Election / Recovery Lock

recovery master is determined by an election process

if the cluster file system supports POSIX fcntl byte range locks,then CTDB can use it for split brain prevention:

election process can involve one file on shared storage:the recovery lock file

nodes compete with POSIX fcntl byte range locks

finally, the newly elected recovery master holds lock on the recoverylock file

⇒ CTDB has no split brain (other than the file system)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 19 / 43

Page 106: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 107: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 108: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 109: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 110: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 111: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 112: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 113: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 114: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 115: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 116: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 117: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 118: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

Performance Figures

By Andrew Tridgell and Ronnie Sahlberg, Linux Conf Australia 2009GPFS file system

32 client smbtorture NBENCH test

1 node: 109 MBytes/sec

2 nodes: 210 MBytes/sec

3 nodes: 278 MBytes/sec

4 nodes: 308 MBytes/sec

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 20 / 43

Page 119: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 120: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 121: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 122: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 123: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 124: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 125: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 126: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB CTDB Design

CTDB Design – persistent TDBs

each node always has complete copy in LTDB

reads operations directly from LTDB

write operations:

lock entire DB in a global lockperform R/W ops in memory (prepare a marshall buffer)at commit distribute changes to other nodes and write to LTDB in alocal transactionfinally drop global lock

⇒ data integrity and good read performance guaranteed

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 21 / 43

Page 127: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Basic Setup

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 22 / 43

Page 128: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 129: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 130: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 131: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 132: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 133: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 134: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Configuration

central file: /etc/sysconfig/ctdb

debian based: /etc/default/ctdb

set CTDB RECOVERY LOCK for split brain prevention

fill /etc/ctdb/nodes with internal node addresses

example /etc/ctdb/nodes

10.11.12.1010.11.12.1110.11.12.12

same file on all nodes!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 23 / 43

Page 135: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Public Addresses

set CTDB PUBLIC ADDRESSES in /etc/sysconfig/ctdb

typical value /etc/ctdb/public addresses

example /etc/ctdb/public addresses

172.16.17.10/24 eth2172.16.17.11/24 eth2172.16.17.12/24 eth2172.16.17.13/24 eth2172.16.17.14/24 eth2172.16.17.15/24 eth2

need not be the same on all nodes

need not even be present on all nodes (management node...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 24 / 43

Page 136: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Public Addresses

set CTDB PUBLIC ADDRESSES in /etc/sysconfig/ctdb

typical value /etc/ctdb/public addresses

example /etc/ctdb/public addresses

172.16.17.10/24 eth2172.16.17.11/24 eth2172.16.17.12/24 eth2172.16.17.13/24 eth2172.16.17.14/24 eth2172.16.17.15/24 eth2

need not be the same on all nodes

need not even be present on all nodes (management node...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 24 / 43

Page 137: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Public Addresses

set CTDB PUBLIC ADDRESSES in /etc/sysconfig/ctdb

typical value /etc/ctdb/public addresses

example /etc/ctdb/public addresses

172.16.17.10/24 eth2172.16.17.11/24 eth2172.16.17.12/24 eth2172.16.17.13/24 eth2172.16.17.14/24 eth2172.16.17.15/24 eth2

need not be the same on all nodes

need not even be present on all nodes (management node...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 24 / 43

Page 138: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Public Addresses

set CTDB PUBLIC ADDRESSES in /etc/sysconfig/ctdb

typical value /etc/ctdb/public addresses

example /etc/ctdb/public addresses

172.16.17.10/24 eth2172.16.17.11/24 eth2172.16.17.12/24 eth2172.16.17.13/24 eth2172.16.17.14/24 eth2172.16.17.15/24 eth2

need not be the same on all nodes

need not even be present on all nodes (management node...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 24 / 43

Page 139: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Public Addresses

set CTDB PUBLIC ADDRESSES in /etc/sysconfig/ctdb

typical value /etc/ctdb/public addresses

example /etc/ctdb/public addresses

172.16.17.10/24 eth2172.16.17.11/24 eth2172.16.17.12/24 eth2172.16.17.13/24 eth2172.16.17.14/24 eth2172.16.17.15/24 eth2

need not be the same on all nodes

need not even be present on all nodes (management node...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 24 / 43

Page 140: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB - Public Addresses

set CTDB PUBLIC ADDRESSES in /etc/sysconfig/ctdb

typical value /etc/ctdb/public addresses

example /etc/ctdb/public addresses

172.16.17.10/24 eth2172.16.17.11/24 eth2172.16.17.12/24 eth2172.16.17.13/24 eth2172.16.17.14/24 eth2172.16.17.15/24 eth2

need not be the same on all nodes

need not even be present on all nodes (management node...)

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 24 / 43

Page 141: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 142: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 143: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 144: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 145: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 146: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 147: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 148: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 149: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 150: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 151: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

IP Failover

healthy nodes get IP addresses from their public pool

when a node goes down: public IPs are moved to other nodes

CTDB distributes the public IPs equally among healthy nodes

with round robin DNS ⇒ HA and load balancing

speed up client reconnects with tickle ACKs:

client does not yet know the IP has movednew node does not have a valid TCP connection to clientnew node sends illegal TCP ACK packet to the client (seqnum 0)client sends back correct ACK packet to the new nodenew node sends back a RST packet to the clientclient re-establishes connection to the new node

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 25 / 43

Page 152: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB Toolbox

ctdb – control ctdbd

onnode – execute programs on selected nodes

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 26 / 43

Page 153: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

CTDB Toolbox

ctdb – control ctdbd

onnode – execute programs on selected nodes

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 26 / 43

Page 154: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

ctdb status

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 27 / 43

Page 155: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

ctdb ip

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 28 / 43

Page 156: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

CTDB Setting Up CTDB

Let’s start setting up a “real” cluster.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 29 / 43

Page 157: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba

Outline

1 Cluster ChallengesIntroductionChallenges For Samba

2 CTDBThe CTDB ProjectCTDB DesignSetting Up CTDB

3 Clustered SambaGetting Sources and BinariesClustered File SystemsSamba ConfigurationCTDB manages...Registry Configuration

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 30 / 43

Page 158: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 159: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 160: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 161: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 162: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 163: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 164: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Getting Sources and Binaries

Getting A Clustered Samba

in vanilla Samba code since Samba 3.3 (January 2009)

transaction rewrite in 3.5.2 (March 2010)

precompiled packages from http://www.enterprisesamba.org/

clustered Samba repository:git://git.samba.org/obnox/samba-ctdb.gitbranches: v3-4-ctdb and v3-2-ctdb

configure --with-cluster-support

add idmap tdb2 to --with-shared-modules

verify that gpfs.so is built for GPFS usage

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 31 / 43

Page 165: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Clustered File System - Requirements

file system: black box

storage: fibre channel, iSCSI, drbd, ...

simulatneous writes from all nodes

good to have: coherent POSIX fcntl byte range lock supportuse ping pong test to verify

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 32 / 43

Page 166: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Clustered File System - Requirements

file system: black box

storage: fibre channel, iSCSI, drbd, ...

simulatneous writes from all nodes

good to have: coherent POSIX fcntl byte range lock supportuse ping pong test to verify

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 32 / 43

Page 167: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Clustered File System - Requirements

file system: black box

storage: fibre channel, iSCSI, drbd, ...

simulatneous writes from all nodes

good to have: coherent POSIX fcntl byte range lock supportuse ping pong test to verify

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 32 / 43

Page 168: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Clustered File System - Requirements

file system: black box

storage: fibre channel, iSCSI, drbd, ...

simulatneous writes from all nodes

good to have: coherent POSIX fcntl byte range lock supportuse ping pong test to verify

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 32 / 43

Page 169: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Special File Systems

General Parallel File System GPFS (IBM): OK

Global File System GFS(2) (Red Hat): OK

GNU Cluster File System GlusterFS: OK

Lustre (Sun): OK

Oracle Cluster File System OCFS(2): OK

Ceph: ?

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 33 / 43

Page 170: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Special File Systems

General Parallel File System GPFS (IBM): OK

Global File System GFS(2) (Red Hat): OK

GNU Cluster File System GlusterFS: OK

Lustre (Sun): OK

Oracle Cluster File System OCFS(2): OK

Ceph: ?

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 33 / 43

Page 171: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Special File Systems

General Parallel File System GPFS (IBM): OK

Global File System GFS(2) (Red Hat): OK

GNU Cluster File System GlusterFS: OK

Lustre (Sun): OK

Oracle Cluster File System OCFS(2): OK

Ceph: ?

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 33 / 43

Page 172: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Special File Systems

General Parallel File System GPFS (IBM): OK

Global File System GFS(2) (Red Hat): OK

GNU Cluster File System GlusterFS: OK

Lustre (Sun): OK

Oracle Cluster File System OCFS(2): OK

Ceph: ?

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 33 / 43

Page 173: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Special File Systems

General Parallel File System GPFS (IBM): OK

Global File System GFS(2) (Red Hat): OK

GNU Cluster File System GlusterFS: OK

Lustre (Sun): OK

Oracle Cluster File System OCFS(2): OK

Ceph: ?

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 33 / 43

Page 174: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Clustered File Systems

Special File Systems

General Parallel File System GPFS (IBM): OK

Global File System GFS(2) (Red Hat): OK

GNU Cluster File System GlusterFS: OK

Lustre (Sun): OK

Oracle Cluster File System OCFS(2): OK

Ceph: ?

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 33 / 43

Page 175: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 176: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 177: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 178: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 179: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 180: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 181: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Samba Configuration

identical configuration on all nodes

clustering = yes

passdb backen = tdbsam

groupdb:backend = tdb

vfs objects = fileidfileid:algorithm = fsid / fsname

idmap backend = tdb2

no need to change private dir

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 34 / 43

Page 182: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

example smb.conf

[global]

clustering = yes

netbios name = smbcluster

workgroup = mydomain

security = ads

passdb backend = tdbsam

groupdb:backend = tdb

idmap backend = tdb2

idmap uid = 1000000-2000000

idmap gid = 1000000-2000000

fileid:algorithm = fsname

[share]

path = /cluster storage/share

writeable = yes

vfs objects = fileid

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 35 / 43

Page 183: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Samba Configuration

Let’s configure Samba on our cluster!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 36 / 43

Page 184: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB can manage several services

i.e. start, stop, monitor them

controlled by sysconfig variables CTDB MANAGES SERVICE

management performed by scripts in /etc/ctdb/events.d

managed services should be removed from the runlevels

NOTE: if CTDB MANAGES SAMBA, do not setinterfaces or bind interfaces only

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 37 / 43

Page 185: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB can manage several services

i.e. start, stop, monitor them

controlled by sysconfig variables CTDB MANAGES SERVICE

management performed by scripts in /etc/ctdb/events.d

managed services should be removed from the runlevels

NOTE: if CTDB MANAGES SAMBA, do not setinterfaces or bind interfaces only

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 37 / 43

Page 186: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB can manage several services

i.e. start, stop, monitor them

controlled by sysconfig variables CTDB MANAGES SERVICE

management performed by scripts in /etc/ctdb/events.d

managed services should be removed from the runlevels

NOTE: if CTDB MANAGES SAMBA, do not setinterfaces or bind interfaces only

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 37 / 43

Page 187: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB can manage several services

i.e. start, stop, monitor them

controlled by sysconfig variables CTDB MANAGES SERVICE

management performed by scripts in /etc/ctdb/events.d

managed services should be removed from the runlevels

NOTE: if CTDB MANAGES SAMBA, do not setinterfaces or bind interfaces only

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 37 / 43

Page 188: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB can manage several services

i.e. start, stop, monitor them

controlled by sysconfig variables CTDB MANAGES SERVICE

management performed by scripts in /etc/ctdb/events.d

managed services should be removed from the runlevels

NOTE: if CTDB MANAGES SAMBA, do not setinterfaces or bind interfaces only

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 37 / 43

Page 189: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB can manage several services

i.e. start, stop, monitor them

controlled by sysconfig variables CTDB MANAGES SERVICE

management performed by scripts in /etc/ctdb/events.d

managed services should be removed from the runlevels

NOTE: if CTDB MANAGES SAMBA, do not setinterfaces or bind interfaces only

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 37 / 43

Page 190: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB MANAGES SAMBA

CTDB MANAGES WINBIND

CTDB MANAGES NFS

CTDB MANAGES VSFTPD

CTDB MANAGES HTTPD

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 38 / 43

Page 191: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB MANAGES SAMBA

CTDB MANAGES WINBIND

CTDB MANAGES NFS

CTDB MANAGES VSFTPD

CTDB MANAGES HTTPD

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 38 / 43

Page 192: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB MANAGES SAMBA

CTDB MANAGES WINBIND

CTDB MANAGES NFS

CTDB MANAGES VSFTPD

CTDB MANAGES HTTPD

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 38 / 43

Page 193: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB MANAGES SAMBA

CTDB MANAGES WINBIND

CTDB MANAGES NFS

CTDB MANAGES VSFTPD

CTDB MANAGES HTTPD

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 38 / 43

Page 194: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba CTDB manages...

CTDB manages ...

CTDB MANAGES SAMBA

CTDB MANAGES WINBIND

CTDB MANAGES NFS

CTDB MANAGES VSFTPD

CTDB MANAGES HTTPD

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 38 / 43

Page 195: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Registry Configuration

store config in Samba’s registry

HKLM\Software\Samba\smbconfsubkey ⇔ section

value ⇔ parameter

stored in registry.tdb ⇒ distributed across cluster by CTDB

means of easily managing the whole Samba cluster

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 39 / 43

Page 196: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Registry Configuration

store config in Samba’s registry

HKLM\Software\Samba\smbconfsubkey ⇔ section

value ⇔ parameter

stored in registry.tdb ⇒ distributed across cluster by CTDB

means of easily managing the whole Samba cluster

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 39 / 43

Page 197: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Registry Configuration

store config in Samba’s registry

HKLM\Software\Samba\smbconfsubkey ⇔ section

value ⇔ parameter

stored in registry.tdb ⇒ distributed across cluster by CTDB

means of easily managing the whole Samba cluster

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 39 / 43

Page 198: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Registry Configuration

store config in Samba’s registry

HKLM\Software\Samba\smbconfsubkey ⇔ section

value ⇔ parameter

stored in registry.tdb ⇒ distributed across cluster by CTDB

means of easily managing the whole Samba cluster

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 39 / 43

Page 199: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Registry Configuration

store config in Samba’s registry

HKLM\Software\Samba\smbconfsubkey ⇔ section

value ⇔ parameter

stored in registry.tdb ⇒ distributed across cluster by CTDB

means of easily managing the whole Samba cluster

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 39 / 43

Page 200: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Registry Configuration

store config in Samba’s registry

HKLM\Software\Samba\smbconfsubkey ⇔ section

value ⇔ parameter

stored in registry.tdb ⇒ distributed across cluster by CTDB

means of easily managing the whole Samba cluster

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 39 / 43

Page 201: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Activation of Registry Configuration

registry shares = yes

include = registry

config backend = registry

smb.conf for cluster usage

[global]clustering = yesinclude = registry

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 40 / 43

Page 202: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Activation of Registry Configuration

registry shares = yes

include = registry

config backend = registry

smb.conf for cluster usage

[global]clustering = yesinclude = registry

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 40 / 43

Page 203: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Activation of Registry Configuration

registry shares = yes

include = registry

config backend = registry

smb.conf for cluster usage

[global]clustering = yesinclude = registry

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 40 / 43

Page 204: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Activation of Registry Configuration

registry shares = yes

include = registry

config backend = registry

smb.conf for cluster usage

[global]clustering = yesinclude = registry

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 40 / 43

Page 205: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Activation of Registry Configuration

registry shares = yes

include = registry

config backend = registry

smb.conf for cluster usage

[global]clustering = yesinclude = registry

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 40 / 43

Page 206: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 207: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 208: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 209: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 210: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 211: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 212: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 213: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 214: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 215: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

net conf

manage the whole Samba cluster with one command

net conf list Dump the complete configuration in smb.conf format.

net conf listshares List the share names.

net conf import Import configuration from file in smb.conf format.

net conf drop Delete the complete configuration.

net conf showshare Show the definition of a share.

net conf addshare Create a new share.

net conf delshare Delete a share.

net conf setparm Store a parameter.

net conf getparm Retrieve the value of a parameter.

net conf delparm Delete a parameter.

net conf getincludes Show the includes of a share definition.

net conf setincludes Set includes for a share.

net conf delincludes Delete includes from a share definition.

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 41 / 43

Page 216: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Let’s experiment more with our cluster! ...

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 42 / 43

Page 217: Clustering Samba With CTDB A Tutorial At sambaXP 2010obnox/presentations/sambaXP... · A Tutorial At sambaXP 2010 Michael Adam obnox@samba.org SerNet / Samba Team 2010-05-05. Outline

Clustered Samba Registry Configuration

Thank you very much!

Michael Adam (SerNet / Samba Team) tutorial sambaXP 2010-05-05 43 / 43