MySQL Basic universal "MySQL Management way: performance tuning, high availability and monitoring"

Recent content of the work involved in the operation and maintenance MySQL content, gradually read a few books related, which is a "MySQL Management way: performance tuning, high availability and monitoring."

Tuning covers (including optimization sql, etc.), backup, high availability, and reading and writing separation, very useful for universal MySQL base. Record it so found at the back.

Annex catalog:

Chapter 1 MariaDB architecture and history 1

Introduction of 1.1 MariaDB. 1
1.2 MariaDB and MySQL compatibility 2
1.3 10.0 MariaDB new features 3
1.3.1 more storage engine 4
to enhance the speed of 5 1.3.2
1.3.3 extensions and new features 5
1.4 How to migrate MySQL 8 to MariaDB
1.5 binary packages using the enterprise Edition installed MariaDB 10.1 10
1.6 summary 12

Chapter 2 MySQL 5.7 with new features MariaDB 10.1 13

Performance 2.1 14
2.2 15 enhance the security
2.2.1 default on the SSL 15
2.2.2 20 is no longer displayed in plain text user passwords
change 2.2.3 sql_mode of 20
2.3 the In [0no0] DB storage lift engine 22
2.3.1 Change Index [0 0] not [be 0 0] lock table 22 words
2.3.2 online DDL changes varchar field properties do not lock table 23
2.3.3 an In [0no0] DB / MYISAM storage engine support Chinese full-text index 26
2.3.4 in [0no0] DB Buffer Pool 29 preheated improved
2.3.5 line adjustment in [0no0] db_Buffer_Pool_Size without restarting mysql process 31
2.3.6 recovery (shrinkage) undo log rolling log physical file space 32
2.3.7 the in [0no0] DB table 33 provides a common space
2.3.8 Create In [0no0] DB [0 0 single] Li tablespace specified storage path 34
2.3.9 single migration [0 0 single] a In [0no0] DB table 35 to the remote server
2.3. 10 Review in [0no0] DB redo log transaction log file [0 0 large] small more humane 36
2.3.11 deadlock can print the error log 37
2.3.12 support in [0no0] DB 37 read-only transaction
2.3.13 support in [0no0] DB tablespace data defragmentation 38
support 39 2.4 JSON format
2.4.1 Support JSON format data memory 39
2.4.2 Dynamic support column 41 for storing data JSON format
2.5 supports virtual columns (index function) 44
2.5.1 indexing function 44 supports the MySQL 5.7
2.5.2 MariaDB 10.0 / 10.1 Support Function Index 45
2.6 46 functional development
2.6.1 slow killing support SQL statements 46
2.6.2 table has a plurality of support INSERT / DELETE / UPDATE trigger 48
2.6.3 introduced thread pool (thread pool) technology 49
2.6.4 provide the audit log function 52
2.6.5 Update 53 is supported EXPLAIN
2.6.6 MySQL 5.7 in the press Ctrl + C key combination is not [0 will be 0] to exit the client 54
2.6.7 error log can be printed to the system log file 54
2.6. 8 supports the creation of role 55
2.6.9 TokuDB storage engine support 56
2.7 [0 excellent 0] an improvement of 59
2.7.1 for the sub-query select semi-connected [0 excellent 0] of 59
2.7.2 [0 excellent 0] of derivative 62 subqueries
2.7.3 [0 preferably 0] sequencer 65 limit
2.7.4 [0 preferably 0] IN conditional expression of 66
2.7.5 [0 preferably 0] of Union [0all0] 69
2.7.6 support index pushdown [0 preferably 0] of 70
2.7.7 Multi Range Read support index [0 preferably 0] of 72
2.7.8 Support Batched Key Access (BKA) index [0 preferably 0] of 75
2.7.9 Support Hash Join index [0 preferably 0] of 77
2.8 semisynchronous copy improvement 78
2.8.1 Introduction 78 semi-sync
2.8.2 semi-sync mounting configuration 79
2.8.3 parameter 79
2.8.4 function test 80
2.8.5 performance test 84
2.9 87 GTID improved copy
2.9.1 GTID replication Overview 87
2.9.2 replication given solution can skip mode in the MySQL GTID 5.6 [method 0 0] 90
2.9.3 5.7 in the MySQL improved replication GTID 93
2.9.4 GTID replication trap 95
2.9.5 10.1 MariaDB improved copy GTID in 96
different ways using 97 2.9.6 GTID
2.10 MySQL 5.6 / 5.7 safety crash recovery from the library 98
2.11 MariaDB 10.0 / 10.1 crash safe recovery from the library 99
2.12 Slave 99 copy from the library multithreaded
2.13 slave multi-source support copy 101
2.14 5.7 MySQL replication filter settings without restarting mysql service process 103
2.15 Summary 104

Chapter 3 Troubleshooting 105

Factors affect the performance of MySQL 3.1 105
3.2 system performance [0 Comments 0] 106 standard assessment
factors affect the Linux server performance 3.2.1 106
3.2.2 System Performance [0 Comments 0] estimates indicators 107
3.2.3 Monitoring and open [0 Comments 0] describes the assessment tool 109
3.3 112 fault processing
3.3.1 cause too many connections 112 to connect given
downtime caused 3.3.2 recording subquery 117
reasons 3.3.3 diagnostic projecting high transaction volumes 120
3.3.4 123 = MIXED set carefully binlog_format
3.3.5 swap area is not provided leads to memory exhaustion, 127 host crash
event of failover 3.3.6 MySQL scheduler 128 Note
3.3.7 artificial erroneous erasure In [0no0] DB ibdata data file, how recovery 130.
3.3.8 Update forget to add recovery misoperation where conditions (simulated Oracle Flashback function) 132
3.3.9 Delete forget to add recovery misoperation where conditions (simulated Oracle flashback functionality) 141

