Replication cluster on MariaDB 5.5 / ubuntu-server. Mark Schneider ms(at)it-infrastrukturen(dot)org

Similar documents
Databases through Python-Flask and MariaDB

ST-Links. SpatialKit. Version 3.0.x. For ArcMap. ArcMap Extension for Directly Connecting to Spatial Databases. ST-Links Corporation.

FACTORS AFFECTING CONCURRENT TRUNCATE

A Comparison Between MongoDB and MySQL Document Store Considering Performance

Arup Nanda Starwood Hotels

From BASIS DD to Barista Application in Five Easy Steps

Advanced Forecast. For MAX TM. Users Manual

ON SITE SYSTEMS Chemical Safety Assistant

Geodatabase Programming with Python John Yaist

Leveraging Web GIS: An Introduction to the ArcGIS portal

Backup and Restoration

Geodatabase Programming with Python

ArcGIS Enterprise: Administration Workflows STUDENT EDITION

Infrastructure Automation with Salt

From BASIS DD to Barista Application in Five Easy Steps

Administering your Enterprise Geodatabase using Python. Jill Penney

NV-DVR09NET NV-DVR016NET

django in the real world

The File Geodatabase API. Craig Gillgrass Lance Shipman

Building a Lightweight High Availability Cluster Using RepMgr

Overlay Transport Virtualization (OTV) Unicast-Mode Transport Infrastructure Deployment

ArcGIS. for Server. Understanding our World

Innovation. The Push and Pull at ESRI. September Kevin Daugherty Cadastral/Land Records Industry Solutions Manager

Reaxys Pipeline Pilot Components Installation and User Guide

TitriSoft 2.5. Content

What s New. August 2013

Tryton Technical Training

SteelSmart System Cold Formed Steel Design Software Download & Installation Instructions

ArcGIS Enterprise: What s New. Philip Heede Shannon Kalisky Melanie Summers Shreyas Shinde

Inspecting a multi-everything Linux system. Aurimas Mikalauskas Zabbix Conference September 12-13, 2014

GLAS Grond-laag Laser Adaptieve optiek Systeem Ground-layer Laser Adaptive optics System A Rayleigh laser beacon for NAOMI

Account Setup. STEP 1: Create Enhanced View Account

Geodatabase Best Practices. Dave Crawford Erik Hoel

An ESRI Technical Paper June 2007 An Overview of Distributing Data with Geodatabases

XR Analog Clock - Manual Setting Model Troubleshooting Guide

Dustin L. Black, Principal Technical Account Manager Guil Barros, Principal Product Manager. June 25, 2015

EUROPEAN MIDDLEWARE INITIATIVE

MySQL 5.1. Past, Present and Future. Jan Kneschke MySQL AB

Portal for ArcGIS: An Introduction. Catherine Hynes and Derek Law

The File Geodatabase API. Dave Sousa, Lance Shipman

T1 and E1 Feature Cards

Geodatabase Management Pathway

NEC PerforCache. Influence on M-Series Disk Array Behavior and Performance. Version 1.0

TECDIS and TELchart ECS Weather Overlay Guide

Appendix A Prototypes Models

Web GIS Deployment for Administrators. Vanessa Ramirez Solution Engineer, Natural Resources, Esri

TIMEZERO PROFESIONAL V3.2

Fundamentals of Computational Science

MySQL Attack Mitigation Using Deception Technology

DP Project Development Pvt. Ltd.

new interface and features

C101-E112. BioSpec-nano. Shimadzu Spectrophotometer for Life Science

Continuous Performance Testing Shopware Developer Conference. Kore Nordmann 08. June 2013

Auditing with the Critical Security Controls in Washington State

WeatherHub2 Quick Start Guide

Differential Pressure Sensor

February 7, Jay Krafthefer, L.S.

The 5 Minute DBA. Matt Yonkovit

Clearinghouse. Eric D. Schabell University of Nijmegen, Computing Science Institute, P.O. Box 9010, 6500 GL Nijmegen, The Netherlands

In Association With. Introduces. TPT Contractor

PP - Work Centers HELP.PPBDWKC. Release 4.6C

Geodatabase An Introduction

Orbit Support Pack for Excel. user manual

ArcGIS Pro: Essential Workflows STUDENT EDITION

NINE CHOICE SERIAL REACTION TIME TASK

ArcGIS Deployment Pattern. Azlina Mahad

MapOSMatic: city maps for the masses

ArcGIS Enterprise: What s New. Philip Heede Shannon Kalisky Melanie Summers Sam Williamson

MapOSMatic, free city maps for everyone!

User's Manual altimeter V1.1

ArcGIS 9 ArcGIS StreetMap Tutorial

Production Line Tool Sets

PostPoint Professional

UFO Analyser - Leeds

PC Control / Touch Control

Migration to the New BI360

Introduction to Portal for ArcGIS. Hao LEE November 12, 2015

Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application

Training Path FNT IT Infrastruktur Management

Motors Automation Energy Transmission & Distribution Coatings. Servo Drive SCA06 V1.5X. Addendum to the Programming Manual SCA06 V1.

31 Dec '01 07 Jan '02 14 Jan '02 21 Jan '02 28 Jan '02 M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S

MONTHLY OPERATIONS REPORT

Frequently Asked Questions

PUG Challenge EMEA. Promon for Dummies & Savants. Click to edit Master title style. Presented by: Dan Foreman

Geographical Databases: PostGIS. Introduction. Creating a new database. References

Configuring LDAP Authentication in iway Service Manager

CLX000 Technical Manual (v5.7x)

CHEMICAL INVENTORY ENTRY GUIDE

Database Systems SQL. A.R. Hurson 323 CS Building

Introduction to Portal for ArcGIS

Forecast User Manual FORECAST. User Manual. Version P a g e

Performing Map Cartography. using Esri Production Mapping

Technical Note Row Boundary Crossing Functionality in CellularRAM Memory

NMRPredict Functional Block Diagram

Troubleshooting Replication and Geodata Services. Liz Parrish & Ben Lin

TSCCLOCK: A LOW COST, ROBUST, ACCURATE SOFTWARE CLOCK FOR NETWORKED COMPUTERS

GIS Software. Evolution of GIS Software


Tile-Based Geospatial Information Systems

md5bloom: Forensic Filesystem Hashing Revisited

Transcription:

