1

I am trying to setup mysql cluster within aws autoscaling group. I am starting out with two ec2 instances, each with their own management(ndb_mgmd), data (ndbmtd) and sql (mysqld) node. When scaling out (I have configured live scale out which works fine), it adds two more ec2 instances (because the number of replication is set to 2 for ndbd) and creates a new nodegroup.

Now since I cant control exactly which instances aws shuts down during a scale-in event, it always takes out a whole nodegroup rendering the cluster invalid and causing it to crash.

From what I can see mysql cluster is not really designed to scale-in online, but is there a way I can achieve this without bringing the whole system down for maintenance? The idea is to add new identical instances to the cluster during scale-out and take instances off during scale-in events fired by aws autoscaling group.

Let me know if I missed out on any details, cheers!

This is what the initial config looks like:

Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @10.0.0.149  (mysql-5.6.31 ndb-7.4.12, Nodegroup: 0, *)
id=2    @10.0.0.81  (mysql-5.6.31 ndb-7.4.12, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=101  @10.0.0.149  (mysql-5.6.31 ndb-7.4.12)
id=102  @10.0.0.81  (mysql-5.6.31 ndb-7.4.12)

[mysqld(API)]   2 node(s)
id=51   @10.0.0.149  (mysql-5.6.31 ndb-7.4.12)
id=52   @10.0.0.81  (mysql-5.6.31 ndb-7.4.12)

This is an example of scaled out version of the same cluster (+2 instances):

Cluster Configuration
---------------------
[ndbd(NDB)]     4 node(s)
id=1    @10.0.0.149  (mysql-5.6.31 ndb-7.4.12, Nodegroup: 0, *)
id=2    @10.0.0.81  (mysql-5.6.31 ndb-7.4.12, Nodegroup: 0)
id=3    @10.0.0.151  (mysql-5.6.31 ndb-7.4.12, Nodegroup: 1)
id=4    @10.0.0.83  (mysql-5.6.31 ndb-7.4.12, Nodegroup: 1)

[ndb_mgmd(MGM)] 4 node(s)
id=101  @10.0.0.149  (mysql-5.6.31 ndb-7.4.12)
id=102  @10.0.0.81  (mysql-5.6.31 ndb-7.4.12)
id=103  @10.0.0.151  (mysql-5.6.31 ndb-7.4.12)
id=104  @10.0.0.83  (mysql-5.6.31 ndb-7.4.12)

[mysqld(API)]   4 node(s)
id=51   @10.0.0.149  (mysql-5.6.31 ndb-7.4.12)
id=52   @10.0.0.81  (mysql-5.6.31 ndb-7.4.12)
id=53   @10.0.0.151  (mysql-5.6.31 ndb-7.4.12)
id=54   @10.0.0.83  (mysql-5.6.31 ndb-7.4.12)
fahad.hasan
  • 902
  • 8
  • 16

0 Answers0