Getting started with MySQL Cluster 7.6 using MySQL Cluster Manager 1.4.6

MySQL_Cluster_Manager

MySQL Cluster 7.6 is GA!
If you’re eager to give the recently announced MySQL Cluster 7.6 GA a spin, I’ll walk you through a quick and simple way to get started using MySQL Cluster Manager 1.4.6.

Bootstrap and go!

  1. Download and install MCM and MySQL Cluster
  2. Bootstrap a cluster with MCM

    $ mcmd –bootstrap

  3. Connect to the database, and have at it

    $ mysql -h 127.0.0.1 -P 3306 -u root

That simple.

Download and install
Grab the latest MCM and MySQL Cluster tarballs for your platform, and install.

I’ll be using the latest MCM 1.4.6 and MySQL Cluster 7.6.6 on linux, and unpacked the tarballs in their respective subfolders under /foo for simplicity. The top level directory of /foo needs the MySQL Cluster 7.6 binaries in ./cluster, and MySQL Cluster Manager binaries in ./mcm1.4.6 for the next step to work. The user running mcmd also needs write access to /foo.

Should you need a download location, My Oracle Support (MOS) or eDelivery are the places to visit.

Bootstrap
The easiest way to get going with MySQL Cluster 7.6 is using the –bootstrap option for the mcmd.

This option will bootstrap a simple cluster containing 2 datanodes, 2 mysqlds, 1 ndb_mgmd, and 1 ndbapi slot for additional tools such as ndb_restore, on the local host. Do note that the bootstrapped cluster will have a mysqld running on the default mysqld port 3306, so if you already have a vanilla MySQL Server (non-cluster) running then you will need to stop it before proceeding.

Cluster bootstrapped in about 30 seconds, and is now ready to play with. Have at it!

Follow the white rabbit
The mcmd –bootstrap output left us two hints – how to connect to the database, and how to connect to the mcmd.

Let’s try to connect to the database as suggested at the very end:

The mysqld we connected to on port 3306 is running the expected server version, and is connected to the cluster as nodeid 50. Looking good!

Poking around
Let’s have a look at mcmd as well. After all, that’s where we’ll execute our management commands. The connect string is printed at the top of the bootstrap output:

So, we have a connection to the mcmd. Let’s poke around some more

Apparently we’re on a 4.15 linux kernel with 4 cores and 8Gb RAM. Yup, sounds like my laptop.

Bootstrap – behind the scenes
Bootstrap will call the following set of commands behind the scenes:

  1. Create management site with a single host
  2. Define a package abstraction pointing to the installed cluster version
  3. Create a default cluster, using with default package
  4. Apply the minimal settings needed to the cluster
  5. Start the cluster

If the bootstrap cluster doesn’t fit your needs, you can skip –bootstrap and tailor the site, package and cluster definition to your needs.

What else?
What else can mcmd do? A lot. The list commands command will give you a brief overview:

The –help option can be used with any command to provide further information.

Knobs and dials
Let’s change something. Assume my test dataset has 150 small tables. By default MySQL Cluster is limited to a maximum of 128 tables.

There was a SomethingTables setting in cluster to overcome this… I can’t remember what… Let’s use a wildcard query, including defaults with option -d, to find out:

That’s the one – MaxNoOfTables. Doubling it should do fine, and leave me some headway.

Great. Now all my test tables will fit.

There are a lot of knobs and dials to tweak, if you want. If you go astray, you can change back to the default setting using the reset command:

Back where we started.

Summary
Bootstrapping a MySQL Cluster using MCM is simple and quick, and MCM allows easy management of MySQL Cluster!

Go and give MySQL Cluster 7.6 GA a spin!

2,238 total views, 20 views today

About Thomas Nielsen

Thomas Nielsen is a software engineer, and the Team Lead for MySQL Cluster Manager, at Oracle. He has worked on different high availability products and technologies in databases, as well as JavaDB, before joining the MySQL Cluster team. He holds an engineering degree from the Norwegian University of Science and Technology, and his past-time passion is gliding instruction and cross country soaring.

Leave a Reply