Mark Schneider ms(at)it-infrastrukturen(dot)org 2012-05-31 Abstract Setting of MASTER-SLAVE or MASTER-MASTER replications on MariaDB 5.5 database servers is neccessary for higher availability of data and better performance in professional environment. MariaDB is a database server that offers drop-in replacement functionality for MySQL. MariaDB is built by some of the original authors of MySQL, with assistance from the broader community of Free and open source software developers. In addition to the core functionality of MySQL, MariaDB offers a rich set of feature enhancements including alternate storage engines, server optimizations, and patches. MariaDB is primarily driven by developers at Monty Program, a company founded by Michael Monty Widenius, the original author of MySQL, but this is not the whole story about MariaDB. On the About MariaDB page you will find more information about all participants in the MariaDB community, including storage engines XtraDB and PBXT. This document is designed to be readable by someone with basic Linux/UNIX command-line, ubuntu administration and basic SQL programming skills. * All trademarks or registered trademarks herein in this document are the property of their respective owners. Public draft 1

Setting of replication cluster on MariaDB 5.5 / ubuntu-server The below procedure describes steps required to configure replications on MariaDB 5.5 database server running on ubuntu-server 12.04 (LTS). It is also directly applicable for debian squeeze and wheezy and mostly to other linux distributions. These document and some config files for replication configurations on MariaDB 5.5 are available as.tgz archive at: http://rsync.it-infrastrukturen.org/mariadb/ubuntu/mariadb55-ubuntu-replications.tgz Two levels of activities are required on each database server box to set up MASTER-SLAVE or MASTER- MASTER replications for MariaDB 5.5: - shell commands on the operating system prompt - SQL commands on the MariaDB prompt This description uses two database server boxes db10 (*MASTER) and db20 (*SLAVE). They run ubuntu-server 12.04 LTS and MariaDB 5.5.24 database server. * In the MASTER-MASTER configuration each box is a master and slave to the other one. Short introduction Replication is basically a three step process which works as follows: - The master records changes to data in its binary log. - The slave copies the changes recorded in the master s binlog to its relay log. - The slave replays the change-set recorded in its relay log, applying these changes to its own data. A replication account on the master is required to allow the slave to connect to the master and read master s binary log. 2

Configuration of MASTER-SLAVE replications for MariaDB MariaDB master-slave replication mechanism allows replication of data from one master database server to one or more slave database servers. Replication is mostly used as a scale-out solution. The load is spreaded among multiple slaves to improve performance. All writes and updates take place on the master server, while reads occure on one or more slaves and/or the master. Such model improves both the write performance on the master (less reads take place there) and the read performance as well (in particlar with increasing number of slaves). After installation of ubuntu-server and MariaDB 5.5 the following steps are neccessary: - modify my.cnf files on db10 and db20 due to MASTER-SLAVE replications requirements - modify / extend settings of MariaDB on the SQL prompt - create an example database with one table for testing Configuration of *MASTER (db10) for MASTER-SLAVE replications The my.cnf file on the *MASTER should look like in the followin listing. After changes a database server restart is required (/etc/init.d/mysql restart). Listing 1: my.cnf-master-db10 MariaDB database s e r v e r c o n f i g u r a t i o n f i l e. You can copy t h i s f i l e to one o f : / e t c / mysql /my. c n f to s e t g l o b a l options, /.my. c n f to s e t user s p e c i f i c o p t i o n s. One can use a l l long o p t i o n s that the program supports. Run program with help to get a l i s t o f a v a i l a b l e o p t i o n s and with print d e f a u l t s to s e e which i t would a c t u a l l y understand and use. For e x p l a n a t i o n s s e e http : / / dev. mysql. com/ doc / mysql /en/ s e r v e r system v a r i a b l e s. html This w i l l be passed to a l l mysql c l i e n t s I t has been r e p o r t e d that passwords should be e n c l o s e d with t i c k s / quotes e s c p e c i a l l y i f they c o n t a i n chars... Remember to e d i t / e t c / mysql / debian. c n f when changing the l o c a t i o n. [ c l i e n t ] port = 3306 Here i s e n t r i e s f o r some s p e c i f i c programs The f o l l o w i n g v a l u e s assume you have at l e a s t 32M ram This was f o r m a l l y known as [ s a f e m y s q l d ]. Both v e r s i o n s are c u r r e n t l y parsed. [ m y s q l d s a f e ] nice = 0 [ mysqld ] Basic S e t t i n g s u s e r = mysql pid f i l e = / var / run /mysqld/mysqld. pid port = 3306 b a s e d i r = / usr d a t a d i r = / var / l i b / mysql 3

tmpdir = /tmp l c m e s s a g e s d i r = / usr / share / mysql l c m e s s a g e s = en US skip e x t e r n a l l o c k i n g I n s t e a d o f skip networking the d e f a u l t i s now to l i s t e n only on l o c a l h o s t which i s more compatible and i s not l e s s s e c u r e. bind address = 1 2 7. 0. 0. 1 bind address = 1 9 2. 1 6 8. 1 0. 5 0 Fine Tuning max connections = 4000 connect timeout = 5 wait timeout = 600 max allowed packet t h r e a d c a c h e s i z e = 128 s o r t b u f f e r s i z e b u l k i n s e r t b u f f e r s i z e t m p t a b l e s i z e = 32M m a x h e a p t a b l e s i z e = 32M MyISAM This r e p l a c e s the s t a r t u p s c r i p t and checks MyISAM t a b l e s i f needed the f i r s t time they are touched. On e r r o r, make copy and t r y a r e p a i r. myisam recover = BACKUP k e y b u f f e r s i z e = 128M open f i l e s l i m i t = 2000 t a b l e c a c h e = 400 m y i s a m s o r t b u f f e r s i z e = 512M c o n c u r r e n t i n s e r t = 2 r e a d b u f f e r s i z e r e a d r n d b u f f e r s i z e = 8M Query Cache C o n f i g u r a t i o n Cache only t i n y r e s u l t s e t s, so we can f i t more in the query cache. q u e r y c a c h e l i m i t = 128K q u e r y c a c h e s i z e = 64M f o r more w r i t e i n t e n s i v e setups, s e t to DEMAND or OFF q u e r y c a c h e t y p e = DEMAND Logging and R e p l i c a t i o n Both l o c a t i o n g e t s r o t a t e d by the cronjob. Be aware that t h i s l o g type i s a performance k i l l e r. As o f 5. 1 you can enable the l o g at runtime! g e n e r a l l o g f i l e = / var / l o g / mysql / mysql. l o g g e n e r a l l o g = 1 Error l o g g i n g goes to s y s l o g due to / e t c / mysql / conf. d/ m y s q l d s a f e s y s l o g. c n f. we do want to know about network e r r o r s and such l o g w a r n i n g s = 2 Enable the slow query l o g to s e e q u e r i e s with e s p e c i a l l y long duration s l o w q u e r y l o g [ = { 0 1 } ] s l o w q u e r y l o g f i l e = / var / l o g / mysql /mariadb slow. l o g l o n g q u e r y t i m e = 10 l o g s l o w r a t e l i m i t = 1000 l o g s l o w v e r b o s i t y = query plan 4

