[Deploying Sakai] MySQL clustering

Warwick Chapman warwickchapman at gmail.com
Thu Mar 18 05:54:45 PDT 2010

Why won't NDB clustering work?

I did an implementation for a 100% uptime production line management system
last year where read/writes were shared between nodes in the MySQL Cluster
(NDB).  They still use it, seems solid and faster than the single system
they had before...

Notes from that one attached.

On Thu, Mar 18, 2010 at 2:15 PM, Kusnetz, Jeremy <JKusnetz at apus.edu> wrote:

> I'm not talking about NDB clustering, I know that won't work.
> Has anyone run Sakai with MySQL replication, writes going to a master and
> reads going to many slaves?
> Any success with MySQL Proxy to redirect write and read requests?
> What about using a commercial/community clustering software like Continuent
> http://www.continuent.com/ ?
> It's not clustering, but what about an alternate high performance engine
> like solidDB?
> We are in the early stages of deploying Sakai and I'm thinking about long
> term scalability.
> _______________________________________________
> production mailing list
> production at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/production
> TO UNSUBSCRIBE: send email to
> production-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/production/attachments/20100318/5512735a/attachment-0001.html 
-------------- next part --------------
MySQL Cluster on Debian 4.0

On two data nodes:

cd /usr/local
tar xzf /root/mysql-cluster-gpl-6.3.20-linux-i686-glibc23.tar.gz .
mv mysql-cluster-gpl-6.3.20-linux-i686-glibc23 mysql
groupadd mysql
useradd -g mysql mysql
cd mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
cp support-files/mysql.server /etc/init.d/mysql

Create /etc/my.cnf:

mkdir /var/lib/mysql-cluster
cd /var/lib/mysql-cluster
/usr/local/mysql/bin/ndbd --initial

/etc/init.d/mysql start


On management node:

cd mysql-cluster-gpl-6.3.20-linux-i686-glibc23
cp bin/ndb_mgm* /usr/sbin
mkdir /var/lib/mysql-cluster
cd /var/lib/mysql-cluster

Create /etc/ndb_mgmd.cnf:

[ndbd default]
NoOfReplicas= 2

HostName= mysql3

HostName= mysql1
DataDir= /var/lib/mysql-cluster

HostName= mysql2
DataDir= /var/lib/mysql-cluster


Start Management Daemon:

Config options /etc/ndb_mgmd.cnf:

DataMemory: defines the space available to store the actual records in the database. The entire DataMemory will be allocated in memory so it is important that the machine contains enough memory to handle the DataMemory size. Note that DataMemory is also used to store ordered indexes. Ordered indexes uses about 10 bytes per record. Default: 80MB
IndexMemory The IndexMemory is the parameter that controls the amount of storage used for hash indexes in MySQL Cluster. Hash indexes are always used for primary key indexes, unique indexes, and unique constraints. Default: 18MB
MaxNoOfAttributes This parameter defines the number of attributes that can be defined in the cluster. Default: 1000
MaxNoOfTables Obvious (bear in mind that each BLOB field creates another table for various reasons so take this into account). Default: 128


Test DBs:

On mysql1:

use test;
INSERT INTO ctest () VALUES (1);
SELECT * FROM ctest;

On mysql2:

use test;
SELECT * FROM ctest;


More information about the production mailing list