config file and parameters for ndb_desc

All we need is an easy explanation of the problem, so here it is.

I’m trying to execute ndb_desc from API client. The config and parameters are as below:

my.cnf in mysqld:

[mysql_cluster]
ndb-connectstring=192.168.1.1,192.168.1.2

server-id=5
log-bin=mysql-bin

config.ini in mgmd: (part of it)

-- ...
[mysqld]
hostname=192.168.1.5
--- ...

Situation: there are 2x mgmd, 2x data-node, and 2x mysqld.

Parameters tried to call ndb_desc: # ndb_desc -c 192.168.1.1 --ndb-nodeid=7 -d db_name -t tb_name

Above response with error: ndb_desc: [ERROR] unknown variable 'server-id=5

On changing my.cnf, removing these two lines of server-id and log-bin, then the error response after calling ndb_desc will be as follow:

Unable to connect to management server. 
NDBT_ProgramExit: 1 - Failed

There is no firewall, ping to the management is running fine.

So the question: how to exec ndb_desc (with correct parameters)? what is the correct my.cnf/config.ini for setting up the node-id?

Some links i have tried to check before posting this:
mysql-cluster-work-well-but-ndb-desc-doesnt-work, mysql:ndb_desc, mysql:connection-string, grokbase, and several hours of googling around.

update1: changed the config.ini on mgmd for emtpy mysqld section, ndb_mgm -e show output:

[mysqld(API)]   3 node(s)
id=5    @192.168.1.5  (mysql-5.7.23 ndb-7.6.7)
id=6    @192.168.1.6  (mysql-5.7.23 ndb-7.6.7)
id=7 (not connected, accepting connect from any host)

ndb_desc still has the same response: Unable to connect to management server.

update2: from mgmd node, saw this log: WARNING -- Failed to allocate nodeid for API at 192.168.1.5. Returned error: 'Id 7 already allocated by another node.

update3: changed config.ini, added [api] nodeid=7 host=192.168.1.5. log still the same: WARNING -- Failed to allocate nodeid for API at 192.168.11.51. Returned error: 'No free node id found for mysqld(API).

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Here are the changes i made to make this work:

  1. add empty api node at the end of mgmd config.ini: [api]
  2. stop both of ndbd from mgmd: ndb_mgm -e "3 stop" | "4 stop"
  3. stop both of mgmd: ndb_mgm -e "1 stop" | "2 stop"
  4. start mgmd 1: ndb_mgmd --initial --reload --config-file=/var/lib/mysql-cluster/config.ini
  5. start mgmd 2: ndb_mgmd --initial --config-file=/var/lib/mysql-cluster/config.ini
  6. start ndbd manually: ssh to the machine and run ndbd
  7. wait until all node connected
  8. make sure my.cnf at mysql node is having: [mysql_cluster] ndb-connectstring=192.168.1.1,192.168.1.2, or can add -c on ndb_desc param later
  9. run ndb_desc at mysql node: ndb_desc -p -d db_name -t tb_name

the important missing part after adding empty api node is restarting the data node

link to source: No free node id found

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply