Failed to allocate nodeid, error: 'Error: Could not alloc node id

Failed to allocate nodeid, error: 'Error: Could not alloc node id

ndb_mgmd 似乎没有正确读取配置文件

这是我的配置文件的一部分

[ndbd]
# Options for data node "A":
                                # (one [ndbd] section per data node)
hostname=abhyas.db01            # Hostname or IP address
datadir=/usr/local/mysql/data   # Directory for this data node's data files

[ndbd]
# Options for data node "B":
hostname=abhyas.db02            # Hostname or IP address
datadir=/usr/local/mysql/data   # Directory for this data node's data files

[mysqld]
# SQL node options:
hostname=abhyas.dbmgr           # Hostname or IP address
                                # (additional mysqld connections can be
                                # specified for this node for various
                                # purposes such as running ndb_restore)

但是

ndb_mgm

显示一些不同的东西

[root@abhyas abhyas_mgr]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> SHOW
Connected to Management Server at: abhyas.dbmgr:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 (not connected, accepting connect from abhyas.db01)
id=3 (not connected, accepting connect from abhyas.db01)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.102.134  (mysql-5.6.25 ndb-7.4.7)

[mysqld(API)]   1 node(s)
id=4 (not connected, accepting connect from abhyas.dbmgr)

ndb_mgm> EXIT

如您所见,在我的配置文件中,我将 abhyas.db01abhyas.db02 作为主机。

但是集群配置将 NDB 节点显示为两个节点,均来自 abhyas.db01。 (这不是我想要的,至少现在不是)。

[ndbd(NDB)] 2 node(s)
id=2 (not connected, accepting connect from abhyas.db01)
id=3 (not connected, accepting connect from abhyas.db01)

现在,我错误地启动了 ndb_mgmd,config.ini 文件有 [ndbd] 个条目都指向 abhyas.db01,但我立即关闭了 ndb_mgm 并更改配置文件中的条目以显示我在上面粘贴的内容。

但由于某些原因,ndb_mgmd 仍然采用旧配置?

我该如何解决这个问题?

谢谢。

PS - 不,这不是防火墙问题。 iptables 已关闭。此外,来自 abhyas.db01 的 ndbd 无论如何都能够成功连接。

没关系,想通了。

只需在启动时指定 --reload 选项 ndb_mgmd

ndb_mgmd --reload --config-file /home/abhyas_mgr/config.ini 

[root@abhyas bin]# ndb_mgmd --reload --config-file /home/abhyas_mgr/config.ini 
MySQL Cluster Management Server mysql-5.6.25 ndb-7.4.7
[root@abhyas bin]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: abhyas.dbmgr:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 (not connected, accepting connect from abhyas.db01)
id=3 (not connected, accepting connect from abhyas.db02)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.102.134  (mysql-5.6.25 ndb-7.4.7)

[mysqld(API)]   1 node(s)
id=4 (not connected, accepting connect from abhyas.dbmgr)

ndb_mgm> 

中提琴!

@anu 的回答是正确的。 但首先 - 您需要先关闭管理集群 PID,方法是发出命令 -

ndb_mgm -e "SHUTDOWN"

然后,--reload

ndb_mgmd --reload --config-file /var/lib/mysql-cluster/config.ini