SlideShare a Scribd company logo
Tungsten University: 
                    Set Up and Operate
                   Tungsten Replication
                              Robert Hodges, CEO
                    Giuseppe Maxia, Director of QA


©Continuent 2013
About Continuent

               •   The leading provider of clustering and
                   replication for open source DBMS

               •   Tungsten Clustering - Commercial-grade HA,
                   performance scaling and data management
                   for MySQL

               •   Tungsten Replication - Real-time, "exible,
                   high-performance replication




©Continuent 2013                       2
Introducing Tungsten Replicator




©Continuent 2013                  3
Tungsten Replicator Overview
                                          Master
                                          Replicator           THL
                    Download
                   transactions
                   via network                         (Transactions + Metadata)


          DBMS
          Logs
                                  Slave   Replicator           THL

                         Apply using JDBC              (Transactions + Metadata)




©Continuent 2013                               4
Tungsten Replication Service

                                           Pipeline
                   Stage                    Stage                    Stage
    Extract Filter         Apply    Extract Filter   Apply    Extract Filter   Apply




     Master                  Transaction                In-Memory              Slave
     DBMS                    History Log                  Queue                DBMS




©Continuent 2013                                5
Overview of Installation Process
               1. Set up hosts
               2. Prepare MySQL replicas
               3. Download software
               4. Install using tungsten-installer

                           Amazon Setup:
         https://docs.continuent.com/wiki/display/TEDOC/
                       Preparing+EC2+Servers


©Continuent 2013                       6
How tungsten-installer Works

         Staging copy                     db1
            of files


                                          db2


                   check prereqs
                      copy code           db3
                       configure
©Continuent 2013                   7
What Is Tungsten Doing?




©Continuent 2013              8
Commands to Check Replication

               •   trepctl services -- All services

               •   trepctl status -- Overall pipe status

               •   trepctl status -name stages -- Stage summary

               •   trepctl status -name stores -- Store summary

               •   trepctl status -name tasks -- Task detail

               •   trepctl [-service name] heartbeat -- Is it Alive?




©Continuent 2013                         9
Changing Replicator Con!guration




©Continuent 2013                  10
Commands to Change Con!guration

               •   con#gure-service - Alter con#guration

               •   update - Upgrade the replicator to a new
                   version


                        Hint: Don’t change replicator
                         configuration files directly...




©Continuent 2013                      11
Recon!guring a Replicator

           •       No Restart
                   trepctl offline
                   tools/configure-service ...
                   trepctl configure
                   trepctl online


           •       With Restart
                   tools/configure-service ...
                   replicator restart


©Continuent 2013                   12
Enabling Parallel Replication




©Continuent 2013                 13
Parallel Replication of Sharded Data

                                           Pipeline
                                                                          Stage
                   Stage                    Stage                  Extract Filter   Apply
    Extract Filter         Apply    Extract Filter   Apply         Extract Filter   Apply
                                                                   Extract Filter   Apply




     Master                  Transaction                     Parallel               Slave
     DBMS                    History Log                     Queue                  DBMS




©Continuent 2013                                14
Fixing Problems




©Continuent 2013          15
The Scene of the Crime
   trepctl -host db2 status
   Processing status command...
   NAME                     VALUE
   ----                     -----
   ...
   pendingError           : Event application failed:
   seqno=1957469 fragno=0 message=java.sql.SQLException:
   Statement failed on slave but succeeded on master
   pendingErrorCode       : NONE
   pendingErrorEventId    : mysql-bin.000008:0000000461736666;0
   pendingErrorSeqno      : 1957469
   pendingExceptionMessage: java.sql.SQLException: Statement
   failed on slave but succeeded on master
                            create table trouble(id int primary
   key) /* ___SERVICE___ = [university] */
   ...
   Finished status command...

©Continuent 2013                 16
Correcting problems
           1. Look at the transaction (thl list -seqno NNN)
           2. Look at the replicator message log
           3. Fix the problem and go online
                   OR

           4. Skip over the problem and go online
                   OR

           5. Reprovision the slave



©Continuent 2013                      17
Tungsten Logs




©Continuent 2013         18
Simple Facts about Logs

           •       Replicator log = THL (Transaction History Log)
           •       One THL per replication service
           •       2x the size of MySQL binlog
           •       Default retention of 7 days
           •       Take service o$ine to move or delete logs
                   safely
           • The thl tool shows you log contents


©Continuent 2013                        19
Resetting Replication




