cluster中data node启动花费的时间较长

本文详细记录了一个包含三个节点的集群启动过程,包括各阶段的状态变化及耗时情况。特别关注了数据节点启动慢的问题,并记录了从初始化到完成各阶段的时间线。作者希望能够找到优化启动时间的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

cluster中角色分配如下:

主机1: ***.***.***.1 mgm node (nodeid=1)

主机2: ***.***.***.2 data node + sql node (nodeid=2 + nodeid=4)

主机3: ***.***.***.3 data node + sql node (nodeid=3 + nodeid=5)

在数据节点的启动时,花费将近20分钟,之前已经在SQL节点导入数据库初始化表,所以在数据节点的启动过程中,将会为每个表重新分配主索引和有序索引的空间,这将花费较长的时间。但是本人感觉启动时间确实有点长,与这些相关的原因还不清楚,希望各位可以加以建议。谢谢!

启动过程:

-- Nodeid 2 allocated for NDB at 主机 2;

-- Node 1: Node 2 Connected

-- Node 2: Start phase 0 completed

-- Node 2: Communication to Node 3 opened

-- Node 2: Waiting 30 sec for nodes 3 to connect, nodes [ all: 2 and 3 connected: 2 no-wait: ] # 在启动节点2之后,需要立即启动节点3;

-- Nodeid 3 allocated for NDB at 主机3;

-- Node 1: Node 3 Connected

-- Node 3: Start phase 0 completed

-- Node 3: Communication to Node 2 opened

-- Node 3: Waiting 30 sec for nodes 2 to connect, nodes [ all: 2 and 3 connected: 3 no-wait: ]

-- Node 3: Node 2 Connected

-- Node 2: Node 3 Connected

-- Node 2: Start with all nodes 2 and 3

-- Node 2: CM_REGCONF president = 2, own Node = 2, our dynamic id = 0/1

-- Node 3: CM_REGCONF president = 2, own Node = 3, our dynamic id = 0/2

-- Node 2: Node 3: API mysql-5.5.27 ndb-7.2.8

-- Node 3: Node 2: API mysql-5.5.27 ndb-7.2.8

-- Node 3: Start phase 1 completed

-- Node 2: Start phase 1 completed

-- Node 3: Start phase 2 completed (system restart)

-- Node 2: Start phase 2 completed (system restart)

-- Node 2: Start phase 3 completed (system restart)

-- Node 3: Start phase 3 completed (system restart)

-- Node 2: Restarting cluster to GCI: 42850

-- Node 2: Starting to restore schema

-- Node 2: Restore of schema complete

-- Node 3: Starting to restore schema

-- Node 3: Restore of schema complete

-- Node 2: DICT: activate index 9 done (sys/def/8/ndb_index_stat_sample_x1)

-- Node 2: DICT: activate index 11 done (sys/def/10/PRIMARY)

......

-- Node 2: DICT: activate index 1971 done (sys/def/1969/PRIMARY) # 索引的大小需要看数据库中表的大小以及为每个表指定的主键、唯一性约束等;

-- Node 2: Node: 2 StartLog: [GCI Keep: 42473 LastCompleted: 42850 NewestRestorable: 42850]

-- Node 2: Node: 3 StartLog: [GCI Keep: 42473 LastCompleted: 42850 NewestRestorable: 42850]

-- Node 3: LQH: Starting to rebuild ordered indexes #为何这样做还尚未搞清楚;

-- Node 3: LQH: index 9 rebuild done

......

-- Node 3: LQH: index 174 rebuild done

-- Node 2: LQH: Starting to rebuild ordered indexes

-- Node 2: LQH: index 9 rebuild done

......

-- Node 3: LQH: index 184 rebuild done

-- Node 1: Node 2 Disconnected

-- Node 1: Node 3 Disconnected

-- Node 1: Node 2 Connected

-- Node 1: Node 3 Connected

-- Node 2: Local checkpoint 40 completed

-- Node 2: Start phase 5 completed (system restart)

-- Node 3: Start phase 5 completed (system restart)

-- Node 2: President restarts arbitration thread [state=1]

-- Node 2: Start phase 101 completed (system restart)

-- Node 3: Start phase 101 completed (system restart)

-- Node 2: Started (mysql-5.5.27 ndb-7.2.8)

-- Node 3: Started (mysql-5.5.27 ndb-7.2.8)

-- Node 2: Node 1: API mysql-5.5.27 ndb-7.2.8

-- Node 3: Node 1: API mysql-5.5.27 ndb-7.2.8

-- Node 3: Communication to Node 4 opened

-- Node 3: Communication to Node 5 opened

-- Node 3: Prepare arbitrator node 1 [ticket=0de2000100109070]

-- Node 2: Started arbitrator node 1 [ticket=0de2000100109070]

-- Node 2: Communication to Node 4 opened

-- Node 2: Communication to Node 5 opened




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值