log q u e r i e s not using i n d e x e s l o g s l o w a d m i n s t a t e m e n t s The f o l l o w i n g can be used as easy to r e p l a y backup l o g s or f o r r e p l i c a t i o n. note : i f you are s e t t i n g up a r e p l i c a t i o n slave, s e e README. Debian about other s e t t i n g s you may need to change. s e r v e r i d = 10 r e p o r t h o s t = master1 a u t o i n c r e m e n t i n c r e m e n t = 10 a u t o i n c r e m e n t o f f s e t = 1 l o g b i n = / var / l o g / mysql /mariadb db10 bin l o g b i n i n d e x = / var / l o g / mysql /mariadb db10 bin. index not fab f o r performance, but s a f e r s y n c b i n l o g = 1 e x p i r e l o g s d a y s = 10 m a x b i n l o g s i z e = 100M s l a v e s r e l a y l o g = / var / l o g / mysql / r e l a y bin r e l a y l o g i n d e x = / var / l o g / mysql / r e l a y bin. index r e l a y l o g i n f o f i l e = / var / l o g / mysql / r e l a y bin. i n f o l o g s l a v e u p d a t e s r e a d o n l y I f a p p l i c a t i o n s support i t, t h i s s t r i c t e r sql mode prevents some mistakes l i k e i n s e r t i n g i n v a l i d dates e t c. sql mode = NO ENGINE SUBSTITUTION, TRADITIONAL InnoDB InnoDB i s enabled by d e f a u l t with a 10MB d a t a f i l e in / var / l i b / mysql /. Read the manual f o r more InnoDB r e l a t e d o p t i o n s. There are many! d e f a u l t s t o r a g e e n g i n e = InnoDB you can t j u s t change l o g f i l e s i z e, r e q u i r e s s p e c i a l procedure i n n o d b l o g f i l e s i z e = 50M i n n o d b b u f f e r p o o l s i z e = 2048M i n n o d b l o g b u f f e r s i z e = 8M i n n o d b f i l e p e r t a b l e = 1 i n n o d b o p e n f i l e s = 400 i n n o d b i o c a p a c i t y = 400 innodb flush method = O DIRECT S e c u r i t y Features Read the manual, too, i f you want chroot! chroot = / var / l i b / mysql / For g e n e r a t i n g SSL c e r t i f i c a t e s I recommend the OpenSSL GUI t i n y c a. s s l ca=/e t c / mysql / c a c e r t. pem s s l c e r t=/e t c / mysql / s e r v e r c e r t. pem s s l key=/e t c / mysql / s e r v e r key. pem [ mysqldump ] quick quote names max allowed packet [ mysql ] no auto rehash f a s t e r s t a r t o f mysql but no tab c o m p l e t i t i o n [ isamchk ] 5

k e y b u f f e r IMPORTANT: A d d i t i o n a l s e t t i n g s that can o v e r r i d e those from t h i s f i l e! The f i l e s must end with. cnf, o t h e r w i s e they l l be i gnored.! i n c l u d e d i r / e t c / mysql / conf. d/ SQL commands on the MariaDB prompt of *MASTER (db10) After MariaDB login with mysql -u root -p follow the SQL commands below: Listing 2: SQL commands on the MariaDB prompt % MariaDB [ ( none )] > GRANT REPLICATION SLAVE, REPLICATION CLIENT ON. TO r e p l i c a t o r @ 1 9 2. 1 6 8. 1 0. 1 5 0 IDENTIFIED BY somepassword ; f l u s h p r i v i l e g e s ; show master s t a t u s ; Listing 3: SQL commands on the MariaDB prompt % Create an example database with one t a b l e f o r t e s t i n g % c r e a t e database shop ; use shop c r e a t e t a b l e customer ( c ustomer i d MEDIUMINT UNSIGNED NOT NULL AUTO INCREMENT PRIMARY KEY, t i t l e VARCHAR( 5 ), last name VARCHAR( 3 2 ) NOT NULL, f i r s t n a m e VARCHAR( 3 2 ) NOT NULL, a d d r e s s s t r e e t VARCHAR( 3 2 ) NOT NULL, a d d r e s s c i t y VARCHAR( 3 2 ) NOT NULL, a d d r e s s c o u n t r y VARCHAR( 2 4 ) NOT NULL ) ; show t a b l e s ; i n s e r t i n t o customer ( t i t l e, last name, f i r s t n a m e, a d d r e s s s t r e e t, a d d r e s s c i t y, a d d r e s s c o u n t r y ) VALUES ( "Mr", "Iron", "Mark", "1-st Ironman Avenue 17", "80007 Santa Monica ", "USA" ), ( "Miss", "Iron", " Murielle ", " Ironwoman avenue 7", "10007 Paris", "France" ) ; s e l e c t from customer ; show master s t a t u s ; % RESET MASTER; Shell commands on the operating system prompt of *MASTER (db10) Listing 4: Shell commands on the operating system prompt of primary *MASTER Dump o f databases o f the primary r e p l i c a t i o n master 6

root@db10 : mysqldump u mysqldump u r o o t p a l l databases master data=2 > dbdump a l l. db r o o t p shop master data=2 > dbdump shop. db On debian / ubuntu / e t c / mysql / debian. c n f o f the master has to be copied to the r e p l i c a t i o n s l a v e or the password hash f o r debian sys maint should be s e t i n the mysql. u s e r t a b l e on the s l a v e a f t e r redumping o f master s databases to the l o c a l one. 7

Configuration of *SLAVE (db20) for MASTER-SLAVE replications The my.cnf file on the *SLAVE should look like in the followin listing. After changes a database server restart is required (/etc/init.d/mysql restart). Listing 5: my.cnf-master-db10 MariaDB database s e r v e r c o n f i g u r a t i o n f i l e. You can copy t h i s f i l e to one o f : / e t c / mysql /my. c n f to s e t g l o b a l options, /.my. c n f to s e t user s p e c i f i c o p t i o n s. One can use a l l long o p t i o n s that the program supports. Run program with help to get a l i s t o f a v a i l a b l e o p t i o n s and with print d e f a u l t s to s e e which i t would a c t u a l l y understand and use. For e x p l a n a t i o n s s e e http : / / dev. mysql. com/ doc / mysql /en/ s e r v e r system v a r i a b l e s. html This w i l l be passed to a l l mysql c l i e n t s I t has been r e p o r t e d that passwords should be e n c l o s e d with t i c k s / quotes e s c p e c i a l l y i f they c o n t a i n chars... Remember to e d i t / e t c / mysql / debian. c n f when changing the l o c a t i o n. [ c l i e n t ] port = 3306 Here i s e n t r i e s f o r some s p e c i f i c programs The f o l l o w i n g v a l u e s assume you have at l e a s t 32M ram This was f o r m a l l y known as [ s a f e m y s q l d ]. Both v e r s i o n s are c u r r e n t l y parsed. [ m y s q l d s a f e ] nice = 0 [ mysqld ] Basic S e t t i n g s u s e r = mysql pid f i l e = / var / run /mysqld/mysqld. pid port = 3306 b a s e d i r = / usr d a t a d i r = / var / l i b / mysql tmpdir = /tmp l c m e s s a g e s d i r = / usr / share / mysql l c m e s s a g e s = en US skip e x t e r n a l l o c k i n g I n s t e a d o f skip networking the d e f a u l t i s now to l i s t e n only on l o c a l h o s t which i s more compatible and i s not l e s s s e c u r e. bind address = 1 2 7. 0. 0. 1 bind address = 1 9 2. 1 6 8. 1 0. 1 5 0 Fine Tuning max connections = 4000 connect timeout = 5 wait timeout = 600 max allowed packet t h r e a d c a c h e s i z e = 128 s o r t b u f f e r s i z e 8

