MySQL Cluster database & MySQL Replication
RSS icon Email icon Home icon
  • MySQL Cluster Manager 1.1.2 – creating a Cluster is now trivial

    Posted on September 14th, 2011 andrew 1 comment

    MySQL Cluster Manager 1.1.2 is now available to download and try from Oracle E-Delivery (select “MySQL Database” as the product pack). Something that’s new and really cool in the new version is that you can download a version of MCM that actually includes the MySQL Cluster software itself and then you can have MCM automatically define, create and start a single-host cluster deployment for you with just the command “mcmd –bootstrap”. This post aims to show that it’s really as simple as that!

    I’ve been playing with Windows recently and so I’ll use that for this example but things would be very similar on other platforms.

    Step 1 Download from E-Delivery and extract the zip file

    Step2 Start your first cluster!

    PS D:\Andrew\Documents\MySQL\mcm> bin\mcmd --bootstrap
    MySQL Cluster Manager 1.1.2 started
    Connect to MySQL Cluster Manager by running "D:\Andrew\Documents\MySQL\mcm\bin\mcm" -a NOVA:1862
    Configuring default cluster 'mycluster'...
    Starting default cluster 'mycluster'...
    Cluster 'mycluster' started successfully
     ndb_mgmd NOVA:1186
     ndbd NOVA
     ndbd NOVA
     mysqld NOVA:3306
     mysqld NOVA:3307
     ndbapi *
    Connect to the database by running "D:\Andrew\Documents\MySQL\mcm\cluster\bin\mysql" -h NOVA -P 3306 -u root

    That’s it!

    Just to prove it you can now go ahead and start using the database (note that I connect with the command suggested by MCM but in this case I had to shift the quotes…

    PS C:\Users\Andrew> D:"\Andrew\Documents\MySQL\mcm\cluster\bin\mysql" -h NOVA -P 3306 
    mysql> CREATE DATABASE clusterdb;
    mysql> USE clusterdb;
    mysql> CREATE TABLE towns (name VARCHAR(30) NOT NULL PRIMARY KEY) ENGINE=NDBCLUSTER;
    mysql> INSERT INTO towns VALUES ('Maidenhead'), ('Marlow');
    mysql> SELECT * FROM towns;
    +------------+
    | name       |
    +------------+
    | Maidenhead |
    | Marlow     |
    +------------+

    So how much simpler is this than doing it by hand? 

    With MCM bootstrap:

    • Packages to download & install: 1
    • Config files to create/edit: 0
    • Commands to run: 1
    Without MCM:
    • Packages to download & install: 1 if using tar-ball, up to 13 if using RPMs
    • Config files to create/edit: 3
    • Commands to run: 12

    1 Trackbacks / Pingbacks

    Leave a reply