Bug #23887 ndb_config does not work when using 2 mgm servers and node-ids
Submitted: 2 Nov 2006 14:31 Modified: 11 Dec 2006 6:52
Reporter: Jim Dowling Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.1.12 OS:Linux (linux (ubuntu))
Assigned to: Hartmut Holzgraefe CPU Architecture:Any
Tags: cluster, ndb_config

[2 Nov 2006 14:31] Jim Dowling
Description:
When you have two mgmds in a two node cluster and use node-ids, ndb_config does not work.

How to repeat:
Config.ini Below

[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=80M  # Reduced to total 100M per replica
IndexMemory=20M
NoOfFragmentLogFiles=25
TimeBetweenLocalCheckpoints=6
MaxNoOfConcurrentOperations=12500
TransactionInactiveTimeout=30000        # 30seconds of inactivity=rollback

[NDB_MGMD]
Hostname=localhost
nodeid=62
portnumber=23131
DataDir=/var/lib/mysql-cluster/dbmgmd1

[NDB_MGMD]
Hostname=localhost
nodeid=63
portnumber=23132
DataDir=/var/lib/mysql-cluster/dbmgmd2

[NDBD]
HostName=localhost
datadir=/var/lib/mysql-cluster/dbdata1
nodeid=1

[NDBD]
HostName=localhost
datadir=/var/lib/mysql-cluster/dbdata2
nodeid=2

# Auto-enumerated API node slots,
# Counting down from 61
#
[MYSQLD]
nodeid=61
[MYSQLD]
nodeid=60
[MYSQLD]
nodeid=59
[MYSQLD]
nodeid=58
[MYSQLD]
nodeid=57
[MYSQLD]
nodeid=56
[MYSQLD]
nodeid=55
[MYSQLD]
nodeid=54
[MYSQLD]
nodeid=53
[MYSQLD]
nodeid=52
[MYSQLD]
nodeid=51
[MYSQLD]
nodeid=50
[MYSQLD]
nodeid=49
[MYSQLD]
nodeid=48
[MYSQLD]
nodeid=47
[MYSQLD]
nodeid=46

Start ndbds, mgmds using:
/usr/local/mysql/bin/ndb_mgmd --nodaemon --no-nodeid-checks --config-file=/var/lib/mysql-cluster/config-nortel.ini &
/usr/local/mysql/bin/ndb_mgmd --nodaemon --no-nodeid-checks --config-file=/var/lib/mysql-cluster/config-nortel.ini --ndb-connectstring="nodeid=62;localhost:23131,localhost:23132" &
/usr/local/mysql/bin/ndbd --initial --ndb-connectstring="nodeid=1;localhost:23131,localhost:23132" --nodaemon --nostart &
/usr/local/mysql/bin/ndbd --initial --ndb-connectstring="nodeid=2;localhost:23131,localhost:23132" --nodaemon --nostart &

/usr/local/mysql/bin/mysqld --defaults-file=/etc/my-nortel.cnf &

Commands:

>ndb_mgm --ndb-connectstring="nodeid=51:localhost:23131,localhost:23132"

ndb_mgm>all start
[Wait for ndbds to start]

ndb_mgm>show
ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @127.0.0.1  (Version: 5.1.12, Nodegroup: 0, Master)
id=2    @127.0.0.1  (Version: 5.1.12, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=62   @127.0.0.1  (Version: 5.1.12)
id=63 (not connected, accepting connect from localhost)

[mysqld(API)]   16 node(s)
id=46 (not connected, accepting connect from any host)
id=47 (not connected, accepting connect from any host)
id=48   @127.0.0.1  (Version: 5.1.12)
id=49 (not connected, accepting connect from any host)
id=50 (not connected, accepting connect from any host)
id=51 (not connected, accepting connect from any host)
id=52 (not connected, accepting connect from any host)
id=53 (not connected, accepting connect from any host)
id=54 (not connected, accepting connect from any host)
id=55 (not connected, accepting connect from any host)
id=56 (not connected, accepting connect from any host)
id=57 (not connected, accepting connect from any host)
id=58 (not connected, accepting connect from any host)
id=59 (not connected, accepting connect from any host)
id=60 (not connected, accepting connect from any host)
id=61 (not connected, accepting connect from any host)

>ndb_config --ndb-connectstring="nodeid=51:localhost:23131,localhost:23132" -q Diskless

Unable to connect with connect string: nodeid=0,localhost:1186
Retrying every 5 seconds. Attempts left: 2
[2 Nov 2006 14:39] Jim Dowling
In the previous report, I noticed only one of my ndb_mgmds was running.
However, the problem still occurs when i have 2 mgmds running.

Note: there is no problem running ndb_config with only a single ndb_mgmd, and we had no problems with 5.1.11.

ndb_mgm> show
Connected to Management Server at: localhost:23131
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @127.0.0.1  (Version: 5.1.12, Nodegroup: 0, Master)
id=2    @127.0.0.1  (Version: 5.1.12, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=62   @127.0.0.1  (Version: 5.1.12)
id=63   @127.0.0.1  (Version: 5.1.12)

[mysqld(API)]   16 node(s)
id=46 (not connected, accepting connect from any host)
id=47 (not connected, accepting connect from any host)
id=48   @127.0.0.1  (Version: 5.1.12)
id=49 (not connected, accepting connect from any host)
id=50 (not connected, accepting connect from any host)
id=51 (not connected, accepting connect from any host)
id=52 (not connected, accepting connect from any host)
id=53 (not connected, accepting connect from any host)
id=54 (not connected, accepting connect from any host)
id=55 (not connected, accepting connect from any host)
id=56 (not connected, accepting connect from any host)
id=57 (not connected, accepting connect from any host)
id=58 (not connected, accepting connect from any host)
id=59 (not connected, accepting connect from any host)
id=60 (not connected, accepting connect from any host)
id=61 (not connected, accepting connect from any host)

mysql@jdowling-laptop:/var/lib/mysql-cluster$ ndb_config --ndb-connectstring="nodeid=50:localhost:23131,localhost:23132" -q Diskless Unable to connect with connect string: nodeid=0,localhost:1186
Retrying every 5 seconds. Attempts left: 2
[2 Nov 2006 21:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/14774

ChangeSet@1.2282, 2006-11-02 22:05:02+01:00, hartmut@walhalla.site +1 -0
  Fix for Bug #23887 (Introduced by Bugfix #22295)
[2 Nov 2006 21:17] Hartmut Holzgraefe
parsing the command line option is indeed broken but taking the connect string from the environment works so the following can be used as a workaround:

NDB_CONNECTSTRING="localhost:23131,localhost:23132" ndb_config -q Diskless
[13 Nov 2006 16:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/15251

ChangeSet@1.2284, 2006-11-13 17:04:40+01:00, hartmut@mysql.com +1 -0
  Fix for Bug #23887 (Introduced by Bugfix #22295)
[11 Dec 2006 6:41] Jon Stephens
Please note: the 5.0 Manual states that the NDB_CONNECTSTRING environment variable is deprecated and should no longer be used; see http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-connectstring.html fro details.
[11 Dec 2006 6:52] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix for 5.0.32 and 5.1.15.