b u l k i n s e r t b u f f e r s i z e t m p t a b l e s i z e = 32M m a x h e a p t a b l e s i z e = 32M MyISAM This r e p l a c e s the s t a r t u p s c r i p t and checks MyISAM t a b l e s i f needed the f i r s t time they are touched. On e r r o r, make copy and t r y a r e p a i r. myisam recover = BACKUP k e y b u f f e r s i z e = 128M open f i l e s l i m i t = 2000 t a b l e c a c h e = 400 m y i s a m s o r t b u f f e r s i z e = 512M c o n c u r r e n t i n s e r t = 2 r e a d b u f f e r s i z e r e a d r n d b u f f e r s i z e = 8M Query Cache C o n f i g u r a t i o n Cache only t i n y r e s u l t s e t s, so we can f i t more in the query cache. q u e r y c a c h e l i m i t = 128K q u e r y c a c h e s i z e = 64M f o r more w r i t e i n t e n s i v e setups, s e t to DEMAND or OFF q u e r y c a c h e t y p e = DEMAND Logging and R e p l i c a t i o n Both l o c a t i o n g e t s r o t a t e d by the cronjob. Be aware that t h i s l o g type i s a performance k i l l e r. As o f 5. 1 you can enable the l o g at runtime! g e n e r a l l o g f i l e = / var / l o g / mysql / mysql. l o g g e n e r a l l o g = 1 Error l o g g i n g goes to s y s l o g due to / e t c / mysql / conf. d/ m y s q l d s a f e s y s l o g. c n f. we do want to know about network e r r o r s and such l o g w a r n i n g s = 2 Enable the slow query l o g to s e e q u e r i e s with e s p e c i a l l y long duration s l o w q u e r y l o g [ = { 0 1 } ] s l o w q u e r y l o g f i l e = / var / l o g / mysql /mariadb slow. l o g l o n g q u e r y t i m e = 10 l o g s l o w r a t e l i m i t = 1000 l o g s l o w v e r b o s i t y = query plan log q u e r i e s not using i n d e x e s l o g s l o w a d m i n s t a t e m e n t s The f o l l o w i n g can be used as easy to r e p l a y backup l o g s or f o r r e p l i c a t i o n. note : i f you are s e t t i n g up a r e p l i c a t i o n slave, s e e README. Debian about other s e t t i n g s you may need to change. s e r v e r i d = 20 r e p o r t h o s t = master1 a u t o i n c r e m e n t i n c r e m e n t = 10 a u t o i n c r e m e n t o f f s e t = 2 l o g b i n = / var / l o g / mysql /mariadb db20 bin l o g b i n i n d e x = / var / l o g / mysql /mariadb db20 bin. index not fab f o r performance, but s a f e r s y n c b i n l o g = 1 e x p i r e l o g s d a y s = 10 m a x b i n l o g s i z e = 100M s l a v e s r e l a y l o g = / var / l o g / mysql /db20 r e l a y bin 9

r e l a y l o g i n d e x = / var / l o g / mysql /db20 r e l a y bin. index r e l a y l o g i n f o f i l e = / var / l o g / mysql /db20 r e l a y bin. i n f o l o g s l a v e u p d a t e s r e a d o n l y I f a p p l i c a t i o n s support i t, t h i s s t r i c t e r sql mode prevents some mistakes l i k e i n s e r t i n g i n v a l i d dates e t c. sql mode = NO ENGINE SUBSTITUTION, TRADITIONAL InnoDB InnoDB i s enabled by d e f a u l t with a 10MB d a t a f i l e in / var / l i b / mysql /. Read the manual f o r more InnoDB r e l a t e d o p t i o n s. There are many! d e f a u l t s t o r a g e e n g i n e = InnoDB you can t j u s t change l o g f i l e s i z e, r e q u i r e s s p e c i a l procedure i n n o d b l o g f i l e s i z e = 50M i n n o d b b u f f e r p o o l s i z e = 2048M i n n o d b l o g b u f f e r s i z e = 8M i n n o d b f i l e p e r t a b l e = 1 i n n o d b o p e n f i l e s = 400 i n n o d b i o c a p a c i t y = 400 innodb flush method = O DIRECT S e c u r i t y Features Read the manual, too, i f you want chroot! chroot = / var / l i b / mysql / For g e n e r a t i n g SSL c e r t i f i c a t e s I recommend the OpenSSL GUI t i n y c a. s s l ca=/e t c / mysql / c a c e r t. pem s s l c e r t=/e t c / mysql / s e r v e r c e r t. pem s s l key=/e t c / mysql / s e r v e r key. pem [ mysqldump ] quick quote names max allowed packet [ mysql ] no auto rehash f a s t e r s t a r t o f mysql but no tab c o m p l e t i t i o n [ isamchk ] k e y b u f f e r IMPORTANT: A d d i t i o n a l s e t t i n g s that can o v e r r i d e those from t h i s f i l e! The f i l e s must end with. cnf, o t h e r w i s e they l l be i gnored.! i n c l u d e d i r / e t c / mysql / conf. d/ Shell commands on the operating system prompt of *SLAVE (db20) Listing 6: Shell commands on the operating system prompt of *SLAVE Dump o f databases o f the second database s e r v e r b e f o r e i n c l u d i n g the dump from MASTER root@db20: mysqldump u r o o t p a l l databases master data=2 > dbdump a l l s lave f r e s h. db mysql u r o o t p shop < dbdump shop. db 10

