ctdb getdbmap doesn't include registry.tdb

Amitay Isaacs amitay at gmail.com
Tue Jul 5 05:49:50 UTC 2016


On Tue, Jul 5, 2016 at 2:55 PM, Steve French <smfrench at gmail.com> wrote:

> On Fri, Jul 1, 2016 at 3:15 PM, Martin Schwenke <martin at meltin.net> wrote:
> > On Fri, 1 Jul 2016 08:40:31 -0700, Richard Sharpe
> > <realrichardsharpe at gmail.com> wrote:
> >
> >> On Fri, Jul 1, 2016 at 8:23 AM, Steve French <smfrench at gmail.com>
> wrote:
> >> > How do you tell ctdb to manage registry.tdb?
> >> >
> >> > In a test system, I just ran "ctdb getdbmap" I noticed that
> >> > registry.tdb was not included in the list, although 17 others are (see
> >> > below).  smb.conf does have include = registry, and net conf list
> >> > shows a few config parms.  Presumably the registry.tdb needs to be
> >> > upgraded to be clustered, perhaps the problem is caused if any
> >> > registry commands (net conf) are issued prior to starting ctdb?
> >>
> >> That is strange because I am pretty certain it was managing the
> >> registry.tdb a couple of years ago when I checked this out.
> >
> > This is on a cluster running CTDB from master:
> >
> >   [root at m1n1 ~]# ctdb getdbmap | grep registry
> >   dbid:0x6cf2837d name:registry.tdb
> path:/var/lib/ctdb/persistent/registry.tdb.0 PERSISTENT
> >
> > I don't think this has ever been broken... well, at least not in
> > recent times...
> >
> >> What happens if you use net conf blah blah on one of the nodes. Can
> >> you see the new entries on other nodes?
>
> No - ran net conf addshare on one node, and only see the share with
> net conf listshares on that node (not the other).  On the other hand
> new users added via "smbpasswd -a" do show up on both nodes.
>
> >> Perhaps it is just an error in the ctdb tool.
> >
> > Or perhaps smb.conf is missing the following line?
> >
> >         ctdb:registry.tdb=yes
> >
> > Now documented at:
> >
> >
> https://wiki.samba.org/index.php/CTDB_Setup#Critical_smb.conf_parameters
>
> Adding that entry in smb.conf after the fact may not be good enough (I
> tried adding it to smb.conf on all nodes) - does the database have to
> be converted if samba started once without the parm in smb.conf, the
> parm is added, and then samba and ctdb restarted?  I will try an
> experiment later making sure smb.conf is updated before first start of
> the services, but it does seem weird that all the other databases show
> up - and smb.conf specifies "ctdb:registry.tdb=yes" now.   This is
> latest 4.4-test branch from last week.
>
>
Just to clarify the situation:

- You have initialized the registry database (added shares) with standalone
samba configuration
- Then you have enabled clustering in smb.conf
- Now you are not seeing the configuration stored in registry across the
cluster

If you have initialized any databases in standalone samba configuration and
want to migrate those databases to ctdb, then they have to be converted.
In your case, there is a local registry.tdb (in private dir) and there is a
clustered registry.tdb (probably empty).

You can use ltdbtool to convert the database between standalone samba and
ctdb.

Here are the steps you need:

- Stop samba/ctdb on all nodes

- Remove registry.tdb.?? from all ctdb nodes
   onnode all rm /var/lib/ctdb/persistent/registry.tdb.\?

- Convert registry.tdb from samba to ctdb (for example, on node 0)
   ltdbtool convert -s0 -o64 /var/lib/samba/registry.tdb
/var/lib/ctdb/persistent/registry.tdb.0

- Now start ctdb.  CTDB should replicate registry.tdb to all nodes
correctly.

If you have joined AD domain with standalone samba, then you will need to
do simiar steps for secrets.tdb.  Or if you were using passdb, then
passdb.tdb.  You get the idea.

Amitay.


More information about the samba-technical mailing list