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!
1
2
3
4
5
6
7
8
9
10
11
12
13
|
PS D:AndrewDocumentsMySQLmcm> <strong>binmcmd --bootstrap</strong> MySQL Cluster Manager 1.1.2 started Connect to MySQL Cluster Manager by running "D:AndrewDocumentsMySQLmcmbinmcm" -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:AndrewDocumentsMySQLmcmclusterbinmysql" -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…
1
2
3
4
5
6
7
8
9
10
11
12
|
PS C:UsersAndrew> <strong>D:"AndrewDocumentsMySQLmcmclusterbinmysql" -h NOVA -P 3306 </strong> 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
- 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