On debian / ubuntu / e t c / mysql / debian. c n f o f the master has to be copied to the r e p l i c a t i o n s l a v e or the password hash f o r debian sys maint should be s e t i n the mysql. u s e r t a b l e on the s l a v e a f t e r redumping o f master s databases to the l o c a l one. SQL commands on the MariaDB prompt of *SLAVE (db20) After MariaDB login with mysql -u root -p follow the SQL commands below: Listing 7: SQL commands on the MariaDB prompt of *SLAVE % MariaDB [ ( none )] > CHANGE MASTER TO master host = 1 9 2. 1 6 8. 1 0. 5 0, m a s t e r u s e r = r e p l i c a t o r, master password = somepassword, m a s t e r l o g f i l e = mariadb db10 bin. 0 0 0 0 0 1, m a s t e r l o g p o s =245; START SLAVE; SHOW STATUS SLAVE\G; 11

Configuration of MASTER-MASTER replications for MariaDB MariaDB master-master replication mechanism allows replication of data between two master database servers. Every of them functions as slave for the other one. Replication is mostly used as a scale-out solution. The load is spreaded among both servers to improve performance and data availability. All writes, updates and reads can take place on both servers. Such model improves both the average write performance on each server (less reads take place on each of them) and the read performance as well. After installation of ubuntu-server and MariaDB 5.5 the following steps are neccessary: - modify my.cnf files on db10 and db20 due to MASTER-MASTER replications requirements - modify / extend settings of MariaDB on the SQL prompt - create an example database with one table for testing Configuration of 1st *MASTER (db10) for MASTER-MASTER replications The my.cnf file on the primary *MASTER should look like in the followin listing. database server restart is required (/etc/init.d/mysql restart). After changes a Listing 8: cat my.cnf-master-master-db10 MariaDB database s e r v e r c o n f i g u r a t i o n f i l e. You can copy t h i s f i l e to one o f : / e t c / mysql /my. c n f to s e t g l o b a l options, /.my. c n f to s e t user s p e c i f i c o p t i o n s. One can use a l l long o p t i o n s that the program supports. Run program with help to get a l i s t o f a v a i l a b l e o p t i o n s and with print d e f a u l t s to s e e which i t would a c t u a l l y understand and use. For e x p l a n a t i o n s s e e http : / / dev. mysql. com/ doc / mysql /en/ s e r v e r system v a r i a b l e s. html This w i l l be passed to a l l mysql c l i e n t s I t has been r e p o r t e d that passwords should be e n c l o s e d with t i c k s / quotes e s c p e c i a l l y i f they c o n t a i n chars... Remember to e d i t / e t c / mysql / debian. c n f when changing the l o c a t i o n. [ c l i e n t ] port = 3306 Here i s e n t r i e s f o r some s p e c i f i c programs The f o l l o w i n g v a l u e s assume you have at l e a s t 32M ram This was f o r m a l l y known as [ s a f e m y s q l d ]. Both v e r s i o n s are c u r r e n t l y parsed. [ m y s q l d s a f e ] nice = 0 [ mysqld ] Basic S e t t i n g s u s e r = mysql pid f i l e = / var / run /mysqld/mysqld. pid port = 3306 b a s e d i r = / usr d a t a d i r = / var / l i b / mysql tmpdir = /tmp 12

l c m e s s a g e s d i r = / usr / share / mysql l c m e s s a g e s = en US skip e x t e r n a l l o c k i n g I n s t e a d o f skip networking the d e f a u l t i s now to l i s t e n only on l o c a l h o s t which i s more compatible and i s not l e s s s e c u r e. bind address = 1 2 7. 0. 0. 1 bind address = 1 9 2. 1 6 8. 1 0. 5 0 Fine Tuning max connections = 4000 connect timeout = 5 wait timeout = 600 max allowed packet t h r e a d c a c h e s i z e = 128 s o r t b u f f e r s i z e b u l k i n s e r t b u f f e r s i z e t m p t a b l e s i z e = 32M m a x h e a p t a b l e s i z e = 32M MyISAM This r e p l a c e s the s t a r t u p s c r i p t and checks MyISAM t a b l e s i f needed the f i r s t time they are touched. On e r r o r, make copy and t r y a r e p a i r. myisam recover = BACKUP k e y b u f f e r s i z e = 128M open f i l e s l i m i t = 2000 t a b l e c a c h e = 400 m y i s a m s o r t b u f f e r s i z e = 512M c o n c u r r e n t i n s e r t = 2 r e a d b u f f e r s i z e r e a d r n d b u f f e r s i z e = 8M Query Cache C o n f i g u r a t i o n Cache only t i n y r e s u l t s e t s, so we can f i t more in the query cache. q u e r y c a c h e l i m i t = 128K q u e r y c a c h e s i z e = 64M f o r more w r i t e i n t e n s i v e setups, s e t to DEMAND or OFF q u e r y c a c h e t y p e = DEMAND Logging and R e p l i c a t i o n Both l o c a t i o n g e t s r o t a t e d by the cronjob. Be aware that t h i s l o g type i s a performance k i l l e r. As o f 5. 1 you can enable the l o g at runtime! g e n e r a l l o g f i l e = / var / l o g / mysql / mysql. l o g g e n e r a l l o g = 1 Error l o g g i n g goes to s y s l o g due to / e t c / mysql / conf. d/ m y s q l d s a f e s y s l o g. c n f. we do want to know about network e r r o r s and such l o g w a r n i n g s = 2 Enable the slow query l o g to s e e q u e r i e s with e s p e c i a l l y long duration s l o w q u e r y l o g [ = { 0 1 } ] s l o w q u e r y l o g f i l e = / var / l o g / mysql /mariadb slow. l o g l o n g q u e r y t i m e = 10 l o g s l o w r a t e l i m i t = 1000 l o g s l o w v e r b o s i t y = query plan log q u e r i e s not using i n d e x e s 13

