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
my.cnf, removing these two lines of
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?
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.
Here are the changes i made to make this work:
- add empty api node at the end of mgmd config.ini:
- stop both of ndbd from mgmd:
ndb_mgm -e "3 stop" | "4 stop"
- stop both of mgmd:
ndb_mgm -e "1 stop" | "2 stop"
- start mgmd 1:
ndb_mgmd --initial --reload --config-file=/var/lib/mysql-cluster/config.ini
- start mgmd 2:
ndb_mgmd --initial --config-file=/var/lib/mysql-cluster/config.ini
- start ndbd manually: ssh to the machine and run
- wait until all node connected
- make sure my.cnf at mysql node is having:
[mysql_cluster] ndb-connectstring=192.168.1.1,192.168.1.2, or can add
-con ndb_desc param later
- 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 🙂