Instructions derived from Andrew Morgan’s blog – http://www.clusterdb.com/mysql-cluster/mysql-cluster-running-on-raspberry-pi/
relevant links:
Building MySQL 5.6 – http://dev.mysql.com/doc/refman/5.6/en/installing-source-distribution.html
Downloading MySQL Cluster src – http://dev.mysql.com/downloads/cluster/#downloads (I used “Generic Linux (Architecture Independent), Compressed TAR Archive” – mysql-cluster-gpl-7.2.10.tar.gz)
ARM patch – http://bugs.mysql.com/bug.php?id=62769
Raspberry Pi downloads for SD card images – http://www.raspberrypi.org/downloads (I used the Soft-float Debian “wheezy” – the Oracle JVM which does not yet support the hard-float ABI )
sudo su
export http_proxy=http://proxy:8080
apt-get update
apt-get install cmake libncurses5-dev openjdk-7-jdk
get source from http://dev.mysql.com/downloads/cluster/7.3.html#downloads
cd /usr/local/src
tar xzfv /home/pi/mysql-cluster-gpl-7.3.0.tar.gz
cd mysql-cluster-gpl-7.3.0
get patch from http://bugs.mysql.com/file.php?id=17637
cd sql-common
patch -l -f –verbose -i mysql-va-list.patch client_plugin.c
cd ..
groupadd mysql
useradd -r -g mysql mysql
cmake .
make
make install
on data node
sudo su
export PATH=$PATH:/usr/local/mysql/bin
echo “export PATH=\$PATH:/usr/local/mysql/bin” >> /etc/bash.bashrc
cd /usr/local/mysql (was /usr/local/mysqlshell)
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db –user=mysql
chown -R root .
chown -R mysql data
./bin/mysqladmin -u root password ‘raspberry’
cp support-files/my-small.cnf /etc/my.cnf
bin/mysqld_safe –user=mysql &
cp support-files/mysql.server /etc/init.d/mysql.server
chmod +x /etc/init.d/mysql.server
update-rc.d mysql.server defaults
on mgmt node
sudo su
mkdir /var/lib/mysql-cluster
shell> cd /var/lib/mysql-cluster
shell> vi config.ini
config.ini
[ndb_mgmd]hostname=130.35.70.22NodeId=1[ndbd default]noofreplicas=2DataMemory=2MIndexMemory=1MDiskPageBufferMemory=4MStringMemory=5MaxNoOfConcurrentOperations=1KMaxNoOfConcurrentTransactions=500SharedGlobalMemory=500KLongMessageBuffer=512KMaxParallelScansPerFragment=16MaxNoOfAttributes=100MaxNoOfTables=20MaxNoOfOrderedIndexes=20[ndbd]hostname=130.35.70.18datadir=/home/pi/mysql/ndb_dataNodeId=3[ndbd]hostname=130.35.70.59datadir=/home/pi/mysql/ndb_dataNodeId=4[ndbd]hostname=130.35.70.99datadir=/home/pi/mysql/ndb_dataNodeId=5[mysqld]NodeId=50[mysqld]NodeId=51[mysqld]NodeId=52[mysqld]NodeId=53[mysqld]NodeId=54
on each of the data/SQL nodes
vi /etc/my.cnf
[mysqld]ndbclusterdatadir=/home/pi/mysql/ndb_datandb-connectstring=130.35.70.22[mysql_cluster]ndb-connectstring=130.35.70.22
sudo dphys-swapfile swapoff
sudo vi /etc/dphys-swapfile =>> CONF_SWAPSIZE=2048
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
now start up the cluster
ndb_mgmd -f /var/lib/mysql-cluster/config.ini –configdir=/var/lib/mysql-cluster –ndb-nodeid=1
(on data nodes – not sudo)
mkdir -p /home/pi/mysql/ndb_data
/usr/local/mysql/bin/ndbd
# Add puppet support
#sudo su
#export http_proxy=http://proxy:8080
apt-get install ruby
useradd –comment “Puppet” –no-create-home –system –shell /bin/false puppet
gem install puppet
mkdir /home/pi/puppet
cd /home/pi/puppet
vi base.pp
package { “vim”:ensure => installed,}
sudo puppet apply base.pp
To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:./bin/mysqladmin -u root password ‘new-password’./bin/mysqladmin -u root -h raspberrypi password ‘new-password’Alternatively you can run:./bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd . ; ./bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.plcd ./mysql-test ; perl mysql-test-run.plPlease report any problems with the ./bin/mysqlbug script!