l o g s l o w a d m i n s t a t e m e n t s The f o l l o w i n g can be used as easy to r e p l a y backup l o g s or f o r r e p l i c a t i o n. note : i f you are s e t t i n g up a r e p l i c a t i o n slave, s e e README. Debian about other s e t t i n g s you may need to change. s e r v e r i d = 10 r e p o r t h o s t = master1 a u t o i n c r e m e n t i n c r e m e n t = 10 a u t o i n c r e m e n t o f f s e t = 1 l o g b i n = / var / l o g / mysql /mariadb db10 bin l o g b i n i n d e x = / var / l o g / mysql /mariadb db10 bin. index not fab f o r performance, but s a f e r s y n c b i n l o g = 1 e x p i r e l o g s d a y s = 10 m a x b i n l o g s i z e = 100M s l a v e s r e l a y l o g = / var / l o g / mysql /db10 r e l a y bin r e l a y l o g i n d e x = / var / l o g / mysql /db10 r e l a y bin. index r e l a y l o g i n f o f i l e = / var / l o g / mysql /db10 r e l a y bin. i n f o l o g s l a v e u p d a t e s r e a d o n l y I f a p p l i c a t i o n s support i t, t h i s s t r i c t e r sql mode prevents some mistakes l i k e i n s e r t i n g i n v a l i d dates e t c. sql mode = NO ENGINE SUBSTITUTION, TRADITIONAL InnoDB InnoDB i s enabled by d e f a u l t with a 10MB d a t a f i l e in / var / l i b / mysql /. Read the manual f o r more InnoDB r e l a t e d o p t i o n s. There are many! d e f a u l t s t o r a g e e n g i n e = InnoDB you can t j u s t change l o g f i l e s i z e, r e q u i r e s s p e c i a l procedure i n n o d b l o g f i l e s i z e = 50M i n n o d b b u f f e r p o o l s i z e = 2048M i n n o d b l o g b u f f e r s i z e = 8M i n n o d b f i l e p e r t a b l e = 1 i n n o d b o p e n f i l e s = 400 i n n o d b i o c a p a c i t y = 400 innodb flush method = O DIRECT S e c u r i t y Features Read the manual, too, i f you want chroot! chroot = / var / l i b / mysql / For g e n e r a t i n g SSL c e r t i f i c a t e s I recommend the OpenSSL GUI t i n y c a. s s l ca=/e t c / mysql / c a c e r t. pem s s l c e r t=/e t c / mysql / s e r v e r c e r t. pem s s l key=/e t c / mysql / s e r v e r key. pem [ mysqldump ] quick quote names max allowed packet [ mysql ] no auto rehash f a s t e r s t a r t o f mysql but no tab c o m p l e t i t i o n [ isamchk ] k e y b u f f e r 14

IMPORTANT: A d d i t i o n a l s e t t i n g s that can o v e r r i d e those from t h i s f i l e! The f i l e s must end with. cnf, o t h e r w i s e they l l be i gnored.! i n c l u d e d i r / e t c / mysql / conf. d/ Shell commands on the operating system prompt of primary *MASTER (db10) Listing 9: Shell commands on the operating system prompt of primary *MASTER Dump o f databases o f the primary database s e r v e r b e f o r e i n c l u d i n g the dump from MASTER root@db20: mysqldump u r o o t p a l l databases master data=2 > dbdump a l l 2nd master f r e s h. db mysql u r o o t p shop < dbdump shop. db On debian / ubuntu / e t c / mysql / debian. c n f o f the master has to be copied to the r e p l i c a t i o n s l a v e or the password hash f o r debian sys maint should be s e t i n the mysql. u s e r t a b l e on the s l a v e a f t e r redumping o f master s databases to the l o c a l one. SQL commands on the MariaDB prompt of primary *MASTER (db10) After MariaDB login with mysql -u root -p follow the SQL commands below: % MariaDB [ ( none )] > Listing 10: SQL commands on the MariaDB prompt of *SLAVE % MASTER part o f MASTER MASTER c o n f i g u r a t i o n % GRANT REPLICATION SLAVE, REPLICATION CLIENT ON. TO r e p l i c a t o r @ 1 9 2. 1 6 8. 1 0. 1 5 0 IDENTIFIED BY somepassword ; FLUSH PRIVILEGES ; SHOW MASTER STATUS; % SLAVE part o f MASTER MASTER c o n f i g u r a t i o n % CHANGE MASTER TO master host = 1 9 2. 1 6 8. 1 0. 1 5 0, m a s t e r u s e r = r e p l i c a t o r, master password = somepassword, m a s t e r l o g f i l e = mariadb db20 bin. 0 0 0 0 0 1, m a s t e r l o g p o s =245; START SLAVE; SHOW STATUS SLAVE\G; 15

Configuration of 2nd *MASTER (db20) for MASTER-MASTER replications The my.cnf file on the second *MASTER should look like in the followin listing. After changes a database server restart is required (/etc/init.d/mysql restart). Listing 11: cat my.cnf-master-master-db20 MariaDB database s e r v e r c o n f i g u r a t i o n f i l e. You can copy t h i s f i l e to one o f : / e t c / mysql /my. c n f to s e t g l o b a l options, /.my. c n f to s e t user s p e c i f i c o p t i o n s. One can use a l l long o p t i o n s that the program supports. Run program with help to get a l i s t o f a v a i l a b l e o p t i o n s and with print d e f a u l t s to s e e which i t would a c t u a l l y understand and use. For e x p l a n a t i o n s s e e http : / / dev. mysql. com/ doc / mysql /en/ s e r v e r system v a r i a b l e s. html This w i l l be passed to a l l mysql c l i e n t s I t has been r e p o r t e d that passwords should be e n c l o s e d with t i c k s / quotes e s c p e c i a l l y i f they c o n t a i n chars... Remember to e d i t / e t c / mysql / debian. c n f when changing the l o c a t i o n. [ c l i e n t ] port = 3306 Here i s e n t r i e s f o r some s p e c i f i c programs The f o l l o w i n g v a l u e s assume you have at l e a s t 32M ram This was f o r m a l l y known as [ s a f e m y s q l d ]. Both v e r s i o n s are c u r r e n t l y parsed. [ m y s q l d s a f e ] nice = 0 [ mysqld ] Basic S e t t i n g s u s e r = mysql pid f i l e = / var / run /mysqld/mysqld. pid port = 3306 b a s e d i r = / usr d a t a d i r = / var / l i b / mysql tmpdir = /tmp l c m e s s a g e s d i r = / usr / share / mysql l c m e s s a g e s = en US skip e x t e r n a l l o c k i n g I n s t e a d o f skip networking the d e f a u l t i s now to l i s t e n only on l o c a l h o s t which i s more compatible and i s not l e s s s e c u r e. bind address = 1 2 7. 0. 0. 1 bind address = 1 9 2. 1 6 8. 1 0. 1 5 0 Fine Tuning max connections = 4000 connect timeout = 5 wait timeout = 600 max allowed packet t h r e a d c a c h e s i z e = 128 s o r t b u f f e r s i z e 16

