architectures supported, 480–483AWS case study, 484, 487–516best practices, 520–522characteristics of, 479defined, 478deployment models, 480economical considerations, 483–484elasticity a
Trang 1replication threads, 371scripting clone operation, 35–36security and, 64
Server class, 26–28server logs and, 315server roles, 28–30structure considerations, 20–22, 46–50troubleshooting, 392
verbose option, 564binary log eventsdefined, 46logging statements, 61–66structure considerations, 46–50troubleshooting, 389–391binlog dump thread, 371binlog file format version, 48–50, 84binlog file rotation, 83
binlog filescreating, 88creation time, 98dumping contents, 88functionality, 47processing order, 92purging, 85, 86reading remotely, 93shared disks and, 117binlog index filefunctionality, 47purging, 85, 87binlog injector thread, 554binlog-cache-size option, 99binlog-cache-size server variable, 84binlog-do-db option, 59–61, 163, 315, 369binlog-format option, 230, 231, 553binlog-ignore-db option, 59–61, 163, 315, 369binlog-in-use flag, 81, 84, 96
binlog-max-row-event-size option, 231Binomial tail distribution, 105Blackhole storage engine, 160, 334bootstrapping a slave, 30
Bott, Ed, 283browser plug-ins, 494buckets, defined, 491buffer pools
defined, 353monitoring, 360–363Bunce, Tim, 429business continuity (see information integrity)
C
CA (certification authority), 203, 204CACHE INDEX command, 350Cacti tool, 252
CALL statement, 68central store duplicating, 156certification authority (CA), 203, 204chain topology, 402
CHANGE MASTER commandcloud computing and, 518connecting to downstream server, 144IGNORE_SERVER_IDS option, 144, 398,
399master heartbeats, 383master status variables and, 376MASTER_HOST option, 202noting slave position, 118troubleshooting replication, 400troubleshooting slaves, 393, 395usage example, 145
CHANGE MASTER TO commandconfiguring replication, 199configuring slaves, 32CONNECT_RETRY parameter, 215creating slaves, 30
hot standby and, 114MASTER_SSL option, 204MASTER_SSL_CAPATH option, 204MASTER_SSL_CERT option, 204MASTER_SSL_KEY option, 204privilege considerations, 16replication status information, 207slave promotion, 129, 134usage example, 15channel, defined, 554checksumming, 251circular replicationdepicted, 152functionality, 142–146ignoring servers, 572topology, 403troubleshooting, 398clone function, 35cloning operationmaster servers, 30, 31scripting, 35–36slave servers, 33–34closed recovery images, 441cloud computing
Trang 2architectures supported, 480–483AWS case study, 484, 487–516best practices, 520–522characteristics of, 479defined, 478
deployment models, 480economical considerations, 483–484elasticity and, 482
grid computing and, 481MySQL Enterprise and, 473open source, 522
potential benefits, 485replication and, 517–520service models, 479software libraries and, 483transactional computing and, 482use cases, 484
vendor support, 486virtualization and, 481clustered indexes, 353comments
hash marks in, 90retrieving, 177COMMIT statementlogging transactions, 75query events and, 234slave promotion, 132two-phase commit and, 150commit_and_sync function, 186, 190compressing tables, 345, 347concat function, 319configuration filebest practices, 404binary log and, 47, 59–61, 165configuring masters, 13–14configuring slaves, 15managing replication, 24options supported, 58Server class and, 26SSL considerations, 204troubleshooting replication, 400CONNECTION_ID functionrow-based replication and, 229session-specific, 216
thread ID and, 56, 57connect_to helper function, 157consistency (see data consistency)Console application, 271 console option, 315
constraints, best practices, 337context events
logging queries, 51–57SQL threads and, 217–220contingency plans (high availability)defined, 104
disaster recovery, 107, 417master failures, 106planning considerations, 106relay failures, 107
slave failures, 106CPU-bound processes, 249Create Basic Task Wizard, 43CREATE FUNCTION statement, 69CREATE INDEX command, 538CREATE PROCEDURE statement, 67CREATE ROUTINE privilege, 70CREATE statement
binlog events and, 48ENGINE parameter, 334logging transactions, 76CREATE TABLE IF NOT EXISTS statement,
46, 135CREATE TABLE statementimplicit commits and, 135logging, 51
CREATE TRIGGER statementDEFINER clause, 65security considerations, 63CREATE USER privilege, 16Create_file_log_event, 58credentials
getting, 498instances and, 500cron facility, 253, 268crontab files, 42CSV storage engine, 334CURDATE function, 53current databasebinary log filters, 59–61, 567logging queries, 51, 52query events and, 97USE statement, 60current time, logging queries, 52, 53CURRENT_ID function, 52CURRENT_USER function, 229, 231CURTIME function, 53
cycle function, 228Cygwin environment, 429
Trang 3dashboards, 453(see also Enterprise Dashboard)defined, 453
MEM support, 456Data Collector Sets, 287data consistencyasynchronous replication and, 150, 151
in hierarchal deployment, 187–193managing, 184–187
MyISAM considerations, 82
in nonhierarchal deployment, 185–187Data Definition Language (DDL) statementsbackups and, 430
logging statements, 51logging transactions, 76data managers, 481Data Manipulation Language (DML), 50data protection, 410
data recovery, 439(see also disaster recovery)backup and restore, 420–424example, 440
importance of, 419PITR and, 439–445replication and, 438terminology, 419data shardingcommon usage, 167database considerations, 175dynamic, 170, 178–180example, 173–184load balancing and, 168, 171–173, 180–
184managing, 168moving between shards, 173moving to different nodes, 171–173naming considerations, 169partition keys/functions, 175–176partitioning data, 170
process overview, 165–168reading shards, 177–178representing shards, 168slave lag and, 385static, 170writing data and, 149data-mining queries, 37databases
copying files, 108
measuring performance, 320–331optimizing, 331–339, 368performance information, 320replication after crashes, 222–225sharding, 175
datadir startup option, 344, 435Date, C J., 320
dd command, 521DDL (Data Definition Language) statementsbackups and, 430
logging statements, 51logging transactions, 76defragmenting tables, 348delayed slaves, 5
DELETE statementLIMIT clause, 229, 240logging, 50
nontransactional changes and, 225stored procedures and, 66WHERE clause, 46Delete_rows events, 232, 237deployment
defined, 24hierarchal, 187–193nonhierarchal, 185–187DESCRIBE command, 320
df command, 264diamond configuration, 226differential backups, 422disaster avoidancehot standby, 11, 111–114, 148remote replication and, 148disaster recovery, 439
(see also data recovery)contingency plans, 107goal of, 414
high availability and, 418, 550–551information integrity and, 412, 413–419planning considerations, 415
practicing, 417slave servers, 222–226tools and strategies, 417–419workflow considerations, 415–417disk usage
AWS considerations, 511–516Linux/Unix environments, 261Mac OS X environment, 274monitoring, 247, 250optimizing, 344
Trang 4Disk Usage Analyzer, 264disk-bound processes, 250distributed data, redundancy and, 531Distributed Replicated Block Device (DRBD),
118distributed transaction processing, 79–81distribution costs, managing replication, 153DML (Data Manipulation Language), 50DRBD (Distributed Replicated Block Device),
118DROP command, 335DROP INDEX command, 538DROP TABLE IF EXISTS statement, 46DROP TABLE statement, 22, 135dual-master setup
active-active setup, 115, 116, 120–124active-passive setup, 115, 116, 119bidirectional replication, 120–124, 166defined, 6
depicted, 152high availability and, 115–124managing replication, 23replicated disks and, 118shared disks and, 117dynamic sharding, 170, 178–180
E
ec2-add-key-pair command, 495ec2-attach-volume command, 515ec2-authorize command, 510ec2-create-snapshot command, 516ec2-create-volume command, 515ec2-delete-snapshot command, 516ec2-delete-volume command, 516ec2-describe-images command, 496, 509ec2-describe-snapshots command, 516ec2-describe-volumes command, 515ec2-detach-volume command, 515ec2-run-instances command, 496, 509ec2-start-instances command, 496ec2-stop-instances command, 496ec2-terminate-instances command, 496, 510elastic load balancing, 489
Elastic MapReduce, 488Elasticfox (Firefox plug-in), 494elasticity, cloud computing and, 482EmptyRowError exception, 25_enable_binlog helper method, 136encryption
security considerations, 64SSL support, 202
Enki Consulting, 486Enterprise DashboardAdvisors tab, 469consolidated server graphs, 466functionality, 456
heat charts, 464Query Analyzer and, 459Replication tab, 468server details, 467epochs, defined, 531Error class, 25error handlinglog messages and, 282logging statements, 72–75error logs, 314
Event Scheduler, 42Event Viewer, 281–283events, 46
(see also binary log events)affecting replication, 81defined, 71
DEFINER clause, 71executing, 236–237filtering, 162–164, 221–222handling row-based replication, 232–236incidents and, 85
interpreting, 94–98logging statements, 61–66, 71object definitions, 180partitioning to slaves, 164password considerations, 64skipping, 217, 221–222slave processing, 215–222SQL thread processing, 217triggers and, 238–239excessive lag, 396Execute_load_query event, 57Execute_log_event, 58expire-logs-days option, 86, 98EXPLAIN command
best practices, 339executing queries, 458functionality, 320–327indexes and, 331usage example, 313EXTENDED keyword, 323extended-status command, 301
Trang 5external replication, 552
F
Faroult, Stephane, 320fdisk command, 264Federated storage engine, 335fetch_global_trans_id function, 140fetch_master_pos function, 35, 186, 191fetch_relay_chain function, 191fetch_remote_binlog function, 40, 138fetch_slave_pos function, 35
fetch_trans_id function, 190file IDs, 57
filesystemcoordinating synchronization, 83disk usage and, 250
logging changes, 51, 76logical volumes and, 434memory considerations, 250object definitions and, 180reading remote files, 93snapshot support, 108filtering
current database, 567partitioning events to slaves, 164replication events, 162–164row-based replication, 240scaling out and, 149skipping events, 221–222SQL threads and, 217filtering, binary log filters and, 59–61Final role, 29
find_datetime_position function, 40FLUSH LOGS command
binlog file support, 47functionality, 18, 84monitoring master servers, 374privilege considerations, 16troubleshooting binary log, 392FLUSH QUERY CACHE command, 300FLUSH STATUS command, 307FLUSH TABLES command, 429FLUSH TABLES WITH READ LOCK
commandcloning the master, 31EBS snapshots and, 514InnoDB cautions, 34LVM support, 436pausing replication, 406
releasing locks, 27foreign keys, 338format description eventsbinlog event structure, 47, 48–50functionality, 19, 20
header restrictions, 97I/O threads and, 216
in binary log, 20, 84interpreting, 97printing, 89
XA and, 81fragments, defined, 552free command, 253, 259fsync call, 223, 224
G
general query logs, 314getArticlesForUser function, 177, 182getCommentsForArticle function, 177getServerConnection function (PHP), 157global redundancy, 530, 557
global transaction IDscircular replication, 144, 145data consistency example, 187, 190defined, 130
slave promotion and, 130–135, 137, 139GNOME desktop project, 264
Gnome System Monitor, 252Governor, James, 478GRANT OPTION privilege, 16graphical user interfaces (GUIs), 268, 302grep command, 258, 509
grid computing, 481groups, defined, 48group_by_event function, 138group_by_trans function, 138GUIs (graphical user interfaces), 268, 302
H
hardwaredata loss and, 421node recovery and, 551hash mark (#), 90HA_ERR_KEY_NOT_FOUND error, 399Health Insurance Portability and
Accountability Act (HIPAA), 412heartbeats, 383, 551, 571
heat charts, 464
Trang 6Heisenberg uncertainty, 306Hibernate Shards (Google), 168hierarchal deployment, 187–193hierarchal replication
defined, 159setting up relay servers, 160high availability
achieving, 547–550backups and, 6contingency plans, 104, 106–107disaster recovery and, 418information integrity and, 412MyISAM storage engine and, 352node recovery and, 551
procedures and, 104, 107–146redundancy and, 103, 104replication and, 6, 552–556system recovery and, 550–551HIPAA (Health Insurance Portability and
Accountability Act), 412HiveDB sharding implementation, 168horizontal partitioning (see data sharding)host-bin option, 99
hostname-bin option, 14hot standby
defined, 11disaster avoidance through, 11, 148high availability and, 111–114hybrid topology, 403
I
IA (information assurance)additional information, 410defined, 410
importance of, 411related practices, 410IaaS (Infrastructure as a Service)defined, 479
virtualization and, 481ibbackup utility
apply-log option, 426core operations, 425performing backups, 425restoring data, 427 uncompress option, 426IBM Blue Cloud, 486ifconfig command, 265IGNORE LEAVES clause, 350images, defined, 481
Incident event type, 86incident events, defined, 85incremental backups, 422index file (see binlog index file)indexes
best practices, 331, 338clustered, 353
fine-tuning, 320preloading, 349queries and, 294, 299information assurance (see IA)information integrity
backup and restore, 420–424data recovery and, 419defined, 410, 411–412disaster recovery and, 412, 413–419high availability and, 412
overview, 411information significance, 410INFORMATION_SCHEMA database, 363–
364Infrastructure as a Service (see IaaS) initial option, 543
initial-start option, 543init_file option, 389innobackup scriptfunctionality, 427options supported, 427performing backups, 428restoring data, 428InnoDB Hot Backupapplication, 425–428, 437cloning the master, 31InnoDB storage enginearchitectural features, 353data sharding and, 174dual-master setup and, 118functionality, 334
handling row locks, 182Hot Backup, 33, 108, 425–428improving performance, 352INFORMATION_SCHEMA database,
363–364InnoTop system activity report, 317monitor mechanism, 357–359monitoring buffer pools, 360–363monitoring logfiles, 359
monitoring tablespaces, 363OPTIMIZE TABLE command, 330
Trang 7parameters supported, 365recovery considerations, 119semisynchronous replication, 124SHOW ENGINE INNODB STATUS
command, 354–356slave promotion and, 131snapshot support, 108
XA support, 83innodb_fast_shutdown option, 365innodb_thread_consistency option, 365InnoTop system activity report, 317INSERT INTO statement, 135INSERT statement
invoking triggers, 65LIMIT clause, 229, 240logging, 50
nontransactional changes and, 73, 225stored functions and, 69
stored procedures and, 66usage examples, 90, 219INSERT_ID session variable, 218instances
defined, 481launching, 508–511running, 501–508storage considerations, 511instances, credentials and, 500integer data, interpreting, 94internal replication, 552Internet, running replication over, 202–206Intvar event
functionality, 54, 218mysqlbinlog support, 90, 91stored procedures and, 68inventory assessment, 416I/O threads
functionality, 200handling broken connections, 215housekeeping, 216
replication and, 371starting and stopping, 201state considerations, 210–212synchronizing, 224
I/O transfer rates, 262I/O-bound processes, 251I/O-starved processes, 251ionice command, 255iostat command, 253, 255, 261itertools module, 228
creating, 350monitoring, 348multiple, 350preloading, 349KILL command, 295, 301
L
LAST_INSERT_ID functionglobal transaction ID, 132logging queries and, 52, 53, 54LAST_INSERT_ID session variable, 218Layered Technologies (vendor), 487legal requirements, data preservation, 7L’Hermite, Pascal, 320
LIKE clause, 295LIMIT clause, 229, 240Linux class, 26Linux environmentautomated monitoring, 268disk usage, 261–264general system statistics, 266InnoDB Hot Backup application, 425LVM support, 31, 34, 108
managing replication, 24memory usage, 259–261monitoring, 246, 253–268network activity, 265process activity, 253–258Linux High Availability project, 118load balancing
application-level, 155–158data sharding and, 168, 171–173, 180–184elastic, 489
managing replication, 152for reads, 148
slave lag and, 385for writes, 148LOAD DATA INFILE statementdata sharding example, 184handling current database, 52LOAD_FILE function and, 72
Trang 8logging statements, 57–58logging transactions, 76LOAD INDEX command, 349LOAD_FILE function, 72, 231Load_log_event, 58
LOCAL keyword, 329, 330local query handler, 537local redundancy, 530, 557LOCK TABLES command, 172locks
reducing contention, 385releasing, 27
row, 182LOCK_log mutex, 50 log startup option, 314log-bin option
controlling binlog files, 47functionality, 13, 99, 315Server class and, 26slave promotion and, 129log-bin-index optioncontrolling binlog files, 47functionality, 13, 99, 315Server class and, 26log-bin-trust-function-creators option, 71, 99 log-error startup option, 315
log-output startup option, 314log-slave-updates optionbidirectional replication, 121binary logging and, 393hierarchal replication, 160hot standby and, 112slave promotion and, 129, 130, 136 log-slow-queries startup option, 314 log-slow-slave-statements option, 314logfiles
applying to backups, 426best practices, 404Console application and, 271Event Viewer support, 281InnoDB storage engine and, 353monitoring, 359
RESET_SLAVE command and, 199server logs, 313
troubleshooting replication, 400troubleshooting tables, 391logging statements
binary log filters, 59–61DDL statements, 51
DML statements, 50error handling, 72–75events, 61–66, 71LOAD DATA INFILE statement, 57–58LOCK_log mutex, 50
nontransactional changes, 72–75query events, 51–57
special constructions, 71stored functions, 61, 66, 69–70stored procedures, 61, 66–68stored programs, 61–66stored routines, 61–66triggers, 61–66logging transactionsimplicit commits and, 76starting transactions, 75transaction cache, 76–79
XA support, 79–81logical backups, 422Logical Volume Manager (see LVM)logical volumes, 434
Loukides, Mike, 262
ls command, 264Lua programming language, 154lvcreate command, 434
LVM (Logical Volume Manager)backup comparisons, 437cloning slaves, 34cloning the master, 31functionality, 432snapshot support, 108usage considerations, 433–436lvremove command, 435
lvscan command, 435
M
Mac OS X environmentActivity Monitor, 273–276Console application, 271monitoring, 246, 268–276System Profiler, 268–271Machine class, 26
management buy-in, 416managing binary log, 81–87Martelli, Alex, 140
master dump thread, 200master filters
creating, 163defined, 162
Trang 9master heartbeats, 383master log information fileflushing, 224
functionality, 198manipulating slave threads, 201replication status information, 212Master role
defined, 29replicate_from function and, 35master servers
checking status, 403circular replication, 142–146cloning, 30, 31
configuring, 13connecting to slaves, 14, 15creating, 7
creating replication users, 14delayed slaves, 5
dual-master setup, 6, 23, 115–124handling failures, 106, 109hierarchal replication, 159monitoring, 372–376monitoring thread status, 371multimaster issues, 399replication overview, 5scripting the clone operation, 35server roles, 28–30
status variables and, 376switching, 109, 112–114tips and tricks, 568–570troubleshooting, 388–393two-phase commit and, 150upgrading, 110
master-connect-retry option, 215master-retry-count option, 215MASTER_POS_WAIT functiondata consistency example, 185, 186, 187functionality, 40, 172
relay log processing and, 213max-allowed-packet option, 58, 397max-binlog-cache-size option, 100max-binlog-size option, 100Maxia, Giuseppe, 154MD5 function, 220MEM (see MySQL Enterprise Monitor)memcached technique, 156, 171memory
cautions when tweaking, 250Mac OS X environment, 274
monitoring, 247, 249, 259–261node recovery and, 551troubleshooting, 389, 395Memory storage engine, 335memory-bound processes, 249Merge storage engine, 335MERGE view, 122Microsoft Azure, 483Microsoft Management Console snap-ins, 42mission statements, 416
mixed-mode replication, 231Mollinaro, Anthony, 320monitoring, 292(see also performance considerations)automated, 268
benefits of, 247buffer pools, 360–363categories of, 246defined, 246disk usage, 247, 250, 261–264, 274general system statistics, 266InnoDB storage engine, 352–365key cache, 348
Linux environment, 246, 253–268logfiles, 359
Mac OS X environment, 246, 268–276master servers, 372–376
memory, 247, 249, 259–261, 274MyISAM storage engine, 344–352MySQL Administrator and, 381MySQL Enterprise, 463–470MySQL servers, 292–319network activity, 248, 251, 265, 275
as preventive maintenance, 288process activity, 253–258processor, 247, 248replication, 367–386semisynchronous replication, 127slave lag, 383
slave servers, 376tablespaces, 363tools for, 252Unix environment, 246, 253–268usage examples, 7
Windows environment, 246, 276–288monitoring agents, 457, 462
MONyog tool, 317mount command, 435mpstat command, 253, 255, 257
Trang 10multichannel replication, 554, 567multimaster topology, 399, 403multisource replication, 226–228, 566Musumeci, Gian-Paolo D., 262mutex, 356
myisam ftdump utility, 345MyISAM storage enginecompressing tables, 347consistency considerations, 82defragmenting tables, 348dual-master setup and, 118functionality, 334
handling row locks, 182high availability and, 352improving performance, 344monitoring key cache, 348nontransactional changes and, 73, 75, 225OPTIMIZE TABLE command, 330optimizing disk storage, 344parameters supported, 351preloading key cache, 349query cache and, 298, 307recovery considerations, 119slave promotion and, 131tables in index order, 347troubleshooting tables, 397tuning tables, 345–346myisam-recover option, 392myisamchk utility
defragmenting tables, 348functionality, 345–346tables in index order, 347myisamlog utility, 345myisampack utility, 345, 347MySAR system activity report, 316MySQL
additional information, 8version considerations, 24MySQL AdministratorConnection Health tab, 303functionality, 302
Key Efficiency graph, 307Memory Health tab, 306page tool, 311
Query Cache Hitrate graph, 307replication monitoring, 381Server Variables tab, 309Status Variables tab, 310Traffic graph, 304
MySQL Clusterarchitecture basics, 532–538, 554commit support, 151
data nodes, 543data storage, 533–536example configuration, 539–547features, 528–529
functionality, 526getting started, 539–541high availability and, 547–556high performance and, 557–560log handling, 531
management node, 541NDB management console, 542online operations, 537
partitioning and, 536redundancy and, 530, 531, 557reload event, 86
replication, 566replication and, 553shutting down clusters, 546SQL nodes, 544
starting, 541–546terminology and components, 526testing clusters, 546
transaction management, 537typical configuration, 527mysql database
logging transactions, 76object definitions and, 180MySQL Enterprise
alert details, 464background information, 452clouding computing and, 473components, 456–460fixing monitoring agents, 462installing, 454–455, 460–462monitoring, 463–470production support, 459Query Analyzer, 470–472subscription levels, 453usage considerations, 460MySQL Enterprise Backup, 425MySQL Enterprise Monitoradditional information, 252advisors, 457
background information, 453Enterprise Dashboard, 456functionality, 452, 456
Trang 11installing, 455monitoring agents, 457, 463Query Analyzer, 458MySQL Enterprise Server, 456MySQL Forge, 155
MySQL Migration Toolkit, 302MySQL monitor, 294
MySQL Monitor and Advisor (MONyog) tool,
317MySQL Proxydata sharding and, 168load balancing and, 154multimaster replication, 565reporting statistics, 470MySQL Python
adding relay servers, 161additional information, 8common replication tasks, 36–43handing reporting, 40
handling switchovers, 114managing replication, 23–25PITR and, 443–445
slave promotion, 135–141MySQL Query Browser, 312–313MySQL servers
benchmark suite, 318–319communicating performance, 293GUI tools, 302
MySQL Administrator, 302–312MySQL Query Browser, 312–313mysqladmin utility, 300–302performance monitoring, 293server logs, 313
SQL commands, 294–300third-party tools, 316–318MySQL System Tray Monitor, 313mysql utility, 32
mysql.com outage, 110mysqladmin utilitycommands supported, 300 relative option, 301 sleep option, 301mysqlbinlog utility base64-output=never option, 89basic usage, 88–93
force option, 38 force-if-open option, 89functionality, 87, 297 hexdump option, 94, 95
interpreting comments, 90interpreting events, 94–98PITR and, 439
pseudo_thread_id variable, 57 read-from-remote-server option, 93reading remote files, 93
short-form option, 89, 90 start-datetime option, 38, 92 start-position option, 92 stop-datetime option, 38, 93 stop-position option, 92troubleshooting replication, 400usage example, 39
viewing error codes, 75wildcard support, 92mysqldump utilitybackup comparisons, 437cloning slaves, 34cloning the master, 31functionality, 430–432options supported, 431snapshots and, 108mytop utility, 316
N
Nagios tool, 252, 288NAME_CONST function, 68National Institute of Standards and Technology
(NIST), 479NDB (network database), 526NDB management console, 537, 542, 547 NDB-connectstring option, 542, 544 NDB-nodeid option, 543, 544NDBcluster option, 544NDB_binlog_index table, 554NDB_restore utility, 538netstat command, 253, 265network activity
Linux/Unix environments, 265Mac OS X environment, 275monitoring, 248, 251network database (NDB), 526network-bound processes, 251nice command, 255
NIST (National Institute of Standards and
Technology), 479node recovery, 551nonhierarchal deployment, 185–187nontransactional changes
Trang 12avoiding problems with, 79error handling and, 72–75implicit commits and, 76logging, 77–79
protecting, 225row-based replication and, 229troubleshooting, 392, 397NoOptionError exception, 25normalization, 331, 338NOT NULL constraint, 338NotMasterError exception, 25NotSlaveError exception, 25NOW function, 52, 53NO_WRITE_TO_BINLOG keyword, 329,
330
O
on_gid function, 139open recovery image, 441open source cloud computing, 522operating systems, 252
(see also specific systems)class methods, 26managing replication, 24monitoring solutions, 252node recovery and, 551OPTIMIZE TABLE commandbest practices, 339defragmenting tables, 348functionality, 330, 345oracle algorithm, 574ORDER BY clause, 241, 347overall transfer rate, 250
P
PaaS (Platform as a Service), 480page cache, 83
paging technique, 249partition functionscommonly used schemes, 170sharding databases, 175–176partition keys
creating, 170sharding databases, 175–176partitioning, 167
(see also data sharding)data sharding and, 170, 175–176defined, 433
events to slaves, 164MySQL Cluster and, 536passwords
AWS requirements, 498master log information file, 199security considerations, 63, 64Patriot Act, 412
pausing replication, 406PBXT transactional engine, 119peak loads, handling, 153per-process transfer rate, 250, 251Percona open source provider, 432performance considerations, 248(see also monitoring)best practices, 339–341, 558–560data mining, 37
database, 319database object manipulation, 51defining, 292
high performance, 557InnoDB storage engine, 352MyISAM storage engine, 344MySQL Cluster and, 557–560MySQL servers, 292–319optimizing views and, 122replication and, 341, 367report generation, 12, 148synchronous replication, 151tuning tables, 345–346Performance Monitor, 285–288Perl language, 318, 427PHP programming language, 155physical backups, 422
physical file copy, 428–430, 437physical volumes, 433
pid-file optionfunctionality, 13, 99Server class and, 26PITR (point-in-time recovery)backup in replication and, 439backup procedure, 442binary log and, 17, 51, 165, 315defined, 4
filtering considerations, 163FLUSH LOGS command and, 84InnoDB Hot Backup and, 428Python and, 443–445recovery example, 440recovery images, 441