©Continuent 2013             20
Resetting and Reinstalling
                   Reset
           1. Stop replicator
           2. Remove THL #les
           3. Remove tungsten_<svc> databases
                   Reinstall
           1. All of the above, plus delete /opt/continuent/*
           2. Rerun installation



©Continuent 2013                   21
Backup and Restore




©Continuent 2013           22
What Backup Tools Does MySQL Have?

                    MySQL
                                      mysqldump
                    Server
                    Process           (dataset < 10Gb)
                                      xtrabackup
                   DBMS Files         (10Gb < dataset < 1Tb
                                      tar/rsync
                                      (dataset < 1Tb)
                                      file system snapshot
                   File System
                                      (1Tb < dataset)

©Continuent 2013                 23
Advanced Installation
                     using Cookbooks




©Continuent 2013             24
How Do I Install Fan-In Replication?

           db1
                    Replicator
                      Service db1
                                         Replicator
                                          Service db1

                                          Service db2
           db2
                    Replicator
                     Service db2                        db3




©Continuent 2013                    25
How Do I install Multi-Master?

           db1      Replicator

                     Service db1
                     Service db2
                                                      db3
                     Service db3
                                        Service db1
                                        Service db2
           db2
                                        Service db3

                     Service db1
                     Service db2
                     Service db3

                   Replicator


©Continuent 2013                   26
Tungsten Cookbook Helps!

               •   Installs complex topologies automatically

               •   Directions in cookbook/README

               •   Parameters in cookbook/USER_VALUES.sh

               •   Node names in COMMON_NODES.sh

               •   Installation script for each supported
                   topology




©Continuent 2013                       27
Joining the Community




©Continuent 2013             28
Tungsten Replicator is Open Source

           •       Project home:
                   http://code.google.com/p/tungsten-replicator/

           •       Log bugs, #nd builds, post in replicator discussion
                   group

           •       Documentation:
                   https://docs.continuent.com/wiki/display/TEDOC/
                   Tungsten+Documentation+Home




©Continuent 2013                         29
Wrapping Up




©Continuent 2013        30
Tungsten University Sessions

           •       Unleashing the Power of Tungsten Connectors
                   (February 21 & 26)

           •       Managing Multi-Master and Fan-in Topologies
                   (March)

           •       Zero-downtime DBMS Migration and
                   Maintenance (March)
                   Send any feedback to: tu@continuent.com




©Continuent 2013                       31
560 S. Winchester Blvd., Suite 500   Our Blogs:
San Jose, CA 95128                   http://scale-out-blog.blogspot.com
Tel +1 (866) 998-3642                http://datacharmer.org/blog
Fax +1 (408) 668-1009                http://www.continuent.com/news/blogs
e-mail: sales@continuent.com



                           Continuent Web Page:
                        http://www.continuent.com

                          Tungsten Replicator 2.0:
                http://code.google.com/p/tungsten-replicator

©Continuent 2012.

More Related Content

What's hot (18)

PDF
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
Takatoshi Matsuo
 
PPT
No Heap Remote Objects for Distributed real-time Java
Universidad Carlos III de Madrid
 
PDF
Implementing the Future of PostgreSQL Clustering with Tungsten
Command Prompt., Inc
 
PDF
Logging Last Resource Optimization for Distributed Transactions in Oracle…
Gera Shegalov
 
PDF
Logging Last Resource Optimization for Distributed Transactions in Oracle We...
Gera Shegalov
 
PDF
Distributed Stream Processing in the real [Perl] world
SATOSHI TAGOMORI
 
PDF
Front-End Optimization (FEO)
Kim Stefan Lindholm
 
PPTX
High-Availability of YARN (MRv2)
Mário Almeida
 
PDF
How Nyherji Manages High Availability TSM Environments using FlashCopy Manager
IBM Danmark
 
PDF
Large customers want postgresql too !!
rosensteel
 
PDF
Instrumenting parsecs raytrace
Mário Almeida
 
PDF
cosbench-openstack.pdf
OpenStack Foundation
 
PDF
Presentation: Optimal Power Management for Server Farm to Support Green Compu...
Sivadon Chaisiri
 
PDF
Cosbench apac
OpenCity Community
 
PDF
Ensuring performance for real time packet processing in open stack white paper
hptoga
 
PDF
Basics of JVM Tuning
Vladislav Gangan
 
PDF
Dean Keynote Ladis2009 Google
Duoc
 
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
Takatoshi Matsuo
 
No Heap Remote Objects for Distributed real-time Java
Universidad Carlos III de Madrid
 
Implementing the Future of PostgreSQL Clustering with Tungsten
Command Prompt., Inc
 
Logging Last Resource Optimization for Distributed Transactions in Oracle…
Gera Shegalov
 
Logging Last Resource Optimization for Distributed Transactions in Oracle We...
Gera Shegalov
 
Distributed Stream Processing in the real [Perl] world
SATOSHI TAGOMORI
 
Front-End Optimization (FEO)
Kim Stefan Lindholm
 
High-Availability of YARN (MRv2)
Mário Almeida
 
How Nyherji Manages High Availability TSM Environments using FlashCopy Manager
IBM Danmark
 
Large customers want postgresql too !!
rosensteel
 
Instrumenting parsecs raytrace
Mário Almeida
 
cosbench-openstack.pdf
OpenStack Foundation
 
Presentation: Optimal Power Management for Server Farm to Support Green Compu...
Sivadon Chaisiri
 
Cosbench apac
OpenCity Community
 
Ensuring performance for real time packet processing in open stack white paper
hptoga
 
Basics of JVM Tuning
Vladislav Gangan
 
Dean Keynote Ladis2009 Google
Duoc
 

Similar to Tungsten University: Setup and Operate Tungsten Replicators (20)

PDF
Tungsten University: Set Up And Manage Advanced Replication Topologies
Continuent
 
PDF
Setup & Operate Tungsten Replicator
Continuent
 
PDF
Set Up & Operate Tungsten Replicator
Continuent
 
PDF
Tungsten University: Setup & Operate Tungsten Replicator
Continuent
 
PDF
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
Continuent
 
PDF
Tungsten University: Configure and provision Tungsten clusters
Continuent
 
PDF
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Continuent
 
PDF
Tungsten University: Introduction to Continuent Tungsten 2.0
Continuent
 
PDF
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to analytics
Continuent
 
PDF
Database Performance With Proxy Architectures
PerconaPerformance
 
KEY
Consolidated shared indexes in real time
Jeff Mace
 
PDF
Living the Easy Life with Rules-Based Autonomic Database Clusters
Linas Virbalas
 
PDF
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Continuent
 
PDF
Harnessing the Power of Master/Slave Clusters to Operate Data-Driven Business...
Continuent
 
PDF
Preventing multi master conflicts with tungsten
Giuseppe Maxia
 
PDF
Tungsten University: Unleashing the Power of Tungsten Connectors
Continuent
 
PDF
Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication
Linas Virbalas
 
PDF
Set Up & Operate Open Source Oracle Replication
Continuent
 
PDF
On-Demand Image Resizing Extended - External Meet-up
Jonathan Lee
 
PDF
Container orchestration from theory to practice
Docker, Inc.
 
Tungsten University: Set Up And Manage Advanced Replication Topologies
Continuent
 
Setup & Operate Tungsten Replicator
Continuent
 
Set Up & Operate Tungsten Replicator
Continuent
 
Tungsten University: Setup & Operate Tungsten Replicator
Continuent
 
Tungsten University: Geographically Distributed Multi-Master MySQL Clusters
Continuent
 
Tungsten University: Configure and provision Tungsten clusters
Continuent
 
Tungsten Use Case: How Gittigidiyor (a subsidiary of eBay) Replicates Data In...
Continuent
 
Tungsten University: Introduction to Continuent Tungsten 2.0
Continuent
 
Replicate from Oracle to Oracle, Oracle to MySQL, and Oracle to analytics
Continuent
 
Database Performance With Proxy Architectures
PerconaPerformance
 
Consolidated shared indexes in real time
Jeff Mace
 
Living the Easy Life with Rules-Based Autonomic Database Clusters
Linas Virbalas
 
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Continuent
 
Harnessing the Power of Master/Slave Clusters to Operate Data-Driven Business...
Continuent
 
Preventing multi master conflicts with tungsten
Giuseppe Maxia
 
Tungsten University: Unleashing the Power of Tungsten Connectors
Continuent
 
Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication
Linas Virbalas
 
Set Up & Operate Open Source Oracle Replication
Continuent
 
On-Demand Image Resizing Extended - External Meet-up
Jonathan Lee
 
Container orchestration from theory to practice
Docker, Inc.
 
Ad

More from Continuent (20)

PDF
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Continuent
 
PDF
Continuent Tungsten Value Proposition Webinar
Continuent
 
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Continuent
 
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Continuent
 
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #4: MS Azure Database MySQL
Continuent
 
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Continuent
 
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #1: AWS Aurora
Continuent
 
PDF
Webinar Slides: AWS Aurora MySQL Replacement: Break Away From Geo-Limitations...
Continuent
 
PDF
Webinar Slides: No Data Loss MySQL: Guaranteed Credit Card Transaction Availa...
Continuent
 
PDF
Webinar Slides: Intelligent Database Proxies: Routing & Transparent Failover
Continuent
 
PPTX
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
Continuent
 
PDF
Training Slides: 205 - Installing and Configuring Tungsten Dashboard
Continuent
 
PDF
Training Slides: 352 - Tungsten Replicator for MongoDB & Kafka
Continuent
 
PDF
Training Slides: 351 - Tungsten Replicator for Data Warehouses
Continuent
 
PDF
Training Slides: 303 - Replicating out of a Cluster
Continuent
 
PDF
Training Slides: 206 - Using the Tungsten Cluster AMI
Continuent
 
PDF
Training Slides: 254 - Using the Tungsten Replicator AMI
Continuent
 
PDF
Training Slides: 253 - Filter like a Pro
Continuent
 
PDF
Training Slides: 252 - Monitoring & Troubleshooting
Continuent
 
PDF
Training Slides: 302 - Securing Your Cluster With SSL
Continuent
 
Tungsten Webinar: v6 & v7 Release Recap, and Beyond
Continuent
 
Continuent Tungsten Value Proposition Webinar
Continuent
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Continuent
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Continuent
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #4: MS Azure Database MySQL
Continuent
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Continuent
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #1: AWS Aurora
Continuent
 
Webinar Slides: AWS Aurora MySQL Replacement: Break Away From Geo-Limitations...
Continuent
 
Webinar Slides: No Data Loss MySQL: Guaranteed Credit Card Transaction Availa...
Continuent
 
Webinar Slides: Intelligent Database Proxies: Routing & Transparent Failover
Continuent
 
Webinar Slides: High Volume MySQL HA: SaaS Continuous Operations with Terabyt...
Continuent
 
Training Slides: 205 - Installing and Configuring Tungsten Dashboard
Continuent
 
Training Slides: 352 - Tungsten Replicator for MongoDB & Kafka
Continuent
 
Training Slides: 351 - Tungsten Replicator for Data Warehouses
Continuent
 
Training Slides: 303 - Replicating out of a Cluster
Continuent
 
Training Slides: 206 - Using the Tungsten Cluster AMI
Continuent
 
Training Slides: 254 - Using the Tungsten Replicator AMI
Continuent
 
Training Slides: 253 - Filter like a Pro
Continuent
 
Training Slides: 252 - Monitoring & Troubleshooting
Continuent
 
Training Slides: 302 - Securing Your Cluster With SSL
Continuent
 
Ad

Tungsten University: Setup and Operate Tungsten Replicators

  • 1. Tungsten University:  Set Up and Operate Tungsten Replication Robert Hodges, CEO Giuseppe Maxia, Director of QA ©Continuent 2013
  • 2. About Continuent • The leading provider of clustering and replication for open source DBMS • Tungsten Clustering - Commercial-grade HA, performance scaling and data management for MySQL • Tungsten Replication - Real-time, "exible, high-performance replication ©Continuent 2013 2
  • 4. Tungsten Replicator Overview Master Replicator THL Download transactions via network (Transactions + Metadata) DBMS Logs Slave Replicator THL Apply using JDBC (Transactions + Metadata) ©Continuent 2013 4
  • 5. Tungsten Replication Service Pipeline Stage Stage Stage Extract Filter Apply Extract Filter Apply Extract Filter Apply Master Transaction In-Memory Slave DBMS History Log Queue DBMS ©Continuent 2013 5
  • 6. Overview of Installation Process 1. Set up hosts 2. Prepare MySQL replicas 3. Download software 4. Install using tungsten-installer Amazon Setup: https://docs.continuent.com/wiki/display/TEDOC/ Preparing+EC2+Servers ©Continuent 2013 6
  • 7. How tungsten-installer Works Staging copy db1 of files db2 check prereqs copy code db3 configure ©Continuent 2013 7
  • 8. What Is Tungsten Doing? ©Continuent 2013 8
  • 9. Commands to Check Replication • trepctl services -- All services • trepctl status -- Overall pipe status • trepctl status -name stages -- Stage summary • trepctl status -name stores -- Store summary • trepctl status -name tasks -- Task detail • trepctl [-service name] heartbeat -- Is it Alive? ©Continuent 2013 9
  • 11. Commands to Change Con!guration • con#gure-service - Alter con#guration • update - Upgrade the replicator to a new version Hint: Don’t change replicator configuration files directly... ©Continuent 2013 11
  • 12. Recon!guring a Replicator • No Restart trepctl offline tools/configure-service ... trepctl configure trepctl online • With Restart tools/configure-service ... replicator restart ©Continuent 2013 12
  • 14. Parallel Replication of Sharded Data Pipeline Stage Stage Stage Extract Filter Apply Extract Filter Apply Extract Filter Apply Extract Filter Apply Extract Filter Apply Master Transaction Parallel Slave DBMS History Log Queue DBMS ©Continuent 2013 14
  • 16. The Scene of the Crime trepctl -host db2 status Processing status command... NAME VALUE ---- ----- ... pendingError : Event application failed: seqno=1957469 fragno=0 message=java.sql.SQLException: Statement failed on slave but succeeded on master pendingErrorCode : NONE pendingErrorEventId : mysql-bin.000008:0000000461736666;0 pendingErrorSeqno : 1957469 pendingExceptionMessage: java.sql.SQLException: Statement failed on slave but succeeded on master create table trouble(id int primary key) /* ___SERVICE___ = [university] */ ... Finished status command... ©Continuent 2013 16
  • 17. Correcting problems 1. Look at the transaction (thl list -seqno NNN) 2. Look at the replicator message log 3. Fix the problem and go online OR 4. Skip over the problem and go online OR 5. Reprovision the slave ©Continuent 2013 17
  • 19. Simple Facts about Logs • Replicator log = THL (Transaction History Log) • One THL per replication service • 2x the size of MySQL binlog • Default retention of 7 days • Take service o$ine to move or delete logs safely • The thl tool shows you log contents ©Continuent 2013 19
  • 21. Resetting and Reinstalling Reset 1. Stop replicator 2. Remove THL #les 3. Remove tungsten_<svc> databases Reinstall 1. All of the above, plus delete /opt/continuent/* 2. Rerun installation ©Continuent 2013 21
  • 23. What Backup Tools Does MySQL Have? MySQL mysqldump Server Process (dataset < 10Gb) xtrabackup DBMS Files (10Gb < dataset < 1Tb tar/rsync (dataset < 1Tb) file system snapshot File System (1Tb < dataset) ©Continuent 2013 23
  • 24. Advanced Installation using Cookbooks ©Continuent 2013 24
  • 25. How Do I Install Fan-In Replication? db1 Replicator Service db1 Replicator Service db1 Service db2 db2 Replicator Service db2 db3 ©Continuent 2013 25
  • 26. How Do I install Multi-Master? db1 Replicator Service db1 Service db2 db3 Service db3 Service db1 Service db2 db2 Service db3 Service db1 Service db2 Service db3 Replicator ©Continuent 2013 26
  • 27. Tungsten Cookbook Helps! • Installs complex topologies automatically • Directions in cookbook/README • Parameters in cookbook/USER_VALUES.sh • Node names in COMMON_NODES.sh • Installation script for each supported topology ©Continuent 2013 27
  • 29. Tungsten Replicator is Open Source • Project home: http://code.google.com/p/tungsten-replicator/ • Log bugs, #nd builds, post in replicator discussion group • Documentation: https://docs.continuent.com/wiki/display/TEDOC/ Tungsten+Documentation+Home ©Continuent 2013 29
  • 31. Tungsten University Sessions • Unleashing the Power of Tungsten Connectors (February 21 & 26) • Managing Multi-Master and Fan-in Topologies (March) • Zero-downtime DBMS Migration and Maintenance (March) Send any feedback to: [email protected] ©Continuent 2013 31
  • 32. 560 S. Winchester Blvd., Suite 500 Our Blogs: San Jose, CA 95128 http://scale-out-blog.blogspot.com Tel +1 (866) 998-3642 http://datacharmer.org/blog Fax +1 (408) 668-1009 http://www.continuent.com/news/blogs e-mail: [email protected] Continuent Web Page: http://www.continuent.com Tungsten Replicator 2.0: http://code.google.com/p/tungsten-replicator ©Continuent 2012.