MySQL User Camp: MySQL Cluster

1,341 views
1,234 views

Published on

Priyanka, a MySQL cluster developer, presented MySQL cluster in the MySQL User camp. The slide deck contains an introduction to the cluster module- the architecture,
auto-sharding, failover etc in the cluster module.

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
  • http://www.dbmanagement.info/Tutorials/MYSQL-PHP.htm MYSQL - PHP Video Training Tutorial DVDs (2 DVDs) Sale Price 19.97 More than 8 GB of Video files
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
1,341
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
55
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

MySQL User Camp: MySQL Cluster

  1. 1. MySQL Cluster Priyanka Sangam (priyanka.sangam@oracle.com) Insert Picture Here
  2. 2. Safe Harbour Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  3. 3. Agenda • Introduction to MySQL Cluster • Working with Cluster tables • Cluster Nodes • Architecture • Auto-sharding • Failover
  4. 4. Introduction to MySQL Cluster • Distributed transactional database • In-memory storage • Auto-sharding • Shared-nothing architecture • Automatic failover and recovery • Runs on commodity hardware • SQL + NoSQL interfaces
  5. 5. mysql> create table t1(id int primary key, value varchar(10))engine=ndb; Query OK, 0 rows affected (0.80 sec) mysql> show create table t1; +­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | Table | Create Table                              |                                +­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ | t1    | CREATE TABLE `t1` (   `id` int(11) NOT NULL,   `value` varchar(10) DEFAULT NULL,   PRIMARY KEY (`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1          | +­­­­­­­+­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­+ 1 row in set (0.00 sec) mysql> insert into t1 values(1, "one"), (2,"two"); Query OK, 2 rows affected (0.00 sec) Records: 2  Duplicates: 0  Warnings: 0 mysql> select * from t1; +­­­­+­­­­­­­+ | id | value | +­­­­+­­­­­­­+ |  1 | one   | |  2 | two   | +­­­­+­­­­­­­+ 2 rows in set (0.00 sec) Working with Cluster Tables
  6. 6. Cluster Nodes •Data Nodes •Store cluster data •Data partitioned + replicated across many data nodes •ndbd (single-threaded) or ndbmtd (multi-threaded) •SQL Nodes •Access cluster data by querying data nodes •SQL + NoSQL •mysqld •Management Nodes •Manage other nodes •Config, startup, shutdown, backup etc. •ndb_mgmd
  7. 7. Architecture
  8. 8. ndb_mgm mysql@host1:~$ ndb_mgm ­e show Connected to Management Server at: localhost:1186 Cluster Configuration ­­­­­­­­­­­­­­­­­­­­­ [ndbd(NDB)]     2 node(s) id=2    @127.0.0.1  (mysql­5.5.36 ndb­7.2.16, Nodegroup: 0, *) id=4    @127.0.0.1  (mysql­5.5.36 ndb­7.2.16, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1    @127.0.0.1  (mysql­5.5.36 ndb­7.2.16) [mysqld(API)]   4 node(s) id=3    @127.0.0.1  (mysql­5.5.36 ndb­7.2.16) id=5 (not connected, accepting connect from any host) id=7 (not connected, accepting connect from any host) id=9 (not connected, accepting connect from any host)
  9. 9. Auto-sharding – partitioning a table
  10. 10. Auto-sharding – fragments
  11. 11. Auto-sharding - nodegroups
  12. 12. Failover • << Initial state >> • Node1: Primary F1, Secondary F2, Nodegroup 0 • Node2: Primary F2, Secondary F1, Nodegroup 0 • Node3: Primary F3, Secondary F4, Nodegroup 1 • Node4: Primary F4, Secondary F3, Nodegroup 1 • << Node1 fails >> • Node2: Primary F1, Primary F2 • Node3: Primary F3, Secondary F4, Nodegroup 1 • Node4: Primary F4, Secondary F3, Nodegroup 1 • << Node2 fails >> • Cluster failure due to missing nodegroup • Node3. Node4 shut down
  13. 13. References • Introduction to MySQL Cluster: http://www.slideshare.net/andrewjamesmo rgan/mysql-cluster-introduction • Cluster Reference Manual: http://dev.mysql.com/doc/mysql-cluster-ex cerpt/5.1/en/index.html

×