tonight solomon chang proudly presents: mysql clustering welcome to the uuasc la chapter

37
TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Upload: christopher-willingham

Post on 01-Apr-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

TONIGHT

Solomon Changproudly presents:

MySQL Clustering

Welcome to the UUASC LA Chapter

Page 2: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

NDB Cluster

High Availability* Shared-Nothing Architecture Redundancy

Page 3: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Server Requirements

Any machine that can run MySQL

Page 4: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Server Requirements

Any machine that can run MySQL

Non-Microsoft Operating System

Page 5: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Server Requirements

Any machine that can run MySQL

Non-Microsoft Operating System

A buttload of RAM

Page 6: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 7: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Types of Nodes

Data Nodes ndbd

Management Nodes ndb_mgmd

API Nodes mysqld ndb_mgm

Page 8: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 9: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Bits and Pieces

Partition (AKA Fragment) A portion of a table

Replica A copy of a Partition

Node Group A collection of individual data nodes

Page 10: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 11: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 12: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 13: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 14: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 15: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Security of Nodes

Page 16: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Security of Nodes

Authentication: None

Page 17: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Security of Nodes

Authentication: None Encryption: None

Page 18: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Security of Nodes

Authentication: None Encryption: None Management and Data Nodes

are very trusting as to who or what connects to them

Page 19: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 20: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 21: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Transports

Gigabit Ethernet Bare recommended minimum

SCI Scalable Coherent Interconnect

Infiniband

Page 22: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Performance

Primary Key are hashes

Page 23: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Performance

Primary Key are hashes Hashed values determine which rows

are distributed to which data nodes

Page 24: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Performance

Primary Key are hashes Hashed values determine which rows

are distributed to which data nodes Pushdown

Page 25: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Performance

Primary Key are hashes Hashed values determine which rows

are distributed to which data nodes Pushdown

Spreading query work across multiple data nodes

set engine_condition_pushdown = 1

Page 26: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Data Node Setup

In /etc/my.cnf:[MYSQLD]

ndbcluster

ndb-connectstring=10.0.0.152

[MYSQL_CLUSTER]

ndb-connectstring=10.0.0.152

Page 27: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Management Node Setup

config.ini sections [ndbd] [ndb_mgmd] [mysqld]

Page 28: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Management Node Setup

config.ini sections [ndbd] [ndb_mgmd] [mysqld]

Sections can be blank

Page 29: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Management Node Setup

config.ini sections [ndbd] [ndb_mgmd] [mysqld]

Sections can be blank There can be multiple instances

of a section

Page 30: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

SQL Node Setup

Just like the Data Node Setup

In /etc/my.cnf:[MYSQLD]

ndbcluster

ndb-connectstring=10.0.0.152

[MYSQL_CLUSTER]

ndb-connectstring=10.0.0.152

Page 31: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

SQL Node Setup

The Management Node already knows this is a SQL node from its config.ini file

Page 32: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Enough Talking

It's showtime

Page 33: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Cluster Replication

Cluster replication is exactly the same as regular MySQL replication, with the exception of the Binary Log Injection Thread.

Page 34: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter
Page 35: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Backup and Restoration

Why would a fault-tolerant, completely redundant system would ever need to have a backup for restoring data?

Page 36: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

Disk-Based NDB Cluster

Page 37: TONIGHT Solomon Chang proudly presents: MySQL Clustering Welcome to the UUASC LA Chapter

HA Caveat

SQL Nodes