mysql replication & cluster

10
MySQL replication & cluster by Joeri de Bruin ProcoliX

Upload: elliando-dias

Post on 19-May-2015

2.622 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: MySQL replication & cluster

MySQL replication & cluster

by Joeri de BruinProcoliX

Page 2: MySQL replication & cluster

Single vs Multiple

Multiple MySQL servers means that there are moreMySQL services, this will normaly be on more

servers.

Page 3: MySQL replication & cluster

Why multiple

1. High availability 2. On line backup

Page 4: MySQL replication & cluster

replication vs cluster

Page 5: MySQL replication & cluster

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: MySQL replication & cluster

Uses

Replication has 1 master and slavesCluster can read and write on all nodes

Page 7: MySQL replication & cluster

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: MySQL replication & cluster

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: MySQL replication & cluster

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: MySQL replication & cluster

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