2. Author
• Astute corporate resource with 10+ years of corporate experience with emphasis on database management, programming, software
development, testing, web technologies and product improvement for corporations. Combines expert software and database management
expertise with strong qualifications in Software, Data Engineering & Information Management.
Concurrently, manage all the database functions for the current company. Industry experience in Information Technology. Strong
understanding of the complex challenges in Software Development and problem troubleshooting. An expert on identifying and solving
problems, gaining new business contacts, reducing costs, coordinating staff and evaluating performance. Professional traits include;
problem-solving, decision-making, time management, multitasking, analytical thinking, effective communication, and computer
competencies.
• Oracle Certified Professional OCA on 9i
• Oracle Certified Professional OCP on 9i
• Oracle Certified Professional OCP on 10g
• Oracle Certified Professional OCP on 11g
• Oracle Certified Professional OCP on MySQL 5
• Oracle Certified Professional OCE on 10g managing on Linux
• Oracle Certified Professional OCP on E-Business Apps DBA
• Microsoft Certified Technology Specialist on SQL Server 2005
• Microsoft Certified Technology Specialist on SQL Server 2008
• Microsoft Certified IT Professional on SQL Server 2005
• Microsoft Certified IT Professional on SQL Server 2008
• Sun Certified Java Programmer 5.0
• IBM Certified Database(DB2) Associate 9.0
• ITIL V3 Foundation Certified
• COBIT 5 Foundation Certified
• PRINCE2 Foundation Certified
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
3. Agenda
• MySQLAvailable HA Solutions
• MySQL Replication
• Types of Replication
• How ReplicationWorks
• Replication requirement
• Replication-MasterConfiguration
• Replication-SlaveConfiguration my.cnf
• Benefits of Replication
• Network upload bandwidth requirement
• Application download bandwidth requirement
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
4. MySQL Available HA Solutions
•Operating System Cluster
• Active/Passive OS level clustering such as
• Windows Cluster
• Red Hat Cluster
• Oracle
• Sun Solaris
•Operating System Replication
• DRBD – Distributed Replication block device
• Software based HA – support synchronous and asynchronous mirroring of
data from one node to another node
• www.drdb.org
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
5. MySQL Available HA Solutions
• MySQL Cluster Carrier Grade
• MySQLCluster enables users to meet the database challenges of next generation web, cloud, and
communications services with uncompromising scalability, uptime and agility
• Expensive solution
• Minimal downtime
• MySQL Fabric
• MySQL Fabric is an extensible framework for managing farms of MySQL Servers.Two primary
features have been implemented - HighAvailability (HA) and scaling out using data sharding.These
features can be used in isolation or in combination
• MySQL Replication
• MySQL Replication enables users to cost-effectively deliver application performance, scalability and
high availability. Many of the world's most trafficked web properties like eBay, Facebook, Tumblr,
Twitter andYouTube rely on MySQL Replication to serve hundreds of millions of users and handle
exponential growth
• Supported synchronous and asynchronous
• Available with Enterprise Edition
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
6. MySQL Replication
• MySQL’s built-in replication is the foundation for building large, high-
performance applications on top of MySQL, using the so-called “scale-
out” architecture
• The basic problem replication solves is keeping one server’s data
synchronized with another’s. Many replicas can connect to a single
master and stay in sync with it, and a replica can, in turn, act as a
master.You can arrange masters and replicas in many different ways
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
7. Types of Replication
• MySQL supports two kinds of replication: statement-based replication and
row-based replication.
• Statement-based (or “logical”) replication has been available since MySQL 3.23.
• Row-based replication was added in MySQL 5.1.
• Both kinds work by recording changes in the master’s binary log and replaying
the log on the replica
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
8. How Replication works
• How MySQL actually replicates data. At a high level, replication is a simple
three-part process:
• The master records changes to its data in its binary log. (These records are called
binary log events.)
• The replica copies the master’s binary log events to its relay log.
• The replica replays the events in the relay log, applying the changes to its own
data
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
9. Replication Configuration
• Setting up replication is a fairly simple process in MySQL, but there are many
variations on the basic steps, depending on the scenario. The most basic scenario is a
freshly installed master and replica. At a high level, the process is as follows
• Set up replication accounts on each server.
• Configure the master and replica.
• Instruct the replica to connect to and replicate from the master
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
10. Replication Configuration
•Creating Replication Accounts.
• mysql> GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO
<user>@'192.168.0.%' IDENTIFIED BY ‘jbhsyed';
•Configuring the Master and Replica (Slave )
• Binary logs must have to enable
• Server Id must be assigned , master and other slaves have unique server id
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
12. Replica (Slave) –my.cnf
• Parameters
• Relay_log
• The relay log consists of the events read from the binary log of the master and written
by the slave I/O thread. Events in the relay log are executed on the slave as part of the
SQL thread.
• Log_slave_updates
• Normally, a slave does not log to its own binary log any updates that are received from a
master server.This option tells the slave to log the updates performed by its SQL thread
to its own binary log.
• Read_only
• Make the server read-only, so that it processes only retrievals and blocks updates
• Relay_log_purge
• Disable or enable automatic purging of relay logs as soon as they are no longer needed.
The default value is 1 (enabled).This is a global variable that can be changed dynamically
with SETGLOBAL relay_log_purge = N
• --Master-info-file
• The name to use for the file in which the slave records information about the master.
The default name ismaster.info in the data directory
• --Relay-log-info-file
• The name to use for the file in which the slave records information about the relay logs.
The default name isrelay-log.info in the data directory.
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
13. Benefits of Replication
• Data Distribution
• It is useful to maintaining a copy of data in geographically distant locations.
• Load Balancing
• Balance the load of your read queries with the help of Replicas.
• Backups
• Backup more than one locations
• High Availability and Failover
• If Primary Site will be down then backup site is ready to take connection and the downtime will be minimize.
• Testing of Releases
• Test can be perform on the Replica.
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
14. Network Upload bandwidth
• Network upload bandwidth requirement
• It depends on the
• Binary log size.
•Configure minimum size of binary logs as possible.
•Separate disk or partition for binary logs.
• MonitoringTool (Optional)
•Workbench and other tools which is using from the Primary Site to the Backup
Site.
• Etc..
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F
15. Network Download bandwidth
• Calculation for Network Download bandwidth requirement factors
• Application Server on the Primary Site
• Largest Row in the Database
• (Maximum Row Size *Total Number of Records fetch at a time) * Number of
Concurrent Requests.
• Application Server on the DR Site
• Maximum data packet size at a time * Number of concurrent requests.
By JBH Syed | BSCS | MSDIEM | MCTS | MCITP | OCA | OCP | OCE | SCJP | ITILv3 | PRINCE2 | COBIT5F