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