About the Authors |
|
xxi | |
About the Technical Reviewer |
|
xxiii | |
Acknowledgments |
|
xxv | |
Introduction |
|
xxvii | |
|
|
1 | (64) |
|
Chapter 1 Architecture and Core Concepts |
|
|
3 | (20) |
|
|
3 | (3) |
|
Characteristics and Features |
|
|
6 | (5) |
|
|
6 | (1) |
|
|
6 | (2) |
|
|
8 | (2) |
|
|
10 | (1) |
|
|
11 | (5) |
|
|
12 | (2) |
|
|
14 | (1) |
|
|
15 | (1) |
|
Built-In High Availability |
|
|
16 | (5) |
|
Shared Nothing Architecture |
|
|
16 | (2) |
|
|
18 | (1) |
|
Data Node Failure Handling and Arbitration |
|
|
19 | (2) |
|
|
21 | (2) |
|
|
23 | (42) |
|
Single-Threaded Versus Multi-Threaded Data Nodes |
|
|
23 | (3) |
|
|
23 | (3) |
|
Performance Considerations |
|
|
26 | (1) |
|
|
26 | (3) |
|
Primary and Backup Replicas |
|
|
26 | (1) |
|
MySQL NDB Cluster 7.5: Read from Backup Replica |
|
|
27 | (2) |
|
|
29 | (1) |
|
|
30 | (10) |
|
|
31 | (1) |
|
User-Defined Partitioning |
|
|
32 | (1) |
|
MySQL NDB Cluster 7.5: Partition Balancing |
|
|
32 | (1) |
|
MySQL NDB Cluster 7.5: Fully Replicated Tables |
|
|
33 | (1) |
|
Case Study: Partition Distribution |
|
|
33 | (7) |
|
|
40 | (3) |
|
|
41 | (1) |
|
|
42 | (1) |
|
|
42 | (1) |
|
Global Checkpoints (GCPs) |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
44 | (8) |
|
|
44 | (1) |
|
|
45 | (4) |
|
|
49 | (1) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
52 | (4) |
|
Data Memory and Index Memory |
|
|
52 | (1) |
|
|
53 | (2) |
|
BLOB, TEXT, and JSON Columns |
|
|
55 | (1) |
|
Cases Studies: Investigating the Schema Objects |
|
|
56 | (6) |
|
The ndb_show_tables Utility |
|
|
57 | (1) |
|
|
58 | (4) |
|
|
62 | (2) |
|
|
64 | (1) |
|
Part II Installation and Configuration |
|
|
65 | (172) |
|
Chapter 3 System Planning |
|
|
67 | (18) |
|
Determine Your Priorities |
|
|
67 | (1) |
|
High Availability Requirements |
|
|
67 | (2) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
68 | (1) |
|
Prepare for Network Partitioning |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
71 | (6) |
|
|
71 | (1) |
|
Maximum Number of Data Nodes |
|
|
71 | (1) |
|
Maximum Number of Total Nodes |
|
|
71 | (1) |
|
|
72 | (1) |
|
Placing the SQL Node and the Data Node on the Same Machine |
|
|
72 | (1) |
|
Typical Topology Examples |
|
|
72 | (5) |
|
|
77 | (3) |
|
Processor Type and Operating System |
|
|
77 | (1) |
|
CPU Performance and Characteristics |
|
|
77 | (2) |
|
|
79 | (1) |
|
|
80 | (1) |
|
|
80 | (1) |
|
|
80 | (1) |
|
|
80 | (1) |
|
|
81 | (1) |
|
|
81 | (1) |
|
|
81 | (1) |
|
Extending Capacity Using Disk Objects |
|
|
81 | (1) |
|
Performance Considerations |
|
|
82 | (1) |
|
|
82 | (1) |
|
|
82 | (1) |
|
|
82 | (3) |
|
|
85 | (56) |
|
|
85 | (3) |
|
|
85 | (2) |
|
|
87 | (1) |
|
|
88 | (3) |
|
Major Options for Management Node |
|
|
88 | (3) |
|
Vital Point for Management Node Configuration |
|
|
91 | (1) |
|
|
91 | (36) |
|
|
91 | (2) |
|
Memory Data Storage Options |
|
|
93 | (3) |
|
|
96 | (3) |
|
|
99 | (4) |
|
Estimate for Total Memory Consumption |
|
|
103 | (1) |
|
|
104 | (7) |
|
|
111 | (1) |
|
|
112 | (4) |
|
Consideration for CPU Properties |
|
|
116 | (1) |
|
|
117 | (3) |
|
|
120 | (1) |
|
|
121 | (3) |
|
Heartbeat and Watchdog Options |
|
|
124 | (2) |
|
|
126 | (1) |
|
Recommended Configuration Strategy |
|
|
127 | (1) |
|
|
127 | (3) |
|
Major Options for SQL Node |
|
|
128 | (2) |
|
Vital Point for SQL Node Configuration |
|
|
130 | (1) |
|
|
130 | (3) |
|
Major Options for Transporter |
|
|
131 | (1) |
|
Transporter via Separate Network Path |
|
|
132 | (1) |
|
Program Startup Options (my.cnf) |
|
|
133 | (7) |
|
|
133 | (1) |
|
Major Options for ndb_mgmd |
|
|
134 | (2) |
|
|
136 | (1) |
|
|
137 | (2) |
|
|
139 | (1) |
|
|
140 | (1) |
|
|
141 | (34) |
|
|
141 | (25) |
|
|
141 | (4) |
|
|
145 | (6) |
|
|
151 | (9) |
|
|
160 | (6) |
|
Installing MySQL NDB Cluster Instances Using Auto Installer |
|
|
166 | (5) |
|
|
171 | (2) |
|
|
171 | (1) |
|
|
171 | (1) |
|
|
172 | (1) |
|
|
173 | (1) |
|
Tar.gz and Zip Archive Package |
|
|
173 | (1) |
|
|
173 | (1) |
|
Windows Installer Package |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (62) |
|
NDB Cluster Replication Overview |
|
|
175 | (6) |
|
Replication Architecture Overview |
|
|
175 | (3) |
|
Replication Channel Failover |
|
|
178 | (1) |
|
NDB Cluster Replication Tables |
|
|
179 | (1) |
|
Use Cases and Advantages of NDB Cluster Replication |
|
|
179 | (2) |
|
Setting Up NDB Cluster Replication |
|
|
181 | (10) |
|
Setting Up NDB Cluster Replication with an Empty Database |
|
|
182 | (4) |
|
Setting Up NDB Cluster Replication with an Existing Database (Offline) |
|
|
186 | (1) |
|
Setting Up NDB Cluster Replication with Existing Database (Online) |
|
|
186 | (2) |
|
Failing Over NDB Cluster Replication Channel |
|
|
188 | (3) |
|
NDB Cluster Replication Daily Maintenance |
|
|
191 | (7) |
|
Monitoring NDB Cluster Replication |
|
|
191 | (4) |
|
Restarting Master Cluster |
|
|
195 | (1) |
|
NDB Cluster Replication Performance Tuning |
|
|
196 | (2) |
|
Conflict Detection and Resolution |
|
|
198 | (31) |
|
|
198 | (3) |
|
Conflicts Caused by Multi-Master Replication |
|
|
201 | (2) |
|
Conflict Detection Methods |
|
|
203 | (9) |
|
Conflict Detection for Read Operations |
|
|
212 | (1) |
|
Setting Up Conflict Detection and Resolution |
|
|
213 | (6) |
|
Monitoring Conflict Detection |
|
|
219 | (2) |
|
Conflict Detection Case Study |
|
|
221 | (6) |
|
Application Modifications Required for Conflict Detection |
|
|
227 | (1) |
|
Cautions and Limitations of Conflict Detection |
|
|
228 | (1) |
|
|
229 | (5) |
|
Requirements and Limitations |
|
|
229 | (2) |
|
Setting Up Replication to InnoDB |
|
|
231 | (3) |
|
Tips When Using InnoDB as a Slave |
|
|
234 | (1) |
|
MySQL Server Options Related to Cluster Replication |
|
|
234 | (2) |
|
Notes and Limitations of NDB Cluster Replication |
|
|
236 | (1) |
|
|
236 | (1) |
|
Part III Daily Tasks and Maintenance |
|
|
237 | (202) |
|
Chapter 7 The NDB Management Client and Other NDB Utilities |
|
|
239 | (12) |
|
The NDB Management Client |
|
|
239 | (8) |
|
Invoking the NDB Management Client |
|
|
240 | (2) |
|
Getting Help from Inside the Client |
|
|
242 | (1) |
|
|
243 | (1) |
|
Display the Cluster Status |
|
|
244 | (1) |
|
|
245 | (1) |
|
|
246 | (1) |
|
|
247 | (1) |
|
|
247 | (2) |
|
|
249 | (2) |
|
Chapter 8 Backups and Restores |
|
|
251 | (32) |
|
Backups and Backup Procedures |
|
|
251 | (1) |
|
Native NDB Cluster Online Backups |
|
|
252 | (9) |
|
|
252 | (1) |
|
|
253 | (2) |
|
Starting and Aborting Backups |
|
|
255 | (1) |
|
|
256 | (1) |
|
|
257 | (3) |
|
|
260 | (1) |
|
Logical Backups and Binary Logs |
|
|
261 | (10) |
|
Consistency Considerations |
|
|
261 | (1) |
|
|
262 | (4) |
|
Logical Backups from MySQL Workbench |
|
|
266 | (2) |
|
|
268 | (1) |
|
|
269 | (2) |
|
|
271 | (10) |
|
|
271 | (1) |
|
|
272 | (1) |
|
|
273 | (1) |
|
Restore to a Different Number of Data Nodes |
|
|
274 | (1) |
|
|
274 | (2) |
|
Restores Using MySQL Workbench |
|
|
276 | (1) |
|
Point-In-Time Recovery (PITR) |
|
|
277 | (4) |
|
|
281 | (2) |
|
Chapter 9 Table Maintenance |
|
|
283 | (26) |
|
|
283 | (7) |
|
Distributing Schema Changes and the Global Schema Lock |
|
|
283 | (2) |
|
Online Versus Offline Schema Changes |
|
|
285 | (1) |
|
|
286 | (1) |
|
|
287 | (1) |
|
|
288 | (2) |
|
|
290 | (2) |
|
|
290 | (1) |
|
Adding a Column with the Explicit Column Format |
|
|
290 | (1) |
|
Specifying Algorithm and Lock Type |
|
|
291 | (1) |
|
Attempting Unsupported In-Place Changes |
|
|
291 | (1) |
|
Schema Changes in Version 7.2 and Earlier |
|
|
292 | (1) |
|
|
292 | (4) |
|
|
296 | (1) |
|
|
297 | (10) |
|
Index Statistics Internals |
|
|
299 | (1) |
|
Maintaining Index Statistics |
|
|
300 | (3) |
|
Options and Status Variables |
|
|
303 | (4) |
|
|
307 | (2) |
|
|
309 | (42) |
|
|
310 | (2) |
|
|
310 | (1) |
|
|
310 | (1) |
|
|
311 | (1) |
|
|
311 | (1) |
|
|
312 | (2) |
|
Stopping and Starting Nodes |
|
|
314 | (6) |
|
|
315 | (2) |
|
|
317 | (3) |
|
|
320 | (1) |
|
Restart Related Configuration |
|
|
320 | (2) |
|
|
322 | (3) |
|
|
325 | (3) |
|
|
325 | (1) |
|
|
325 | (1) |
|
The ndbinfo.restart_info Table |
|
|
326 | (1) |
|
A Restart Seen in the Logs |
|
|
327 | (1) |
|
Example Restart Scenarios |
|
|
328 | (21) |
|
|
330 | (4) |
|
|
334 | (2) |
|
|
336 | (6) |
|
Adding Data Nodes with Node Group Pre-Allocated |
|
|
342 | (2) |
|
|
344 | (1) |
|
Recovering from a Corrupt NDB File System |
|
|
345 | (1) |
|
|
346 | (3) |
|
|
349 | (2) |
|
Chapter 11 Upgrades and Downgrades |
|
|
351 | (22) |
|
|
351 | (2) |
|
|
351 | (1) |
|
|
352 | (1) |
|
|
353 | (1) |
|
Performing Upgrades and Downgrades |
|
|
354 | (4) |
|
Online Upgrades and Downgrades |
|
|
357 | (1) |
|
Offline Upgrades and Downgrades |
|
|
358 | (1) |
|
|
358 | (13) |
|
Online Upgrade Using Generic Binaries |
|
|
360 | (4) |
|
Upgrade from 7.4 to 7.5 Using RPM |
|
|
364 | (3) |
|
|
367 | (3) |
|
|
370 | (1) |
|
|
371 | (2) |
|
Chapter 12 Security Considerations |
|
|
373 | (22) |
|
|
373 | (2) |
|
|
375 | (1) |
|
Accounts and Privileges in the SQL Nodes |
|
|
376 | (8) |
|
Accounts and Password Management |
|
|
377 | (4) |
|
|
381 | (1) |
|
The Access Control and Privilege System |
|
|
382 | (2) |
|
|
384 | (9) |
|
Enabling Distributed Privileges |
|
|
387 | (2) |
|
Disabling Distributed Privileges |
|
|
389 | (2) |
|
|
391 | (2) |
|
The Operating System and the Rest of the Infrastructure |
|
|
393 | (1) |
|
|
394 | (1) |
|
Chapter 13 MySQL Cluster Manager |
|
|
395 | (44) |
|
|
395 | (6) |
|
|
396 | (1) |
|
|
396 | (2) |
|
|
398 | (2) |
|
|
400 | (1) |
|
Download, Installation, and Configuration |
|
|
401 | (15) |
|
|
402 | (2) |
|
|
404 | (2) |
|
Installation on Microsoft Windows |
|
|
406 | (3) |
|
|
409 | (1) |
|
|
410 | (4) |
|
Starting and Stopping MySQL Cluster Manager |
|
|
414 | (1) |
|
The MySQL Cluster Manager Client |
|
|
415 | (1) |
|
|
416 | (17) |
|
Installing the Cluster Binaries |
|
|
416 | (1) |
|
Preparing the Cluster Through the mcm Client |
|
|
417 | (3) |
|
Cluster Configuration: Auto Tuning |
|
|
420 | (2) |
|
Cluster Configuration: The set Command |
|
|
422 | (1) |
|
Cluster Configuration: The get Command |
|
|
423 | (1) |
|
Cluster Configuration: The reset Command |
|
|
424 | (1) |
|
Starting and Stopping Processes |
|
|
425 | (2) |
|
Configuration of an Online Cluster |
|
|
427 | (2) |
|
|
429 | (2) |
|
|
431 | (1) |
|
|
432 | (1) |
|
Troubleshooting MySQL Cluster Manager |
|
|
433 | (4) |
|
Error Messages and the Log |
|
|
433 | (2) |
|
|
435 | (2) |
|
|
437 | (2) |
|
Part IV Monitoring and Troubleshooting |
|
|
439 | (130) |
|
Chapter 14 Monitoring Solutions and the Operating System |
|
|
441 | (16) |
|
|
441 | (4) |
|
|
442 | (1) |
|
Perform a Root Cause Analysis |
|
|
443 | (2) |
|
Perform Preventive Maintenance |
|
|
445 | (1) |
|
|
445 | (1) |
|
MySQL Monitoring Solutions |
|
|
446 | (1) |
|
MySQL Enterprise Monitor (MEM) |
|
|
446 | (7) |
|
|
447 | (1) |
|
Installation and Upgrades |
|
|
448 | (2) |
|
|
450 | (3) |
|
|
453 | (2) |
|
|
453 | (1) |
|
|
453 | (1) |
|
|
454 | (1) |
|
|
454 | (1) |
|
|
455 | (1) |
|
|
455 | (2) |
|
Chapter 15 Sources for Monitoring Data |
|
|
457 | (62) |
|
|
457 | (7) |
|
Information Schema Tables |
|
|
458 | (2) |
|
Using the Information Schema |
|
|
460 | (1) |
|
The Information Schema and NDB Cluster |
|
|
461 | (3) |
|
|
464 | (29) |
|
Performance Schema Threads |
|
|
465 | (2) |
|
Performance Schema Tables Overview |
|
|
467 | (1) |
|
Setup Tables and Configuration |
|
|
467 | (5) |
|
|
472 | (10) |
|
|
482 | (3) |
|
Connection and Thread Tables |
|
|
485 | (4) |
|
Variable and Status Tables |
|
|
489 | (1) |
|
|
490 | (1) |
|
|
491 | (2) |
|
|
493 | (1) |
|
|
493 | (18) |
|
|
494 | (1) |
|
|
495 | (9) |
|
|
504 | (2) |
|
Command-Line Usage and Examples |
|
|
506 | (4) |
|
MySQL Workbench Performance Reports |
|
|
510 | (1) |
|
|
511 | (3) |
|
|
514 | (3) |
|
|
514 | (2) |
|
|
516 | (1) |
|
|
517 | (2) |
|
Chapter 16 Monitoring MySQL NDB Cluster |
|
|
519 | (32) |
|
The NDB Cluster Information Database (ndbinfo) |
|
|
519 | (8) |
|
|
519 | (4) |
|
|
523 | (4) |
|
|
527 | (17) |
|
|
528 | (1) |
|
|
529 | (2) |
|
|
531 | (1) |
|
|
532 | (2) |
|
|
534 | (4) |
|
Log Buffers and Spaces Report |
|
|
538 | (2) |
|
|
540 | (4) |
|
|
544 | (6) |
|
|
544 | (5) |
|
|
549 | (1) |
|
|
550 | (1) |
|
Chapter 17 Typical Troubles and Solutions |
|
|
551 | (18) |
|
Typical Problems on Data Nodes |
|
|
551 | (12) |
|
General Information about Node Failures |
|
|
551 | (1) |
|
|
551 | (1) |
|
|
552 | (1) |
|
|
553 | (1) |
|
|
553 | (2) |
|
|
555 | (1) |
|
NDB Error Reporter Utility |
|
|
556 | (1) |
|
|
556 | (2) |
|
|
558 | (1) |
|
|
558 | (2) |
|
|
560 | (1) |
|
Network Partitioning (Split Brain) |
|
|
561 | (1) |
|
Unplanned Shutdown of Entire System |
|
|
562 | (1) |
|
Typical Problems on SQL Nodes |
|
|
563 | (4) |
|
Errors While Executing Queries |
|
|
563 | (1) |
|
Resource Temporary Errors |
|
|
563 | (1) |
|
|
563 | (1) |
|
Connection to Data Node Is Lost |
|
|
564 | (1) |
|
Errors Related to Transaction Handling |
|
|
564 | (1) |
|
|
565 | (2) |
|
Typical Problems on Management Nodes |
|
|
567 | (1) |
|
|
567 | (2) |
|
Part V Development and Performance Tuning |
|
|
569 | (112) |
|
Chapter 18 Developing Applications Using SQL with MySQL NDB Cluster |
|
|
571 | (40) |
|
|
571 | (24) |
|
Creating NDB Cluster Tables |
|
|
571 | (1) |
|
|
572 | (1) |
|
|
573 | (4) |
|
|
577 | (3) |
|
|
580 | (1) |
|
|
581 | (3) |
|
Estimating Required Objects per Table |
|
|
584 | (1) |
|
Defining Foreign Key Constraints |
|
|
584 | (1) |
|
Reviewing Table Definition |
|
|
585 | (3) |
|
|
588 | (5) |
|
Consideration for Normalization |
|
|
593 | (1) |
|
Major Limits Regarding Table Design |
|
|
594 | (1) |
|
|
595 | (13) |
|
|
595 | (7) |
|
Transaction Handling for NDBCluster Tables |
|
|
602 | (1) |
|
Error-Handling Techniques |
|
|
603 | (5) |
|
|
608 | (3) |
|
Chapter 19 MySQL NDB Cluster as a NoSQL Database |
|
|
611 | (44) |
|
|
611 | (1) |
|
Accessing Data via memcached |
|
|
612 | (10) |
|
|
612 | (1) |
|
|
613 | (3) |
|
Defining Mapping to NDB Cluster Tables |
|
|
616 | (6) |
|
Accessing Data via the NDB API |
|
|
622 | (28) |
|
|
622 | (1) |
|
Installing Header Files and Libraries for the NDB API |
|
|
623 | (1) |
|
Building an Application with the NDB API |
|
|
623 | (1) |
|
|
624 | (1) |
|
|
624 | (2) |
|
|
626 | (6) |
|
Accessing Data Using NdbRecord |
|
|
632 | (3) |
|
|
635 | (13) |
|
Error-Handling Considerations |
|
|
648 | (2) |
|
Accessing Data via ClusterJ |
|
|
650 | (4) |
|
|
650 | (1) |
|
Writing a ClusterJ Application |
|
|
651 | (1) |
|
|
651 | (3) |
|
|
654 | (1) |
|
Chapter 20 MySQL NDB Cluster and Application Performance Tuning |
|
|
655 | (26) |
|
|
655 | (11) |
|
Disabling Powersave and CPU Frequency Scaling |
|
|
655 | (2) |
|
|
657 | (8) |
|
Disk Type and File System Block Size |
|
|
665 | (1) |
|
|
666 | (14) |
|
|
666 | (1) |
|
Non-Transactional Batch Processing |
|
|
667 | (1) |
|
Engine Condition Pushdown Optimization |
|
|
667 | (1) |
|
|
668 | (4) |
|
|
672 | (5) |
|
Optimizing Access from SQL Node to Data Node |
|
|
677 | (2) |
|
|
679 | (1) |
|
Using NoSQL API in Conjunction with SQL |
|
|
680 | (1) |
|
|
680 | (1) |
Index |
|
681 | |