mysql集群报错 'No free node id found for mysqld(API).'

发布于 2022-09-06 05:59:46 字数 3680 浏览 13 评论 0

错误描述

Mysql集群的sql node无法连上,mgm

mgm日志错误信息如下

2017-11-27 20:28:35 [MgmtSrvr] WARNING  -- Failed to allocate nodeid for API at 192.168.1.104. Returned error: 'No free node id found for mysqld(API).'
2017-11-27 20:28:36 [MgmtSrvr] INFO     -- Alloc node id 4 failed, no new president yet
2017-11-27 20:28:37 [MgmtSrvr] INFO     -- Alloc node id 4 failed, no new president yet - Repeated 5 times
2017-11-27 20:28:37 [MgmtSrvr] INFO     -- Node 3: Initial start, waiting for 2 to connect,  nodes [ all: 2 and 3 connected: 3 no-wait:  ]

mysql服务错误信息(sql node)

2017-11-28T03:18:43.565265Z 4 [Warning] NDB: Failed to acquire global schema lock, error: (4009)Cluster Failure
2017-11-28T03:18:43.566664Z 4 [Warning] NDB: Failed to acquire global schema lock, error: (4009)Cluster Failure
2017-11-28T03:18:43.569894Z 4 [Warning] NDB: Failed to acquire global schema lock, error: (4009)Cluster Failure
2017-11-28T03:18:43.570676Z 4 [Warning] NDB: Failed to acquire global schema lock, error: (4009)Cluster Failure

mgm show信息

ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]    2 node(s)
id=2    @192.168.1.101  (mysql-5.7.20 ndb-7.5.8, starting, Nodegroup: 0)
id=3    @192.168.1.102  (mysql-5.7.20 ndb-7.5.8, starting, Nodegroup: 0)

[ndb_mgmd(MGM)]    1 node(s)
id=1    @192.168.1.103  (mysql-5.7.20 ndb-7.5.8)

[mysqld(API)]    3 node(s)
id=4 (not connected, accepting connect from any host)

配置信息

说明

  • 服务器:linux centos 7
  • mysql-cluster: mysql-cluster-community-7.5.8-1.el7.x86_64.rpm-bundle

服务器信息

IP节点名称描述
192.168.1.103mgm集群管理节点
192.168.1.101data node集群数据节点
192.168.1.102data node集群数据节点
192.168.1.104sql node集群mysqld节点

mgm配置信息

[ndbd default]
NoOfReplicas=2        # Number of replicas
DataMemory=80M        # How much memory to allocate for data storage
IndexMemory=18M        # How much memory to allocate for index storage
ServerPort=2202

[ndb_mgmd]
HostName=192.168.1.103        # Hostname or IP address of MGM node
DataDir=/var/lib/mysql-cluster    # Directory for MGM node log files

[ndbd]
HostName=192.168.1.101        # Hostname or IP address
NodeId=2            # Node ID for this data node
DataDir=/opt/mysql/data        # Directory for this data node's data files

[ndbd]
HostName=192.168.1.102        # Hostname or IP address
NodeId=3            # Node ID for this data node
DataDir=/opt/mysql/data        # Directory for this data node's data files

[mysqld]
# SQL node options:
HostName=192.168.1.104
NodeId=4

mysql 配置

[mysqld]
user=mysql
ndbcluster
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

symbolic-links=0
default-storage-engine=NDBCLUSTER
ndb-connectstring=192.168.1.103

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql_cluster]
ndb-connectstring=192.168.1.103

我的启动顺序

mgm(103) -> data node1(101) -> data node2(102) -> sql node(104)

已尝试过的方法

  • mgm中添加空的[mysqld]
  • 重装mysql
  • mysql5.7版本中没有mysql_safe所以无法尝试这种方法

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云仙小弟 2022-09-13 05:59:46

你DataNode都还没起来
先把DataNode起来再看

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文