From Gentoo Wiki
< Samba
Jump to:navigation Jump to:search
The information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.
Package removed from both Gentoo and overlay. Needs new instructions.


There are changes that you have a high samba share load and you need to have 2 or more samba server to serve the same group of users.

Samba 4 Cluster Member server with drbd and OCFS[1]

We can do that via CTDB and some cluster files system.

Our guide are focus on version 2.5.4 and above, version 1 is not covered on this guide


Below are the minimal requirement for ctdb:

  1. 2 node samba DC member/ files server
  2. an Extra NIC for ctdb services which have no address (Samba ctdb will take over this nic and assign ip)
  3. Each node had one 1 Private IP address for ctdb services (Not use for samba services)
  4. A Shared cluster drive OCFS2, GFS or other
  5. Not working as Samba DC.
CTDB don't run on alias NIC Different cluster files system would required some different setting on samba config

Getting CTDB

From Poly-C Eselect Repository

Let hope when this guide is ready the new ctdb-2.5.4 already in portage. bug #500332 Else you will need to get from eselect repository on poly-c

root #eselect repository enable poly-c

Unmaks CTDB

Before this let's unmask ctdb 2.5.4

FILE /etc/portage/package.unmaskadd this line in

Emerge CTDB

root #emerge --ask --newuse --verbose dev/db-ctdb

Configure CTDB

A Basical running CTDB are simple with the latest configuration


Node 1 eth1 Private IP: (CTDB node IP) 
Node 1 eth2 Public IP: (Servicing IP)
Node 2 eth1 Private IP: (CTDB node IP)
Node 2 eth2 Public IP: (Servicing IP)
Both running on eth2
Running OCFS2

eth2 will need to start without any ip.

FILE /etc/conf.d/netMake some change like below

CTDB Configuration Change

We will need to make a few changes.

FILE /etc/ctdb/ctdbd.confMake some change like below
FILE /etc/ctdb/nodesMake some change like below
FILE /etc/ctdb/public_addressesMake some change like below        eth2        eth2
Gateway on eth2??

Samba Configuration Change

Please change this on both samba server

FILE /etc/samba/smb.confAdd the following line
        #CTDB Cluster
        netbios name = SambaServerName
        clustering = yes
        ctdbd socket = /var/lib/ctdb/ctdb.socket

        #ocfs2 ctdb setting
        fileid:mapping = fsid

We are done on configuration

Start and Stop CTDB


root #ctdbd_wrapper /var/run/ctdb/ start


root #ctdbd_wrapper /var/run/ctdb/ stop


See also

External Reference