b u l k i n s e r t b u f f e r s i z e t m p t a b l e s i z e = 32M m a x h e a p t a b l e s i z e = 32M MyISAM This r e p l a c e s the s t a r t u p s c r i p t and checks MyISAM t a b l e s i f needed the f i r s t time they are touched. On e r r o r, make copy and t r y a r e p a i r. myisam recover = BACKUP k e y b u f f e r s i z e = 128M open f i l e s l i m i t = 2000 t a b l e c a c h e = 400 m y i s a m s o r t b u f f e r s i z e = 512M c o n c u r r e n t i n s e r t = 2 r e a d b u f f e r s i z e r e a d r n d b u f f e r s i z e = 8M Query Cache C o n f i g u r a t i o n Cache only t i n y r e s u l t s e t s, so we can f i t more in the query cache. q u e r y c a c h e l i m i t = 128K q u e r y c a c h e s i z e = 64M f o r more w r i t e i n t e n s i v e setups, s e t to DEMAND or OFF q u e r y c a c h e t y p e = DEMAND Logging and R e p l i c a t i o n Both l o c a t i o n g e t s r o t a t e d by the cronjob. Be aware that t h i s l o g type i s a performance k i l l e r. As o f 5. 1 you can enable the l o g at runtime! g e n e r a l l o g f i l e = / var / l o g / mysql / mysql. l o g g e n e r a l l o g = 1 Error l o g g i n g goes to s y s l o g due to / e t c / mysql / conf. d/ m y s q l d s a f e s y s l o g. c n f. we do want to know about network e r r o r s and such l o g w a r n i n g s = 2 Enable the slow query l o g to s e e q u e r i e s with e s p e c i a l l y long duration s l o w q u e r y l o g [ = { 0 1 } ] s l o w q u e r y l o g f i l e = / var / l o g / mysql /mariadb slow. l o g l o n g q u e r y t i m e = 10 l o g s l o w r a t e l i m i t = 1000 l o g s l o w v e r b o s i t y = query plan log q u e r i e s not using i n d e x e s l o g s l o w a d m i n s t a t e m e n t s The f o l l o w i n g can be used as easy to r e p l a y backup l o g s or f o r r e p l i c a t i o n. note : i f you are s e t t i n g up a r e p l i c a t i o n slave, s e e README. Debian about other s e t t i n g s you may need to change. s e r v e r i d = 20 r e p o r t h o s t = master1 a u t o i n c r e m e n t i n c r e m e n t = 10 a u t o i n c r e m e n t o f f s e t = 2 l o g b i n = / var / l o g / mysql /mariadb db20 bin l o g b i n i n d e x = / var / l o g / mysql /mariadb db20 bin. index not fab f o r performance, but s a f e r s y n c b i n l o g = 1 e x p i r e l o g s d a y s = 10 m a x b i n l o g s i z e = 100M s l a v e s r e l a y l o g = / var / l o g / mysql /db20 r e l a y bin 17

r e l a y l o g i n d e x = / var / l o g / mysql /db20 r e l a y bin. index r e l a y l o g i n f o f i l e = / var / l o g / mysql /db20 r e l a y bin. i n f o l o g s l a v e u p d a t e s r e a d o n l y I f a p p l i c a t i o n s support i t, t h i s s t r i c t e r sql mode prevents some mistakes l i k e i n s e r t i n g i n v a l i d dates e t c. sql mode = NO ENGINE SUBSTITUTION, TRADITIONAL InnoDB InnoDB i s enabled by d e f a u l t with a 10MB d a t a f i l e in / var / l i b / mysql /. Read the manual f o r more InnoDB r e l a t e d o p t i o n s. There are many! d e f a u l t s t o r a g e e n g i n e = InnoDB you can t j u s t change l o g f i l e s i z e, r e q u i r e s s p e c i a l procedure i n n o d b l o g f i l e s i z e = 50M i n n o d b b u f f e r p o o l s i z e = 2048M i n n o d b l o g b u f f e r s i z e = 8M i n n o d b f i l e p e r t a b l e = 1 i n n o d b o p e n f i l e s = 400 i n n o d b i o c a p a c i t y = 400 innodb flush method = O DIRECT S e c u r i t y Features Read the manual, too, i f you want chroot! chroot = / var / l i b / mysql / For g e n e r a t i n g SSL c e r t i f i c a t e s I recommend the OpenSSL GUI t i n y c a. s s l ca=/e t c / mysql / c a c e r t. pem s s l c e r t=/e t c / mysql / s e r v e r c e r t. pem s s l key=/e t c / mysql / s e r v e r key. pem [ mysqldump ] quick quote names max allowed packet [ mysql ] no auto rehash f a s t e r s t a r t o f mysql but no tab c o m p l e t i t i o n [ isamchk ] k e y b u f f e r IMPORTANT: A d d i t i o n a l s e t t i n g s that can o v e r r i d e those from t h i s f i l e! The f i l e s must end with. cnf, o t h e r w i s e they l l be i gnored.! i n c l u d e d i r / e t c / mysql / conf. d/ Shell commands on the operating system prompt of second *MASTER (db20) Listing 12: Shell commands on the operating system prompt of second *MASTER Dump o f databases o f the second database s e r v e r b e f o r e i n c l u d i n g the dump from MASTER root@db20: mysqldump u r o o t p a l l databases master data=2 > dbdump a l l 2nd master f r e s h. db mysql u r o o t p shop < dbdump shop. db 18

On debian / ubuntu / e t c / mysql / debian. c n f o f the master has to be copied to the r e p l i c a t i o n s l a v e or the password hash f o r debian sys maint should be s e t i n the mysql. u s e r t a b l e on the s l a v e a f t e r redumping o f master s databases to the l o c a l one. SQL commands on the MariaDB prompt of second *MASTER (db20) After MariaDB login with mysql -u root -p follow the SQL commands below: % MariaDB [ ( none )] > Listing 13: SQL commands on the MariaDB prompt of *SLAVE % MASTER part o f MASTER MASTER c o n f i g u r a t i o n % GRANT REPLICATION SLAVE, REPLICATION CLIENT ON. TO r e p l i c a t o r @ 1 9 2. 1 6 8. 1 0. 5 0 IDENTIFIED BY somepassword ; FLUSH PRIVILEGES ; SHOW MASTER STATUS; % SLAVE part o f MASTER MASTER c o n f i g u r a t i o n % CHANGE MASTER TO master host = 1 9 2. 1 6 8. 1 0. 5 0, m a s t e r u s e r = r e p l i c a t o r, master password = somepassword, m a s t e r l o g f i l e = mariadb db10 bin. 0 0 0 0 0 1, m a s t e r l o g p o s =245; START SLAVE; SHOW STATUS SLAVE\G; % Some t e s t statements to check i f changes are r e p l i c a t e d % to the ohter detabase s e r v e r ( db10 ) SELECT FROM shop. customer ; INSERT INTO shop. customeshop. customer ( t i t l e, last name, f i r s t n a m e, a d d r e s s s t r e e t, a d d r e s s c i t y, a d d r e s s c o u n t r y ) VALUES ( "Mrs", "Shuli", "Guo", "Mao street 57", "10000 Beijing ", "China" ) SELECT FROM shop. customer ; DELETE FROM shop. customer WHERE c ustomer id = 1 ; 19

