原文地址:http://blog.jslee.name/openstack-running-mysql-cluster/ 

OpenStack running MySQL Cluster

OpenStack:

- Hardware : Dell OPTIPLEX 780 2U 4G ram
- OpenStack Verison: Diablo Release
- Hypervisor OS: ubuntu 11.04
- Install script: https://github.com/jsleetw/OpenStack-NOVA-Installer-Script/blob/master/nova-CC-install-v1.1.sh
- Config Glance:
Add config to /etc/nova.conf

--glance_host=0.0.0.0
--glance_port=9292
--p_w_picpath_service=nova.p_w_picpath.glance.GlanceImageService

- Add fireware rule for MySQL Cluster

euca-authorize -P icmp -t -1:-1 default 
euca-authorize -P tcp -p 22 default
euca-authorize -P tcp -p 1186 default
euca-authorize -P tcp -p 2202 default

MySQL Cluster:
- Start 3 x m1.small(2G ram) INSTANCE running MySQL Cluster (on Ubuntu 11.04)
– 1 Mgmt Node 2 Data Node 1 SQL Node
- MySQL Cluster Version: http://www.mysql.com/downloads/cluster/

- config.ini:

[ndb_mgmd]
hostname=vm1
datadir=/home/user/my_cluster/ndb_data
[ndbd default]
noofreplicas=2
datadir=/home/user/my_cluster/ndb_data
ServerPort= 2202
[ndbd]
hostname=vm2
[ndbd]
hostname=vm3

- my.cnf:

[mysqld]
ndbcluster
datadir=/home/user1/my_cluster/mysqld_data
basedir=/home/user1/mysqlc
port=5000

- start MySQL Cluster command
Start up Mgmt Node on vm1

cd mysqlc
scripts/mysql_install_db --no-defaults --datadir=$HOME/my_cluster/mysqld_data/
$HOME/mysqlc/bin/ndb_mgmd -f conf/config.ini --initial --configdir=$HOME/my_cluster/conf/

Start data node on vm2/vm3

$HOME/mysqlc/bin/ndbd --initial -c vm1:1186

check status on vm1

$HOME/mysqlc/bin/ndb_mgm -e show

When data node sync finish start SQL node on vm1

$HOME/mysqlc/bin/mysqld --defaults-file=conf/my.cnf &

finish!

reference : http://downloads.mysql.com/tutorials/cluster/GetMySQLClusterRunning-LINUX.pdf