mysql replication & cluster

Post on 19-May-2015

2.622 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

TRANSCRIPT

MySQL replication & cluster

by Joeri de BruinProcoliX

Single vs Multiple

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

servers.

Why multiple

1. High availability 2. On line backup

replication vs 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

Uses

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

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

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

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

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

top related