APPENDIX diff of my.cnf config files for MASTER-SLAVE replications Listing 14: diff for MASTER-SLAVE replications d i f f aur my. cnf ORIG my. cnf MASTER db10 grep ˆ[+ ][ˆ] my. cnf ORIG 2012 06 02 0 0 : 1 4 : 1 5. 0 1 0 0 7 1 0 6 0 +0200 +++ my. cnf MASTER db10 2012 06 02 0 0 : 2 2 : 3 7. 4 0 0 5 6 2 3 6 9 +0200 bind address = 1 2 7. 0. 0. 1 +bind address = 1 9 2. 1 6 8. 1 0. 5 0 max connections = 100 +max connections = 4000 s o r t b u f f e r s i z e = 4M +s o r t b u f f e r s i z e r e a d b u f f e r s i z e = 2M r e a d r n d b u f f e r s i z e = 1M +r e a d b u f f e r s i z e +r e a d r n d b u f f e r s i z e = 8M +s e r v e r i d = 10 l o g b i n = / var / l o g / mysql /mariadb bin l o g b i n i n d e x = / var / l o g / mysql /mariadb bin. index +a u t o i n c r e m e n t i n c r e m ent = 10 +a u t o i n c r e m e n t o f f s e t = 1 +l o g b i n = / var / l o g / mysql /mariadb db10 bin +l o g b i n i n d e x = / var / l o g / mysql /mariadb db10 bin. index i n n o d b b u f f e r p o o l s i z e = 256M +i n n o d b b u f f e r p o o l s i z e = 2048M d i f f aur my. cnf ORIG my. cnf SLAVE db20 grep ˆ[+ ] my. cnf ORIG 2012 06 02 0 0 : 1 4 : 1 5. 0 1 0 0 7 1 0 6 0 +0200 +++ my. cnf SLAVE db20 2012 06 02 0 0 : 2 2 : 4 9. 7 9 2 6 2 3 6 6 4 +0200 bind address = 1 2 7. 0. 0. 1 +bind address = 1 9 2. 1 6 8. 1 0. 1 5 0 max connections = 100 +max connections = 4000 s o r t b u f f e r s i z e = 4M +s o r t b u f f e r s i z e r e a d b u f f e r s i z e = 2M r e a d r n d b u f f e r s i z e = 1M +r e a d b u f f e r s i z e +r e a d r n d b u f f e r s i z e = 8M +s e r v e r i d = 20 l o g b i n = / var / l o g / mysql /mariadb bin l o g b i n i n d e x = / var / l o g / mysql /mariadb bin. index +a u t o i n c r e m e n t i n c r e m ent = 10 +a u t o i n c r e m e n t o f f s e t = 2 +l o g b i n = / var / l o g / mysql /mariadb db20 bin +l o g b i n i n d e x = / var / l o g / mysql /mariadb db20 bin. index +r e l a y l o g = / var / l o g / mysql /db20 r e l a y bin +r e l a y l o g i n d e x = / var / l o g / mysql /db20 r e l a y bin. index +r e l a y l o g i n f o f i l e = / var / l o g / mysql /db20 r e l a y bin. i n f o +l o g s l a v e u p d a t e s i n n o d b b u f f e r p o o l s i z e = 256M +i n n o d b b u f f e r p o o l s i z e = 2048M 20

diff of my.cnf config files for MASTER-MASTER replications Listing 15: diff for MASTER-MASTER replications d i f f aur my. cnf ORIG my. cnf MASTER MASTER db10 grep ˆ[+ ][ˆ] my. cnf ORIG 2012 06 02 0 0 : 1 4 : 1 5. 0 1 0 0 7 1 0 6 0 +0200 +++ my. cnf MASTER MASTER db10 2012 06 02 0 0 : 1 3 : 1 5. 5 7 3 7 7 6 2 5 4 +0200 bind address = 1 2 7. 0. 0. 1 +bind address = 1 9 2. 1 6 8. 1 0. 5 0 max connections = 100 +max connections = 4000 s o r t b u f f e r s i z e = 4M +s o r t b u f f e r s i z e r e a d b u f f e r s i z e = 2M r e a d r n d b u f f e r s i z e = 1M +r e a d b u f f e r s i z e +r e a d r n d b u f f e r s i z e = 8M +s e r v e r i d = 10 l o g b i n = / var / l o g / mysql /mariadb bin l o g b i n i n d e x = / var / l o g / mysql /mariadb bin. index +a u t o i n c r e m e n t i n c r e m ent = 10 +a u t o i n c r e m e n t o f f s e t = 1 +l o g b i n = / var / l o g / mysql /mariadb db10 bin +l o g b i n i n d e x = / var / l o g / mysql /mariadb db10 bin. index +r e l a y l o g = / var / l o g / mysql /db10 r e l a y bin +r e l a y l o g i n d e x = / var / l o g / mysql /db10 r e l a y bin. index +r e l a y l o g i n f o f i l e = / var / l o g / mysql /db10 r e l a y bin. i n f o +l o g s l a v e u p d a t e s i n n o d b b u f f e r p o o l s i z e = 256M +i n n o d b b u f f e r p o o l s i z e = 2048M d i f f aur my. cnf ORIG my. cnf MASTER MASTER db20 grep ˆ[+ ] my. cnf ORIG 2012 06 02 0 0 : 1 4 : 1 5. 0 1 0 0 7 1 0 6 0 +0200 +++ my. cnf MASTER MASTER db20 2012 06 02 0 0 : 1 3 : 2 7. 3 6 1 8 3 4 6 3 3 +0200 bind address = 1 2 7. 0. 0. 1 +bind address = 1 9 2. 1 6 8. 1 0. 1 5 0 max connections = 100 +max connections = 4000 s o r t b u f f e r s i z e = 4M +s o r t b u f f e r s i z e r e a d b u f f e r s i z e = 2M r e a d r n d b u f f e r s i z e = 1M +r e a d b u f f e r s i z e +r e a d r n d b u f f e r s i z e = 8M +s e r v e r i d = 20 l o g b i n = / var / l o g / mysql /mariadb bin l o g b i n i n d e x = / var / l o g / mysql /mariadb bin. index +a u t o i n c r e m e n t i n c r e m ent = 10 +a u t o i n c r e m e n t o f f s e t = 2 +l o g b i n = / var / l o g / mysql /mariadb db20 bin +l o g b i n i n d e x = / var / l o g / mysql /mariadb db20 bin. index +r e l a y l o g = / var / l o g / mysql /db20 r e l a y bin +r e l a y l o g i n d e x = / var / l o g / mysql /db20 r e l a y bin. index +r e l a y l o g i n f o f i l e = / var / l o g / mysql /db20 r e l a y bin. i n f o +l o g s l a v e u p d a t e s i n n o d b b u f f e r p o o l s i z e = 256M +i n n o d b b u f f e r p o o l s i z e = 2048M 21