Chapter 4 Troubleshooting 145 Replication error

145 4.1 three common fault
failure 4.1.1 delete a record in the master 146
4.1.2 primary key repeat 147
4.1.3 update a record in the master, and the slave can not find 148
4.2 Special circumstances: slave relay log relay-log damage 149
4.3 151 human error
4.4 to avoid performing [0 0 large] 152 transactions on master
4.5 of 5 slave_exec_mode parameters can be automatically processed error replicable 153
4.6 how to verify consistent data from the master 154
4.7 binlog_ig [0no0] re_db replication failure caused 156
4.8 MySQL5.5.19 / 20 is a synchronous 157 the Bug
4.9 recover from the slave side of a summary table of the several machine [method 0 0] 159
4.10 Clear to cleanly slave synchronization information 160

Chapter 5 162 Performance Tuning

162 5.1 Table design
5.2 166 field type selection
5.2.1 Value Type 167
5.2.2 character type 172
5.2.3 Time Type 174
5.2.4 Tip: quickly change table structure 181
5.2.5-Pt-Online-Schema Change Online change the table structure 185
5.2.6 MySQL5.6 online DDL change test table 191
5.3 with a suitable locking mechanism 194
table locks presentation 194 5.3.1
5.3.2 demo row lock 197
performance comparison 5.3.3 InnoDB and MyISAM engine engine 199
5.4 selecting the appropriate transaction isolation level 201
concept 201 5.4.1 affairs
achieve 202 transactions 5.4.2
5.4.3 transaction isolation level introduction 204
5.5 SQL optimization and rational use of the index 210
5.5.1 how to locate the very slow implementation of the SQL statement 210
5.5.2 the SQL [0 preferably 0] 211 of the case study
5.5.3 rational use of the index 221
5.6 tune the my.cnf configuration file [0 preferably 0] 231
5.6.1 per_thread_buffers [0 preferably 0] of 231
5.6.2 global_buffers [ 0 preferably 0] of 233
5.6.3 Query the Cache used in different environments 234
Use 238 5.6.4 tuning-primer.sh performance debugging tool
5.6.5 72 GB memory my.cnf profile 241
5.6.6 used with caution partition table function 244
5.7 MySQL5.6 replicable Detailed new features 246

Chapter 6 Backup and recovery 256

Cold Backup 6.1 257
6.2 logical backup 257
6.2.1 mysqldump adds an important parameter 258
6.2.2 mysqldump new tools to replace 259 mydumper
6.2.3 full amount of logical backup, incremental backup scripts 262
6.3 263 hot backup and recovery

Chapter 7 High Availability Cluster Management MHA architecture 268

Architecture Overview 7.1 MHA 268
7.1.1 master automated monitoring and failover 270
7.1.2 manual handling failover master 270
7.1.3 smooth switching line 270
7.2 install the MHA configuration 270
7.3 277 demonstrates the MHA failover
7.3.1 a scene: master automatically monitoring and failover 277
7.3.2 scenario two: master manual failover 285
7.3.3 scenario three: smooth switching line 285
7.4 290 summarizes the MHA high-availability framework

Chapter 8 MySQL Architecture Evolution: "a master multi-slave, read / write separation" 293

8.1 to achieve the read / write separation of two ways 293
8.2 master-slave synchronization delay criterion 297
8.3 HAProxy sense [known 0 0] the MySQL master-slave synchronization delay 300
8.4 Read / write architecture to build a presentation separation MariaDB MaxScale 307
8.4.1 Configuration Environment and installation instructions 307
8.4.2 connect test mode 311 based
on mode statement (SQL parsing) test 8.4.3 312
8.4.4 MaxScale delay detector 313
8.5 read / write architecture and describes the separation OneProxy presentation structures 315
8.5.1 Introduction OneProxy 316
8.5.2 OneProxy features and installation instructions 316
8.5.3 OneProxy read / write access restriction separator 320

Chapter 9 Codership Galera Cluster cluster architecture to build and manage 322

Characteristics and 9.1 Codership Galera Cluster [0 preferably 0] disadvantage 323
9.2 Codership limitations of Galera Cluster 323
9.3 Codership principle of Galera Cluster 324
9.4 Codership Galera Cluster Configuration 328
9.4.1 Codership Galera Cluster installation and configuration environment 328
9.4 functional test .2 332
9.5 HAProxy binding Galera Cluster-free single point of 337 second failover

Chapter 10 OneProxy build and manage sub-library sub-table 345

10.1 OneProxy build sub-library sub-table 346
10.1.1 346 configuration and installation
10.1.2 distal PHP / Java access program issues 349
10.2 OneProxy access restriction sub-library sub-table 349
10.3 OneProxy basic test sub-library sub-table 351
10.3.1 function test sub-library sub-table 351
10.3.2 sub-library sub-table 354 is two partitions test
polymerization test 10.3.3 sub-library sub-table 358
is inserted into the test 10.3.4 sub-library sub-table 359
10.3.5 sub-library sub-table does not cross-database join test 360
10.3.6 sub-library sub-table is not distributed transaction support test 361
10.3.7 do not support sub-library sub-table 361 stored test procedure
10.4 build OneProxy 362 HA failover the HA
10.5 OneProxy black [ 0 0] build single SQL firewall test 363

Chapter 11 Lepus slow log analysis platform to build and maintain 367

11.1 Lepus mounting base assembly 367
11.2 percona-toolkit installation tool 370

Guess you like

Origin www.cnblogs.com/lanyangsh/p/11621710.html