System environment: Centos6.3 + Mysql-cluster-gpl-7.1.15a-linux-x86_64-glibc23.tar. gz
Description
1) Start of Mysqlcluster:
Boot order: Management Server--storage nodes--SQL node
2) Safely off NDB cluster:
Shutdown Order: SQL node--Data node--manage node.
#/usr/local/mysql/bin/mysqladmin-u root shutdown # Close SQL node
#/USR/LOCAL/MYSQL/NDB_MGM-E Shutdown # Close the management node, shutdown, it will put all mgmnode and all the Data node
NDB_MGMD and NDBD all stopped (MySQL still remains)
Procedures for operation of the Department:
System kernel tuning must do * * *
A) Deploy cluster software, all machines
1) downloads Cluster software 32 bit # wget-c http:// downloads.skysql.com/archives/mysql-cluster-gpl-7.1/mysql-cluster-gpl-7.1.15a-linux-i686-glibc23.tar . gz64 bit #wget-c http://downloads.skysql.com/archives/mysql-cluster-gpl-7.1/ MYSQL-CLUSTER-GPL-7.1.15A-LINUX-X86_64-GLIBC23.TAR .GZ2) Installation and configuration Cluster useradd mysql-d/dev/null -s /sbin/nologin tar-xvf /usr/local/src/ Mysql-cluster-gpl-7.1.15a-linux-x86_64-glibc23.tar .gz -c /usr/local/src/ yum install rsync rsync -avl /usr/local/src/mysql-cluster-gpl-7.1.15a-linux-x86_64-glibc23//usr/local /mysql_cluster chown mysql:mysql/usr/local/mysql_cluster-r echo "P A TH=\ $P a th:/usr/local/mysql_cluster/bin/" >> /etc/profile source /etc/ Profile which mysql /usr/local/mysql_cluster/bin/mysql
II) Management node
1) Configuration Management node
Mkdir /data/mysql/mgmd /data/mysql/ndb_data /data/mysql/ndb_data_backup /data/mysql/etc/data/mysql/binlog /data/mysql/mysql_data /data/logs -p chown mysql:mysql /data/mysql -r cat >/data/mysql/ etc/config.ini << eof [tcpdef aul t] sendbuffermemory=4m receivebuffermemory=4m [ndb_mgmd def aul t] portnumber=1186 datadir=/data/mysql/ Mgmd [ndb_mgmd] nodeid=1 hostname= Management node IP address logdestination=file:filename=ndb_1_ cluster .log,maxsize=10000000,maxfiles=6 arbitrationrank=1 [ndbddef aul t] Noofreplicas=2 serverport=2200 datadir=/data/mysql/ndb_data filesystempath=/data/mysql/ndb_ databackupdatadir=/data/mysql/ndb_data_backup datamemory=9728m indexmemory=1216m Lockpagesinmainmemory=1 maxnoofconcurrentoperations=100000 maxnoofconcurrentt ransactions=16384 stringmemory=25 maxnooft ables=4096 maxnooforderedindexes=4096 maxnoofuniquehashindexes=512 maxnoofattributes=24576 maxnooft riggers=14336 ### Params for REDO LOGFragmentLogFileSize=512M initfragmentlogfiles=sp arse nooffragmentlogfiles=38 redobuffer=48m t ransactionbuffermemory=8m timebetweenglobalcheckpoints=1000 timebetweenepochs=100 timebetweenepochstimeout=0 ### params forlcpdiskcheckpointspeedinrestart=100m diskcheckpointspeed=10m timebetweenlocalcheckpoints=20 ### heartbeatingheartbeatintervaldbdb= 15000 heartbeatintervaldbapi=15000 ### params for setting Loggingmemreportfrequency=30 backupreportfrequency=10 loglevelstartup=15 loglevelshutdown=15 loglevelcheckpoint=8 loglevelnoderestart=15 ### params forbackupbackupmaxwritesize=1m backupdatabuffersize=24m backuplogbuffersize=16m backupmemory=40m ### params for odirect#reports indicates that odirect=1 can cause io errors (os err code 5) on some systems. y ou must test. #ODirect =1 ### watchdogtimebetweenwatchdogcheckinitial=60000 ### t ransactioninactivetimeout - should be enabled in productiont ransactioninactivetimeout=60000 ## #New 7.1.10 redo logging parametersredoovercommitcounter=3 redoovercommitlimit=20 ### real time extensions# realtimescheduler=1 ### real time extensions for 6.3 onl y # schedulerexecutiontimer=80 #SchedulerSpinTimer =40 ### disk dat asharedglobalmemory= 20m diskpagebuffermemory=64m ### multithreadingMaxnoofexecutionthreads=8 ### increasing thelongmessagebuffer b/c of a bug (20090903) LongMessageBuffer=32M BatchSizePerLocalScan=512 [NDBD] NodeId=2 hostname= data node ip [ndbd] nodeid=3 hostname= data node ip [ndbd] nodeid =4 hostname= data node ip [ndbd] nodeid=5 hostname= data node ip [ndbd] nodeid=6 hostname= data node ip [ndbd] nodeid=7 hostname= data node ip [ndbd] nodeid=8 hostname= Data Node ip [mysqld def aul t] defaultoperationredoproblemaction= Queue batchsize=512 [mysqld] nodeid=10 [mysqld] nodeid=11 [mysqld] nodeid= 12 [mysqld] nodeid=13 [mysqld] nodeid=14 [mysqld] nodeid=15 [mysqld] NODEID=16&NBSP;[MYSQLD]&NBSP;NODEID=17&NBSP;[MYSQLD]&NBSP;NODEID=18&NBSP;[MYSQLD]&NBSP;NODEID=19&NBSP;[MYSQLD] nodeid=20 eof
2) Start the management node for the first time "or add a new node":
ndb_mgmd -f /data/mysql/etc/config.ini--configdir=/data/mysql/etc / parameter Note--initial
Start method After modifying configuration file:
ndb_mgmd -f /data/mysql/etc/config.ini--configdir=/data/ mysql/etc/--reload
III) Configuration data node
Cat >/data/mysql/etc/my. CNF << EOF
[Mysql_cluster]
ndb-connectstring= "Manage node IP"
EOF
Start Data node for the first time "Disable join initial parameter after start":
Ndbd--defaults-file=/data/mysql/etc/my. cnf Note Parameters --initial
Four) configure start SQL node
cat >/data/mysql/etc/my .cnf << eof [mysqld] user=mysql basedir=/ usr/local/mysql_cluster datadir=/data/mysql/mysql_data pid-file=/tmp/mysqld.pid socket=/tmp/ mysql.sock port=3306 skip_name_resolve #ndb-cluster-connection-pool=4 ndbcluster=1 Ndb-connectstring= "Management node ip" ndb-force-send=1 ndb-use-exact-count=0 ndb-extra-logging=1 ndb-batch-size=24M ndb-autoincrement-prefetch-sz=1024 engine-condition-pushdown=1 default-storage-engine=ndbcluster #REPLICA TION SPECIFIC - GENERAL #server-id must be unique acrossall mysql servers participating in replication. #server-id=3 #REPLICA TION SPECIFIC - MASTER #log-bin=binlog #binlog-format=row #expire-logs-days=5 #LOGS log-error=/data/logs/error .log # log #log-slow-queries #OTHERTHIngs, buffers etc key_buffer_size = 256m max_allowed_packet = 16m #thread_cache_size =1024 myisam_sort_buffer_size = 8m memlock=0 sysdate_is_now=1 max-connections=3000 thread-cache-size=128 ## #QUERY cache isdisabled ## #THE Query cache in mysql cluster can hamper performancea lot . hence it isdisabled ## #BECAUSE invalida tion of it T AKESTIME (remember, it isa distributed environment) ## #ONL y enable itand use sql_cache tocache onl y cert ain queries ON READONL Y T ABLES query_cache_type = 0 query_cache_size = 0 table_open_cache=1024 lower-case-table-names=0 [mysql] socket=/tmp/mysql.sock [client] socket=/tmP/mysql.sock [mysqld_safe] pid-file=mysqld.pid log-error=/data/logs/mysqld_safe_error .log basedir=/usr/local/mysql_cluster datadir=/data/mysql/mysql_data EOF Initialize database:/usr/local/ mysql_cluster/scripts/mysql_install_db --basedir=/usr/local/mysql_cluster --datadir=/ data/mysql/mysql_data--user=mysql Start sql node mysqld --defaults-file=/data/mysql/etc/my .cnf --user=mysql &
(v) Data validation
In the SQL node one operation:
mysql> use test; Database changed mysql> show tables; Empty Set (0.11 sec) mysql> CREATE table T1 (a int) engine=ndb; ##<--need to specify NDB engine query OK, 0 rows affected (0.74 sec) mysql> insert into t1values (100); Query OK, 1 row affected (0.32 sec) node Sql2 verified, with root view effect mysql> use test mysql> select *from T1 #<--found 100 This record is OK.
This article is from the "My Operations Blog" blog, be sure to keep this source http://linuxpython.blog.51cto.com/10015972/1643784
Mysql ndb_cluster test Environment setup