mysqlreplication & cluster - · pdf fileproces replication 1. update on master 2. update...
TRANSCRIPT
![Page 1: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/1.jpg)
MySQL replication & cluster
by Joeri de BruinProcoliX
![Page 2: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/2.jpg)
Single vs Multiple
Multiple MySQL servers means that there are moreMySQL services, this will normaly be on more
servers.
![Page 3: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/3.jpg)
Why multiple
1. High availability 2. On line backup
![Page 4: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/4.jpg)
replication vs cluster
![Page 5: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/5.jpg)
ProcesReplication1. UPDATE on master2. UPDATE written in Binlog3. Binlog is read by slave4. UPDATE on slave
Cluster1. UPDATE on MySQL2. UPDATE written to Cluster filesystem
![Page 6: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/6.jpg)
Uses
Replication has 1 master and slavesCluster can read and write on all nodes
![Page 7: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/7.jpg)
Replication quick howto
Procedure:1. Configure master and slave2. Stop MySQL3. Copy data tot slave4. Start MySQL on master5. Start MySQL on slave
[mysqld]server-id=2master-host=db-master.mycompany.commaster-port=3306master-user=gooeymaster-password=octopus
![Page 8: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/8.jpg)
Cluster quick howto
Procedure:Install MySQL-MAXConfigure clusterConfigure MySQLStart MGM nodeStart ndb deamonStart MySQL
[MYSQLD]ndbclusterndb-connectstring=192.168.0.10
[MYSQL_CLUSTER]ndb-connectstring=192.168.0.10
# file "config.ini"[NDBD DEFAULT]NoOfReplicas= 1MaxNoOfOrderedIndexes=2500MaxNoOfUniqueHashIndexes=2500MaxNoOfAttributes=4000
![Page 9: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/9.jpg)
MySQL cluster and WebGUI
MySQL cluster uses NDB cluster engine in stead ofMyIsam tables
Alter create.sql to use with MySQL cluster
vi create.sql:0,$s/TYPE=MyISAM/ENGINE=NDBCLUSTER/g
![Page 10: MySQLreplication & cluster - · PDF fileProces Replication 1. UPDATE on master 2. UPDATE written in Binlog 3. Binlog is read by slave 4. UPDATE on slave Cluster 1. UPDATE on MySQL](https://reader031.vdocuments.site/reader031/viewer/2022022003/5a9e0f177f8b9adb388dbdd6/html5/thumbnails/10.jpg)
Tips and tricks
Always use the same MySQL versionUse the source: www.mysql.com
Replication:http://dev.mysql.com/doc/mysql/en/replication.html
Cluster:http://dev.mysql.com/doc/mysql/en/multi-computer.html