MySQL Forums
Forum List  »  NDB clusters

Re: Failed to allocate nodeid, error: 'Error: Could not alloc node id at .. : Connection done from wrong host
Posted by: Mikael Ronström
Date: July 11, 2017 03:33AM

In your configuration file you have the following ndbd sections:
[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
HostName=10.215.2.72 # Hostname or IP address
NodeId=2 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files

[ndbd]
# Options for data node "B":
HostName=10.215.2.73 # Hostname or IP address
NodeId=3 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files

This means that you have decided to have 2 NDB data nodes.
The first one on host 10.215.2.72 with node id 2 and the second one
on 10.215.2.73 with node id 3.

As you see in the output from ndb_mgm these are both started.
(Obviously the configuration file actually used have them as
node id 1 and 2 rather than 2 and 3, but this doesn't change
anything).

SQL2# ndb_mgm -e show
Connected to Management Server at: 10.215.2.74:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=1 @10.215.2.70 (mysql-5.7.18 ndb-7.5.6, Nodegroup: 0, *)
id=2 @10.215.2.71 (mysql-5.7.18 ndb-7.5.6, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=5 @10.215.2.74 (mysql-5.7.18 ndb-7.5.6)

[mysqld(API)] 2 node(s)
id=3 (not connected, accepting connect from 10.215.2.72)
id=4 (not connected, accepting connect from 10.215.2.73)

So after this step you have a cluster up and running.
Now the nodes that are still not started are MySQL Servers,
not NDB data nodes.

So the 3rd and 4th nodes you want to start are not ndbd
programs, it is mysqld programs.

In NDB the MySQL Servers is what your application program
will work towards as for a normal MySQL Server. The actual
data will however be stored in the NDB data nodes.
So you need to start both an ndbd and a mysqld on the two
hosts 10.215.2.72 and 10.215.2.73.

I assume from reading your posts that you are actually not
trying to setup a cluster with 4 data nodes.

If you actually want to set up a cluster with 4 data nodes,
then you need to add two more ndbd sections like this:

[ndbd]
# Options for data node "A":
# (one [ndbd] section per data node)
HostName=10.215.2.72 # Hostname or IP address
NodeId=4 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files

[ndbd]
# Options for data node "B":
HostName=10.215.2.73 # Hostname or IP address
NodeId=5 # Node ID for this data node
DataDir=/usr/local/mysql/data # Directory for this data node's data files

Probably you want to have them on different hosts though since it is
usually sufficient to have data node per host.

A little rule of thumb for ensuring easy growth of the cluster is to use
the following node id ranges.

Use node id 1-48 only for data nodes.
Use node id 49-52 only for NDB management servers.
Use node id 53-255 for API nodes and MySQL Servers.

This isn't necessary, but makes it possible to grow the
cluster from 2 data nodes to 48 data nodes by adding nodes
as your needs grows.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Failed to allocate nodeid, error: 'Error: Could not alloc node id at .. : Connection done from wrong host
26
July 11, 2017 03:33AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.