MySQLCluster : Installation

Installation

L’installation se fera dans /usr/local/mysql sur tous les nodes du cluster.

apt-get install libaio1
groupadd mysql
useradd -r -g mysql mysql

dans /etc/passwd ⇒ /bin/false

cd /usr/local 
tar xvzf mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64.tar.bz
ln -s /usr/local/mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64 mysql
chown -R mysql /usr/local/mysql/*

Lancement de l’Oracle installeur

cd /bin 
./nbd_setup.py

Setup configuration

Mysql-01   1.12 mysqld ndb_mgmd
Mysql-02   1.14 ndbd
Mysql-03   1.13 mysqld
Mysql-04   1.23 ndbd

Présences des fichiers

config.ini sur tous les nodes
my.cnf pour les mysqld
ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]	2 node(s)
id=1	@192.168.1.14  (mysql-5.6.25 ndb-7.4.7, Nodegroup: 0)
id=2	@192.168.1.23  (mysql-5.6.25 ndb-7.4.7, Nodegroup: 0, *)

[ndb_mgmd(MGM)]	1 node(s)
id=49	@192.168.1.12  (mysql-5.6.25 ndb-7.4.7)

[mysqld(API)]	4 node(s)
id=50	@192.168.1.12  (mysql-5.6.25 ndb-7.4.7)
id=51 (not connected, accepting connect from 192.168.1.12)
id=52 (not connected, accepting connect from 192.168.1.13)
id=53	@192.168.1.13  (mysql-5.6.25 ndb-7.4.7)

Lancement des Processus

management node + 1 mysql node

 /usr/local/mysql/bin/ndb_mgmd --initial --ndb-nodeid=49 --config-dir= /usr/local/mysql/MySQL_Cluster/49/ --c
 /usr/local/mysql/bin/mysqld --defaults-file= /usr/local/mysql/MySQL_Cluster/50/my.cnf

data node multitread

/usr/local/mysql/bin/ndbmtd --ndb-nodeid=1 --ndb-connectstring=192.168.1.12:1186,
/usr/local/mysql/bin/ndbmtd --ndb-nodeid=1 --ndb-connectstring=192.168.1.12:1186,

SQL (Api) node

/usr/local/mysql/bin/mysqld --defaults-file= /usr/local/mysql/MySQL_Cluster/53/my.cnf

Configuration

root@Mysql-03: /usr/local/mysql/MySQL_Cluster/53# cat my.cnf 
#
# Configuration file for Warsong_Cluster
# Generated by mcc
#

[mysqld]

log-error=mysqld.53.err datadir= »/usr/local/mysql/MySQL_Cluster/53/ » tmpdir= »/usr/local/mysql/MySQL_Cluster/53/tmp » basedir= »/usr/local/mysql/ » port=3306 ndbcluster=on ndb-nodeid=53 ndb-connectstring=192.168.1.12:1186, socket= »/usr/local/mysql/MySQL_Cluster/53/mysql.socket »

root@Mysql-01:/usr/local/mysql/MySQL_Cluster/50# cat my.cnf 
#
# Configuration file for Warsong_Cluster
# Generated by mcc
#

[mysqld]

log-error=mysqld.50.err datadir= »/usr/local/mysqlMySQL_Cluster/50/ » tmpdir= »/usr/local/mysqlMySQL_Cluster/50/tmp » basedir= »/usr/local/mysql/ » port=3306 ndbcluster=on ndb-nodeid=50 ndb-connectstring=192.168.1.12:1186, socket= »/usr/local/mysql/MySQL_Cluster/50/mysql.socket » root@Mysql-01:/usr/local/mysql/MySQL_Cluster/49# cat config.ini # # Configuration file for Warsong_Cluster # [NDB_MGMD DEFAULT] Portnumber=1186 [NDB_MGMD] NodeId=49 HostName=192.168.1.12 DataDir=/usr/local/mysql/MySQL_Cluster/49/ Portnumber=1186 [TCP DEFAULT] SendBufferMemory=2M ReceiveBufferMemory=2M [NDBD DEFAULT] BackupMaxWriteSize=1M BackupDataBufferSize=16M BackupLogBufferSize=4M BackupMemory=20M BackupReportFrequency=10 MemReportFrequency=30 LogLevelStartup=15 LogLevelShutdown=15 LogLevelCheckpoint=8 LogLevelNodeRestart=15 DataMemory=1M IndexMemory=1M MaxNoOfTables=4096 MaxNoOfTriggers=3500 NoOfReplicas=2 StringMemory=25 DiskPageBufferMemory=64M SharedGlobalMemory=20M LongMessageBuffer=32M MaxNoOfConcurrentTransactions=16384 BatchSizePerLocalScan=512 FragmentLogFileSize=64M NoOfFragmentLogFiles=16 RedoBuffer=32M MaxNoOfExecutionThreads=2 StopOnError=false LockPagesInMainMemory=1 TimeBetweenEpochsTimeout=32000 TimeBetweenWatchdogCheckInitial=60000 TransactionInactiveTimeout=60000 HeartbeatIntervalDbDb=15000 HeartbeatIntervalDbApi=15000 [NDBD] NodeId=1 HostName=192.168.1.14 DataDir=/usr/local/mysql/MySQL_Cluster/1/ [NDBD] NodeId=2 HostName=192.168.1.23 DataDir=/usr/local/mysql/MySQL_Cluster/2/ [MYSQLD DEFAULT] [MYSQLD] NodeId=50 HostName=192.168.1.12 [MYSQLD] NodeId=53 HostName=192.168.1.13 [API] NodeId=51 HostName=192.168.1.12 [API] NodeId=52 HostName=192.168.1.13

Attentions les paramètres de ce fichier sont pour une toute petite instance

Seul les mgmt node et les data node peuvent restart via ndb_mgm

la socket se trouve dans

mysql -S /usr/local/mysql/MySQL_Cluster/50/mysql.socket