22
Tango Meeting 26-27/05/2005 Claudio Scafuri, Elettra Tango database & MySQL cluster Tango Database & MySQL Cluster Claudio Scafuri [email protected]

Tango Database & MySQL Cluster

  • View
    2.686

  • Download
    10

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Tango Database&

MySQL Cluster

Claudio Scafuri [email protected]

Page 2: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Topics

● news & experiences● considerations● presentation of “deliverables”

Page 3: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Where we left ....

DB DBMGM

mysqldAPI

mysqldAPI

Databaseds Databaseds

HostA HostB

Page 4: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

News

– MySQL max 4.1.12 . Clustering is “stable”

– improved documentation● but refers to MySQL 5 ! They are pushing in that direction● still some gray area ...

– forums & mailing list by MySQL with precious informations

Page 5: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

“Crashes” explained

Conservative design: 

save DB from corruption and inconsitencies

Not crashes but shut­down of storage nodes!

Page 6: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

“Crashes” explained● lack of memory● disk space● network connectivity

Tests were carried on “low end” PCs !

Page 7: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

“Crashes” explained● lack of memory:

  98 devices

895 properties

176 attribute properties

–  ndbd  : 427 MB Virtual / 27 MB Resident

Page 8: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

“Crashes” explained● disk space:

  98 devices

895 properties

176 attribute properties

– 314 MB on Master node– 236 MB on Slave node

– plus logs... 

Page 9: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

“Crashes” explained● network connectivity:

 must avoid “split brain” syndrome: 2 different commits on the same rows/tables.

­ majority of storage node must “see” each other

or– storage nodes can  see an “arbitrator”:

– MGM node– myqld node

Page 10: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Cluster Configuration­ MySQL strongly reccomends to have a single 

management node in the cluster. It works as arbitrator.

In principle it is possible to have multiple mangement nodes by assigning an arbitration rank. But :“the configuration has not been completely tested.”

Page 11: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Cluster Configuration

DB

mysqldAPI

Databaseds

HostA

DB

mysqldAPI

Databaseds

HostB

MGM

HostC

Switched Network

Page 12: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Failure scenarios

DB

mysqldAPI

Databaseds

HostA

DB

mysqldAPI

Databaseds

HostB

MGM

HostC

Switched Network

Page 13: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Failure scenarios

DB

mysqldAPI

Databaseds

HostA

DB

mysqldAPI

Databaseds

HostB

MGM

HostC

Switched Network

Page 14: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Failure scenarios

DB

mysqldAPI

Databaseds

HostA

DB

mysqldAPI

Databaseds

HostB

MGM

HostC

Switched Network

Page 15: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Failure scenarios

DB

mysqldAPI

Databaseds

HostA

DB

mysqldAPI

Databaseds

HostB

Switched Network

MGM

HostC

Page 16: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Failure scenarios

DB

mysqldAPI

DatabasedsHostA

DB

mysqldAPI

DatabasedsHostB

Switched Network

MGMHostC

According to MySQL this should trigger a shutdown of the cluster. But it may keep working...

Page 17: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Failure scenarios

­ “failures” never led to data loss or corruption

­ lack of explicit notificationYou have to check the logs and the status of the processes

Page 18: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Considerations● excelent tool, does its job

– but keep in mind it design and goals

● redundancy does not come for free– 3 or more servers , lots of memory, disk space

– non­trivial management (compared to base MySQL)

– network failure to be dealt with by othe means

Page 19: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Deliverables­ configuration files

my.cnf : MySQL general configuration file with cluster support enabled

config.ini: cluster configuartion file.

Describes the minimal cluster showed in the slides

­ database creation sql script

create-db.sql: creates the TANGO schema with cluster enabled tables. Preloads 2 instances of Database: sys/database/2 , sys/database/4

Page 20: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

Deliverablesextra bonus!

2 HOW­TOs retrieved from the web :

cluster-howto-1.pdf

by A. Davies. Official MySQL document

cluster-howto-2.pdf

courtesy of LOD Communications, Inc.http://www.lod.com

Page 21: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

To be done:● testing of deliverables by other institutes● choose how (if) to distribute the deliverables● decide whether to add support for multiple tango 

host in Java:TANGO_HOST=myhost:10000,otherhost:1000

now it is understood only by C++ thanks to omniORB.

Page 22: Tango Database & MySQL Cluster

Tango Meeting26­27/05/2005

Claudio Scafuri, Elettra

Tango database & MySQL cluster

To be done:● tuning of db parameters (lots of them!)

● testing of backup and recovery

● trying to break and then recover the database.