Bug #47701 ndb_mgmd miusmatch between --configdir and DataDir
Submitted: 29 Sep 2009 7:43 Modified: 19 May 2021 20:52
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: 7.0

[29 Sep 2009 7:43] Magnus Blåudd
Description:
Mismatch between --configdir=. and DataDir, looks like the ndb_mgmd put the config.bin in DataDir since that is current working directory.

How to repeat:
$ pwd
/home/msvensson/run

config.ini has one ndb_mgmd with DataDir=/home/msvensson/run/mgmd.1

$ ~/mysql/7.0-bug45497/storage/ndb/src/mgmsrv/ndb_mgmd --config-dir=. --ndb-nodeid=2 -f config.ini --nodaemon --verbose

^This works fine the first time, but fails like below  next time

$ ~/mysql/7.0-bug45497/storage/ndb/src/mgmsrv/ndb_mgmd --config-dir=. --ndb-nodeid=2 -f config.ini --nodaemon --verbose
2009-09-29 09:42:18 [MgmtSrvr] ERROR    -- The file './ndb_2_config.bin.1' already exist while preparing
2009-09-29 09:42:18 [MgmtSrvr] ERROR    -- Configuration change failed! error: 6 'Prepare of config change failed'

Suggested fix:
Convert the . to a realpath
[4 Apr 2014 13:35] Magnus Blåudd
Workaround is to use an absolute path
[19 May 2021 20:52] Jon Stephens
Documented fix as follows in the NDB 8.0.27 changelog:

    When --configdir was specified as '.', but with a current
    working directory other than DataDir, the binary configuration
    was created in DataDir and not in the current directory. In
    addition, mgmd would not start when there was an existing binary
    configuration in DataDir.

    We fix this by checking the path and refusing to start when a
    relative path is specified for --configdir.

Also noted the change in the documentation for the ndb_mgmd option.

Closed.