Thursday, March 20, 2008

MySQL Cluster CGE - Building from source

MySQL Cluster CGE exists in two different versions (6.2 and 6.3). Read here about the feature differences between the two.

In order to deploy it you have to do a couple of things:
  • download the source - CGE currently only exists in source distributions
  • build the source and generate a tarball
  • copy the tarball to the target hosts
  • install the tarball
Downloading the source
The entire ftp directory can be found here.
You should pick the latest version of either 6.2 or 6.3, and if you should use 6.2 (Production Ready) or 6.3 (RC) depends on your feature needs.

Here are direct links to the latest (as of the 20th of March 2008) source releases:
MySQL Cluster 5.1.23 CGE 6.2.14
MySQL Cluster 5.1.23 CGE 6.3.10

Building the source
The same steps apply regardless if you have downloaded CGE 6.2 or CGE 6.3 (please note that other compiler options might apply to other OSs than Linux):
  1. tar xvfz mysql-5.1.23-ndb-6.X.Y-telco.tar.gz
  2. cd mysql-5.1.23-ndb-6.X.Y-telco
  3. CFLAGS="-fPIC" ./configure --with-plugins=max
  4. make -j4
  5. make bin-dist
You will now have a tarball named mysql-5.1.23-ndb-6.X.Y-telco-linux-x86_64.tar.gz (name is different if you have built it on a non-Linux, non x86_64 system).

Now you only need to copy the tarball to the target machines and install it on them!

3 comments:

Lori said...

From the MySQL Manual:

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static

Would you say these recommendations are still valid?

Johan Andersson said...

Sure they are valid, but you should add:
--with-plugins=max

so that you build with all storage engines (ndb, innodb etc):

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static
--with-plugins=max

Good luck,
j

Mip said...

If you want create a tarball and share it with all your servers, you must not put the --with-mysqld-ldflags=-all-static option.

This option is fine only in the case of you want compile mysql cluster on each host.

Finally I want to thanks Johan for his wonderful blog :)