Migrating/importing NDB to Cluster Manager w/ version upgrade.

I’ve had some questions from people using MySQL Cluster GPL and wanting to move to using MySQL Cluster Carrier Grade Edition, i.e., they want to use MySQL Cluster Manager, MCM, to make their lives much easier, in particular, upgrading (as well as config change ease and backup history).

All I want to do here is to share with you my personal experience on migrating what’s considered a ‘wild’ NDB Cluster to a MCM managed cluster. It’s just as simple to follow the manual chapter Importing a Cluster into MySQL Cluster Manager so at least you can see how I did it, and it might help someone.

[ If you’re not migrating but just looking for further information on NDB Cluster, and came across this post, please please PLEASE look at the MySQL Cluster: Getting Started page, in particular the Evaluation Guide. ]

So, what’s the scenario:

  • NDB 7.3 (migrating to 7.4)
  • Centos 6.5
  • 4 vm’s / 4 servers: 2x datanodes (dn1 & dn2), 2x sqlnodes (sn1 & sn2) & 1x mgmt node (sn1).

Technical objective:

  • To upgrade NDB to 7.4 (or follow the procedure to go from/to any ‘consecutive’ versions).

Personal objective:

  • Share that this process can be done, how it’s done, and share the issues that I came across in my non-production environment.

Let’s take for granted that your wild cluster is installed and working with a similar configuration to:

  • Installed as o.s. root user (and all files are owned:grouped as such…).
  • mysql o.s. user exists.
  • tarball install / binaries are all found at /usr/local
  • Datadirs are at /opt/mysql/738: mgm_data (for management node logs), ndbd_data (for datanode info) & data (for sqlnodes).
  • config.ini & my.cnf are found at $BASEDIR/conf (created this dir myself ‘cos I’m like that).
  • All other things are default, i.e. sqlnode / datanode / mgmtnode ports, sockets are located in datadirs, etc.
  • There are some changes in the config files, as would be in a prod env.

And the cluster setup looks something like this

# ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=3 @10.0.0.12 (mysql-5.6.22 ndb-7.3.8, Nodegroup: 0, *)
id=4 @10.0.0.13 (mysql-5.6.22 ndb-7.3.8, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1 @10.0.0.10 (mysql-5.6.22 ndb-7.3.8)

[mysqld(API)] 5 node(s)
id=10 @10.0.0.10 (mysql-5.6.22 ndb-7.3.8)
id=11 @10.0.0.11 (mysql-5.6.22 ndb-7.3.8)
id=12 (not connected, accepting connect from any host)
id=13 (not connected, accepting connect from any host)
id=14 (not connected, accepting connect from any host)

Getting ready:

Remember, all I’m doing here is sharing my experience of following Importing a Cluster into MySQL Cluster Manager so hopefully it will help someone see it in a different env, and for a specific use (upgrade, go CGE, etc.).

Preparing wild cluster:

In order to import the wild cluster into MCM, we need to ‘shape’or ‘tame’ the wild cluster, that is, to adjust certain configuration not normally found nor done in a cluster environment, in order to allow the import process to be successful.
On both of the sqlnodes, we need a mcmd user, other wise it’s going to be impossible for MCM to manage them:

mysql> CREATE USER 'mcmd'@'localhost' IDENTIFIED BY 'super';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'mcmd'@'localhost' WITH GRANT OPTION;

Every node of the wild cluster has been started with its node ID specified with the –ndb-nodeid option at the command line:

# ps -ef | grep ndb
root 3025    1 0 Aug16 ? 00:00:25 ndbmtd -c 10.0.0.10 --initial
root 3026 3025 8 Aug16 ? 01:24:30 ndbmtd -c 10.0.0.10 --initial

And also management node has to be started without caching the config. Changing / restarting each process (both sqlnodes & dnodes) can be done in this point making both changes at the same time / same restart:

# ndb_mgmd --configdir=/usr/local/mysql-cluster-gpl-7.3.8-linux-glibc2.5-x86_64/conf \
-f /usr/local/mysql-cluster-gpl-7.3.8-linux-glibc2.5-x86_64/conf/config.ini \
--config-cache=false --ndb-nodeid=1
MySQL Cluster Management Server mysql-5.6.22 ndb-7.3.8
2017-08-17 08:35:57 [MgmtSrvr] INFO -- Skipping check of config directory since config cache is disabled.

# ps -ef | grep ndb
root 3560    1 0 08:42 ? 00:00:00 ndbmtd --ndb-nodeid=3 -c 10.0.0.10
root 3561 3560 8 08:42 ? 00:00:48 ndbmtd --ndb-nodeid=3 -c 10.0.0.10

root 3694    1 0 08:38 ? 00:00:00 ndbmtd --ndb-nodeid=4 -c 10.0.0.10
root 3695 3694 8 08:38 ? 00:00:16 ndbmtd --ndb-nodeid=4 -c 10.0.0.10

# ps -ef | grep mysqld
mysql 3755 2975 7 08:49 pts/0 00:00:00 mysqld --defaults-file=/usr/local/mysql/conf/my.cnf --user=mysql --ndb-nodeid=10

mysql 3694 2984 2 08:50 pts/0 00:00:01 mysqld --defaults-file=/usr/local/mysql/conf/my.cnf --user=mysql --ndb-nodeid=11

Ok, all well and good up to here.

Just a word of warning, the MCM daemon, mcmd, that runs on all servers of a cluster platform, can not be run as the os user ‘root’, hence, normally is run as ‘mysql’. This means that all the other processes of our wild cluster should be run as ‘mysql’ too. Other wise, the mcmd daemon can’t bring under control these processes (stop/start, etc.) This also impacts the file permissions (data files, pid files, logs, directories) so maybe it’s a good time to do that now, as we’re talking about a production environment. SOOOOOOO, when we stop the management node to restart it, let’s make that change, first file & directory perms, and then starting the process itself. As you probably won’t have separate binaries for each process, and the management node(s) will/should be sharing binaries with the sqlnodes, changing ownership of the files / dir’s shouln’t be too much of a problem.

eg. On sn1 (for the management node restart only):

# cd /opt/mysql/738
# chown -R mysql:mysql .
# ls -lrt
total 16
drwxr-xr-x. 7 mysql mysql 4096 ago 17 11:40 data
drwxr-xr-x. 2 mysql mysql 4096 ago 17 13:01 mgm_data
# chown -R mysql:mysql .
# ls -lrt 
total 180
-rw-r--r--.  1 mysql mysql   2496 ene 9 2015 README
-rw-r--r--.  1 mysql mysql  17987 ene 9 2015 COPYING
-rw-r--r--.  1 mysql mysql 101821 ene 9 2015 INSTALL-BINARY
drwxr-xr-x.  4 mysql mysql   4096 ago 16 15:25 include
drwxr-xr-x.  2 mysql mysql   4096 ago 16 15:26 bin
drwxr-xr-x.  3 mysql mysql   4096 ago 16 15:26 lib
drwxr-xr-x. 32 mysql mysql   4096 ago 16 15:26 share
drwxr-xr-x.  2 mysql mysql   4096 ago 16 15:26 support-files
drwxr-xr-x.  2 mysql mysql   4096 ago 16 15:26 docs
drwxr-xr-x.  3 mysql mysql   4096 ago 16 15:26 data
drwxr-xr-x.  4 mysql mysql   4096 ago 16 15:26 man
drwxr-xr-x.  4 mysql mysql   4096 ago 16 15:26 sql-bench
drwxr-xr-x.  2 mysql mysql   4096 ago 16 15:26 scripts
drwxr-xr-x. 10 mysql mysql   4096 ago 16 15:26 mysql-test
-rw-r--r--.  1 mysql mysql    943 ago 16 16:04 my.cnf
-rw-r--r--.  1 mysql mysql    943 ago 16 16:04 my-new.cnf
drwxr-xr-x.  2 mysql mysql   4096 ago 16 16:19 conf
# pwd
/usr/local/mysql

Now it’s time to kill the dnode angel process in preparation for MCM to control the processes (otherwise when MCM stops that process, the angel process tries to restart it, out of MCM’s control and that’s when we hit problems):

# ps -ef | grep ndb
root 3560 1 0 08:42 ? 00:00:02 ndbmtd --ndb-nodeid=3 -c 10.0.0.10
root 3561 3560 8 08:42 ? 00:08:32 ndbmtd --ndb-nodeid=3 -c 10.0.0.10

# kill -9 3560
# ps -ef | grep ndb
root 3561 1 8 08:42 ? 00:08:38 ndbmtd --ndb-nodeid=3 -c 10.0.0.10

# ps aux | grep ndb
root 3561 8.6 63.9 1007296 474120 ? SLl 08:42 8:38 ndbmtd --ndb-nodeid=3 -c 10.0.0.10

Do on both dnodes.

Now we have to adust the .pid files within the dnode’s datadir as it holds the angel process ID:

# cd /opt/mysql/738/ndbd_data/
# ls -lrt
-rw-r--r--. 1 mysql mysql 4 Aug 17 13:20 ndb_3.pid
# sed -i 's/3560/3561/' ndb_3.pid
# more ndb_3.pid
3561

Again, to be done on both dnodes.

Now for the sqlnodes, we have to rename the actual name of the pid file, not the contents :

# cd /opt/mysql/738/data/
# ls -lrt *.pid
-rw-rw----. 1 mysql mysql 5 ago 17 08:49 sn1.pid

# more *.pid
3755

# ps -ef | grep mysqld | grep -v grep
mysql 3755 2975 1 08:49 pts/0 00:02:27 mysqld --defaults-file=/usr/local/mysql/conf/my.cnf --user=mysql --ndb-nodeid=10

Time to copy, not replace, the .pid file to have a cluster-ready naming convention (ndb_.pid):

# cp sn1.pid ndb_10.pid

On the other sqlnode:

# cd /opt/mysql/738/data/
# cp sn2.pid ndb_11.pid

Now time to create the MCM-managed Cluster to import into.

First up, we’ll need an MCM datadir, to store the datadirs, logs, etc. (if you want to change this later, it’s so much easier from MCM, using the “set” command, so just do it then):

# mkdir /opt/mysql/748/mcm_data
# cd /opt/mysql/748/mcm_data
# chown -R mysql:mysql .

As mcmd needs to run as mysql, change permissions of the binaries and also add the manager-directory of your choice:

# cd /usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/mcm1.4.0/etc
# chgrp -R mysql .

# vi mcmd.ini
   ..  
   manager-directory = /opt/mysql/748/mcm_data

Let’s make it easier in our env to execute all this:

# su - mysql
# vi .bash_profile
   ..
   export PATH=$PATH:/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/mcm1.4.0/bin

And let’s start MySQL Cluster Manager, i.e. mcmd, as the o.s. user ‘mysql’:

# mcmd --defaults-file=/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/mcm1.4.0/etc/mcmd.ini --daemon

Ok. All working fine.

Let’s create the cluster to import into.

Ok, so I used the o.s. root user to create everything. I suppose I’m used to it, but feel free to do it however you see fit. It won’t make any difference to mcmd as that’s running as mysql so carry on:

# sudo -i
# export PATH=$PATH:/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/mcm1.4.0/bin

# mcm

MCM needs a site with all the hosts that make up the cluster. By the way, if you forget a command, or want to see what else is there, “list commands;”:

mcm> create site --hosts=10.0.0.10,10.0.0.11,10.0.0.12,10.0.0.13 mysite;

Add the path to the cluster binaries that we’re using now:

mcm> add package --basedir=/usr/local/mysql-cluster-gpl-7.3.8-linux-glibc2.5-x86_64 cluster738;

A little test here, thinking, “if mcm is so clever, maybe it can detect that we’re in 7.3.8 and we can use 7.4.8 and create the cluster in that version to import into, and we’ve upgraded and imported in one foul swoop!“. Alas, although that’s a nice idea, but after creating the cluster with the 748 package for import, and adding processes / nodes to the cluster, upon running the dryrun config check, it errors out :

mcm> add package --basedir=/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/cluster cluster748;
mcm> import config --dryrun mycluster;
ERROR 5307 (00MGR): Imported process version 7.3.8 does not match configured process mysqld 11 version 7.4.8 for cluster mycluster

So, back to the 7.3.8 binaries / package:

mcm> add package --basedir=/usr/local/mysql-cluster-gpl-7.3.8-linux-glibc2.5-x86_64 cluster738;
mcm> create cluster --import --package=cluster738 
--processhosts=ndb_mgmd:1@10.0.0.10,ndbmtd:3@10.0.0.12,ndbmtd:4@10.0.0.13,
mysqld:10@10.0.0.10,mysqld:11@10.0.0.11,ndbapi:12@*,ndbapi:13@*,ndbapi:14@* mycluster;

Now, this seems simple right? Ok, well it is, but you have to match the processhosts to those that appear in the “ndb_mgm -e show” out put, i.e. ndbapi/mysqld api entries that all appear there. So if you have 8 rows returned from that, you’ll need 8 entries in the –processhosts option. It will complain otherwise.

show status -r mycluster;
+--------+----------+-----------+--------+-----------+------------+
| NodeId | Process  | Host      | Status | Nodegroup | Package    |
+--------+----------+-----------+--------+-----------+------------+
| 1      | ndb_mgmd | 10.0.0.10 | import |           | cluster738 |
| 3      | ndbmtd   | 10.0.0.12 | import | n/a       | cluster738 |
| 4      | ndbmtd   | 10.0.0.13 | import | n/a       | cluster738 |
| 10     | mysqld   | 10.0.0.10 | import |           | cluster738 |
| 11     | mysqld   | 10.0.0.11 | import |           | cluster738 |
| 12     | ndbapi   | *         | import |           |            |
| 13     | ndbapi   | *         | import |           |            |
| 14     | ndbapi   | *         | import |           |            |
+--------+----------+-----------+--------+-----------+------------+
8 rows in set (0,05 sec)

Let’s do a test now we’ve got the 7.3.8 binaries assigned to the site and a shell cluster created:

mcm> import config --dryrun mycluster; 
ERROR 5321 (00MGR): No permissions for pid 3700 running on sn1

This means that processes are being executed / run by someone who isn’t the mcmd user, eg. root.
Now I need to go to each process and restart it as mysql (kill angel processes, etc.).
Also remember that mcmd can’t be run by root. As we fixed that at the beginning of this post (DIDN’T WE?) Well, I hope you don’t get that one.

+---------------------------------------------------------------------------+
| Command result                                                            |
+---------------------------------------------------------------------------+
| Import checks passed. Please check log for settings that will be applied. |
+---------------------------------------------------------------------------+
1 row in set (5.55 sec)

Now that all the checks are passed, it leads me to think: what about all the personalized config that I have in the config.ini & my.cnf files. Well, we could run:

mcm> set DataMemory:ndbmtd=20M, IndexMemory:ndbmtd=10M, DiskPageBufferMemory:ndbmtd=4M, StringMemory:ndbmtd=5, MaxNoOfConcurrentOperations:ndbmtd=2K, MaxNoOfConcurrentTransactions:ndbmtd=2K, SharedGlobalMemory:ndbmtd=500K, MaxParallelScansPerFragment:ndbmtd=16, MaxNoOfAttributes:ndbmtd=100, MaxNoOfTables:ndbmtd=20, MaxNoOfOrderedIndexes:ndbmtd=20, HeartbeatIntervalDbDb:ndbmtd=500, HeartbeatIntervalDbApi:ndbmtd=500, TransactionInactiveTimeout:ndbmtd=500, LockPagesInMainMemory:ndbmtd=1, ODirect:ndbmtd=1, MaxNoOfExecutionThreads:ndbmtd=4, RedoBuffer:ndbmtd=32M mycluster ;

+-----------------------------------+
| Command result                    |
+-----------------------------------+
| Cluster reconfigured successfully |
+-----------------------------------+
1 row in set (0.60 sec)

But there is no need, because MCM will do all that for you. As the refman mentions, we’ll need to go to the MCM manager directory and it’s in there:

# cd /opt/mysql/748/mcm_data/clusters/mycluster/tmp
# ls -lrt
-rw-rw-rw-. 1 mysql mysql 3284 Aug 17 13:43 import_config.a6905b23_225_3.mcm
mcm> import config mycluster;
+--------------------------------------------------------------------------------------------+
| Command result                                                                             |
+--------------------------------------------------------------------------------------------+
| Configuration imported successfully. Please manually verify the settings before proceeding |
+--------------------------------------------------------------------------------------------+
1 row in set (5.58 sec)

Now to import:

mcm> import cluster mycluster;

+-------------------------------+
| Command result                |
+-------------------------------+
| Cluster imported successfully |
+-------------------------------+
1 row in set (3.04 sec)

Let’s make sure the Status has changed from import:

mcm> show status -r mycluster;
+--------+----------+-----------+---------+-----------+------------+
| NodeId | Process  | Host      | Status  | Nodegroup | Package    |
+--------+----------+-----------+---------+-----------+------------+
| 1      | ndb_mgmd | 10.0.0.10 | running |           | cluster738 |
| 3      | ndbmtd   | 10.0.0.12 | running | 0         | cluster738 |
| 4      | ndbmtd   | 10.0.0.13 | running | 0         | cluster738 |
| 10     | mysqld   | 10.0.0.10 | running |           | cluster738 |
| 11     | mysqld   | 10.0.0.11 | running |           | cluster738 |
| 12     | ndbapi   | *         | added   |           |            |
| 13     | ndbapi   | *         | added   |           |            |
| 14     | ndbapi   | *         | added   |           |            |
+--------+----------+-----------+---------+-----------+------------+
8 rows in set (0.06 sec)

I know you’re probably eager to see if MCM 1.4 autotune works for 7.3 NDB’s. Well, it doesn’t I’m afraid:

mcm> autotune --dryrun --writeload=low realtime mycluster;
ERROR 5402 (00MGR): Autotuning is not supported for cluster version 7.3.8

Upgrade time:

mcm> list packages mysite;
+------------+---------------------------------------------------------------------+-----------------------------------------+
| Package    | Path                                                                | Hosts                                   |
+------------+---------------------------------------------------------------------+-----------------------------------------+
| cluster738 | /usr/local/mysql-cluster-gpl-7.3.8-linux-glibc2.5-x86_64            | 10.0.0.10,10.0.0.11,10.0.0.12,10.0.0.13 |
+------------+---------------------------------------------------------------------+-----------------------------------------+

mcm> add package --basedir=/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/cluster cluster748;

mcm> list packages mysite;
+------------+---------------------------------------------------------------------+-----------------------------------------+
| Package    | Path                                                                | Hosts                                   |
+------------+---------------------------------------------------------------------+-----------------------------------------+
| cluster738 | /usr/local/mysql-cluster-gpl-7.3.8-linux-glibc2.5-x86_64            | 10.0.0.10,10.0.0.11,10.0.0.12,10.0.0.13 |
| cluster748 | /usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/cluster | 10.0.0.10,10.0.0.11,10.0.0.12,10.0.0.13 |
+------------+---------------------------------------------------------------------+-----------------------------------------+
mcm> upgrade cluster --package=cluster748 mycluster;

In another window:

mcm> show status -r mycluster;
+--------+----------+-----------+---------+-----------+------------+
| NodeId | Process  | Host      | Status  | Nodegroup | Package    |
+--------+----------+-----------+---------+-----------+------------+
| 1      | ndb_mgmd | 10.0.0.10 | running |           | cluster748 |
| 3      | ndbmtd   | 10.0.0.12 | stopped | 0         | cluster738 |
| 4      | ndbmtd   | 10.0.0.13 | running | 0         | cluster738 |
| 10     | mysqld   | 10.0.0.10 | running |           | cluster738 |
| 11     | mysqld   | 10.0.0.11 | running |           | cluster738 |
| 12     | ndbapi   | *         | added   |           |            |
| 13     | ndbapi   | *         | added   |           |            |
| 14     | ndbapi   | *         | added   |           |            |
+--------+----------+-----------+---------+-----------+------------+
8 rows in set (0.05 sec)

Ok, all going well:

mcm> show status -r mycluster;
 +--------+----------+-----------+----------+-----------+------------+
 | NodeId | Process  | Host      | Status   | Nodegroup | Package    |
 +--------+----------+-----------+----------+-----------+------------+
 | 1      | ndb_mgmd | 10.0.0.10 | running  |           | cluster748 |
 | 3      | ndbmtd   | 10.0.0.12 | running  | 0         | cluster748 |
 | 4      | ndbmtd   | 10.0.0.13 | starting | 0         | cluster748 |
 | 10     | mysqld   | 10.0.0.10 | running  |           | cluster738 |
 | 11     | mysqld   | 10.0.0.11 | running  |           | cluster738 |
 | 12     | ndbapi   | *         | added    |           |            |
 | 13     | ndbapi   | *         | added    |           |            |
 | 14     | ndbapi   | *         | added    |           |            |
 +--------+----------+-----------+----------+-----------+------------+
 8 rows in set (0.08 sec)

But, life is never as good as it is in fairy tales:

ERROR 7006 (00MGR): Process error: Node 10 : 17-08-17 17:18:13 4449 [Note] NDB Util: Starting...
 2017-08-17 17:18:13 4449 [Note] NDB Util: Wait for server start completed
 2017-08-17 17:18:13 4449 [ERROR] Aborting

2017-08-17 17:18:13 4449 [Note] Binlog end
 2017-08-17 17:18:13 4449 [Note] NDB Util: Stop
 2017-08-17 17:18:13 4449 [Note] NDB Util: Wakeup
 2017-08-17 17:18:13 4449 [Note] NDB Index Stat: Starting...
 2017-08-17 17:18:13 4449 [Note] NDB Index Stat: Wait for server start completed
mcm> show status -r mycluster;
+--------+----------+-----------+---------+-----------+------------+
| NodeId | Process  | Host      | Status  | Nodegroup | Package    |
+--------+----------+-----------+---------+-----------+------------+
| 1      | ndb_mgmd | 10.0.0.10 | running |           | cluster748 |
| 3      | ndbmtd   | 10.0.0.12 | running | 0         | cluster748 |
| 4      | ndbmtd   | 10.0.0.13 | running | 0         | cluster748 |
| 10     | mysqld   | 10.0.0.10 | failed  |           | cluster748 |
| 11     | mysqld   | 10.0.0.11 | running |           | cluster738 |
| 12     | ndbapi   | *         | added   |           |            |
| 13     | ndbapi   | *         | added   |           |            |
| 14     | ndbapi   | *         | added   |           |            |
+--------+----------+-----------+---------+-----------+------------+
8 rows in set (0.05 sec)

On sn1, the error log mysqld_738.err reads:

2017-08-17 17:25:20 4518 [Note] NDB Util: Wait for server start completed
2017-08-17 17:25:20 4518 [ERROR] Aborting

The mcmd.log:

2017-08-17 17:25:20 4518 [Note] NDB Util: Stop
2017-08-17 17:25:20 4518 [Note] NDB Util: Wakeup
2017-08-17 17:25:20 4518 [Note] NDB Index Stat: Starting...
2017-08-17 17:25:20 4518 [Note] NDB Index Stat: Wait for server start completed

2017-08-17 17:25:24.452: (message) [T0x1b1a050 CMGR ]: Got new message mgr_cluster_process_status {a6905b23 396 0} 10 failed
2017-08-17 17:25:24.457: (message) [T0x1b1a050 CMGR ]: Got new message x_trans {a6905b23 397 0} abort_trans pc=19
2017-08-17 17:25:24.459: (message) [T0x1b1a050 CMGR ]: Got new message mgr_process_operationstatus {0 0 0} 10 failed
2017-08-17 17:25:24.461: (message) [T0x1b1a050 CMGR ]: req_id 80 Operation finished with failure for configversion {a6905b23 385 3}
2017-08-17 17:25:24.466: (warning) [T0x1b1a050 CMGR ]: Operation failed : 7006 Process error: Node 10 : 17-08-17 17:25:20 4518 [Note] NDB Util: Starting...
2017-08-17 17:25:20 4518 [Note] NDB Util: Wait for server start completed
2017-08-17 17:25:20 4518 [ERROR] Aborting

And reviewing the my.cnf, the following needed to be changed as they reference the old binaries.

But most importantly, StopOnError=0 is required. That was my gotcha!

set lc_messages_dir:mysqld:10=/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/cluster/share mycluster;
set lc_messages_dir:mysqld:11=/usr/local/mcm-1.4.0-cluster-7.4.8-linux-glibc2.5-x86-64bit/cluster/share mycluster;

set StopOnError:ndbmtd=0 mycluster;

This last command restarts the cluster, without upgrading it, leaving us:

mcm> show status -r mycluster;
+--------+----------+-----------+---------+-----------+------------+
| NodeId | Process  | Host      | Status  | Nodegroup | Package    |
+--------+----------+-----------+---------+-----------+------------+
| 1      | ndb_mgmd | 10.0.0.10 | running |           | cluster748 |
| 3      | ndbmtd   | 10.0.0.12 | running | 0         | cluster748 |
| 4      | ndbmtd   | 10.0.0.13 | running | 0         | cluster748 |
| 10     | mysqld   | 10.0.0.10 | running |           | cluster748 |
| 11     | mysqld   | 10.0.0.11 | running |           | cluster748 |
| 12     | ndbapi   | *         | added   |           |            |
| 13     | ndbapi   | *         | added   |           |            |
| 14     | ndbapi   | *         | added   |           |            |
+--------+----------+-----------+---------+-----------+------------+
8 rows in set (0.05 sec)

Looks like it’s upgraded. We know it hasn’t been able to run the checks and upgrade process, so let’s do it properly (and remember in the future that we need to review our config.ini and params):

mcm> upgrade cluster --package=cluster748 mycluster;

+-------------------------------+
| Command result                |
+-------------------------------+
| Cluster upgraded successfully |
+-------------------------------+
1 row in set (1 min 53.72 sec)

Whilst MCM upgrades, it normally restarts each process in it’s correct order and one by one, on it’s own, without any need for human intervention.

However, as the upgrade process had previously been run, and failed at the sqlnode step, this still needed to be carried out, hence, when it stopped and started each sqlnode, it did it twice, ensuring that the changed configuration we adjusted is reflected into the MCM config.

mcm> show status -r mycluster;
+--------+----------+-----------+---------+-----------+------------+
| NodeId | Process  | Host      | Status  | Nodegroup | Package    |
+--------+----------+-----------+---------+-----------+------------+
| 1      | ndb_mgmd | 10.0.0.10 | running |           | cluster748 |
| 3      | ndbmtd   | 10.0.0.12 | running | 0         | cluster748 |
| 4      | ndbmtd   | 10.0.0.13 | running | 0         | cluster748 |
| 10     | mysqld   | 10.0.0.10 | running |           | cluster748 |
| 11     | mysqld   | 10.0.0.11 | running |           | cluster748 |
| 12     | ndbapi   | *         | added   |           |            |
| 13     | ndbapi   | *         | added   |           |            |
| 14     | ndbapi   | *         | added   |           |            |
+--------+----------+-----------+---------+-----------+------------+
8 rows in set (0.01 sec)

And we’re done. Imported from the wild into an mcm-managed env, and upgraded with mcm. So much simpler.

Happy mcm’ing!

This entry was posted in CGE, Cluster 7.3, Cluster Manager, MySQL, MySQL Cluster, Oracle, Uncategorized, upgrade and tagged , , , , , , , . Bookmark the permalink.

2 Responses to Migrating/importing NDB to Cluster Manager w/ version upgrade.

  1. Pingback: Taming a ‘wild’ NDB 7.3 with Cluster Manager 1.4.3 & direct upgrade to 7.5. | MySQL-Med

  2. Pingback: Taming a ‘wild’ NDB 7.3 with Cluster Manager 1.4.3 & direct upgrade to 7.5. – Cloud Data Architect

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s