SlideShare a Scribd company logo
1 of 33
Download to read offline
1
MariaDB-HaProxy
2
1.
2.
3.
13.5 Billion year ago was nothing !
For backup and Point In Time recovery the
BINARY LOGS
was born
Early after the replication was born in MySQL 3.23.
Replicas track binlog files position and get notified for new events !
IO Thread for copying events
SQL thread for applying events
BINARY LOGS ARE CROSS ENGINES
AND STATEMENT BASED
But the story get more complex
GOTCHA WITH BINARY LOGS
DON’T SCALE FOR WRITES
# FSYNC IS LIMITED ON DISK
Workaround was not to sync bin logs making repli
CRASH UNSAFE
MariaDB Fixed it in 5.5 with
TC + GROUP COMMIT
WRITE PERFORMANCE IS BACK
REPLICAS CRASH SAFE in 10.0
According to Facebook first implementation of google patch for group commit
But the story get more complex
NOW LEADER IS TO FAST REPLICAS CAN’T CATCH
DON’T SCALE FOR WRITES
Need Parallel Replication
Workaround was using Tungsten replicator, Galera Group replication , implement
prefetch events on slaves
MariaDB Fixed it in 10.0 and improved it 10.1 with
In order parallel replication and Optimistic Commit
WRITE PERF IS BACK ON REPLICAS
According to Booking slave group commits enable to go faster vs the workload x4
http://www.slideshare.net/JeanFranoisGagn/mysql-parallel-replication-inventory-usecase-and-limitations
In the last microsecond of evolution !
REPLICATION
BECOME CRASH SAFE AND REPLICAS CAN CATCH
BINARY LOGS
STILL NO GOOD FOR REPLICAS ELECTION
But the story get more complex
Replicas track position in files and not unique TX ID
Need GTID
Workaround: pseudo GTID, parse diff like MHA, TUNGSTEN or BINLOG server
MariaDB 10.0 Fixed it without gotcha
Domain ID - Server ID - Transaction seq #
No downtime implementation
But the story get more complex
TRX on Leader not guaranteed to be on any replicas
Fixing can be seen as regression ?
Workaround: Galera , NDB cluster, MongoDB
MariaDB 10.1 Not fixing only with Galera but improved Semi-Sync
Google patches for parallel Semi-Sync with group commit
In the last nanosecond of evolution !
MariaDB was feature ready for LEADER
ELECTION and so was born
Replication-Manager
13
Replication-Manager
Switchover Workflow
Failover - False Positive Detection
Failover Monitoring Workflow
Maxscale
•
•
•
•
•
•
•
HaProxy
•
•
•
•
Features
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Settings
# REPLICATION
#skip_slave_start = 1
plugin_load = "semisync_master.so;semisync_slave.so;sql_errlog.so"
rpl_semi_sync_master = ON
rpl_semi_sync_slave = ON
loose_rpl_semi_sync_master_enabled = ON
loose_rpl_semi_sync_slave_enabled = ON
log_slave_updates = ON
slave_parallel_mode = optimistic
slave_domain_parallel_threads = %%ENV:NODES_CPU_CORES%%
slave_parallel_threads = %%ENV:NODES_CPU_CORES%%
relay_log = ./.system/repl/relay-bin
relay_log_index = ./.system/repl/relay-bin.index
relay_log_space_limit = 1G
log_bin = ./.system/repl/mariadb-bin
log_bin_index = ./.system/repl/mariadb-bin.index
binlog_format = ROW
binlog_checksum = 1
binlog_cache_size = 1M
binlog_stmt_cache_size = 1M
expire_logs_days = 5
sync_binlog = 1
replicate_annotate_row_events = 1
report_host='host_%%ENV:SERVER_ID%%'
# TOPOLOGY
hosts = "%%ENV:SVC_CONF_ENV_BACKEND_IPS%%"
user = "root:%%ENV:SVC_CONF_ENV_MYSQL_ROOT_PASSWORD%%"
rpluser = "root:%%ENV:SVC_CONF_ENV_MYSQL_ROOT_PASSWORD%%"
# LOG
logfile = "./dashboard/replication-manager.log"
#verbose = true
# HTTP & ALERTS
http-server = true
http-bind-address = "0.0.0.0"
http-port = "%%ENV:SVC_CONF_ENV_PORT_HTTP%%"
http-root = "./dashboard"
mail-from = "mrm@localhost"
mail-smtp-addr = "localhost:25"
mail-to = "mrm@mariadb.com"
# FAILOVER
autorejoin = true
readonly = true
wait-kill = 5000
post-failover-script = ""
pre-failover-script =""
# CHECK
check-type = "tcp"
failcount = 5
failover-limit = 3
failover-time-limit = 10
gtidcheck = true
maxdelay = 30
# HA PROXY WRAPPER MODE
# ---------------------
haproxy = true
haproxy-binary-path = "/usr/sbin/haproxy"
haproxy-write-port= %%ENV:SVC_CONF_ENV_PORT_RW%%
haproxy-read-port=%%ENV:SVC_CONF_ENV_PORT_R_LB%%
Downloads
•
Source & Documentation
•
Roadmap and Features Management
•
Talk to us
•
21
Demo
•
•
•
•
○
○
○
○
○
22
MariaDB
Replication
Manager
Agent Stack
•
•
•
•
•
•
Collector Stack
•
•
•
•
Step 1 : User account bootstrap
•
Step 2 : Agent bootstrap
•
wget -O/tmp/opensvc.deb http://repo.opensvc.com/deb/current
sudo dpkg -i /tmp/opensvc.deb
•
sudo nodemgr set --param node.repopkg --value http://repo.opensvc.com/
sudo nodemgr set --param node.repocomp --value
http://repo.opensvc.com/compliance/
sudo nodemgr set --param node.dbopensvc --value
https://collector.opensvc.com
Step 2 : Agent bootstrap is generating a node conf file
•
[node]
repopkg = http://repo.opensvc.com/
repocomp = http://repo.opensvc.com/compliance/
dbopensvc = https://collector.opensvc.com/feed/default/call/xmlrpc
dbcompliance = https://collector.opensvc.com/init/compliance/call/xmlrpc
host_mode = PRD
uuid = d5bccb78-a2b2-4809-b036-ac7c7bfa7101
[compliance]
auto_update = true
schedule = @1440
[stats]
schedule = @60
[gcedisks]
scheduler = @120
Step 2 : Agent bootstrap
•
sudo nodemgr register --user my.self@corp.com
sudo nodemgr set --param node.uuid --value
d5bccb78-a2b2-4809-b036-ac7c7bfa7101
sudo nodemgr pushasset
sudo nodemgr pushdisks
sudo nodemgr pushpkg
sudo nodemgr pushpatch
sudo nodemgr checks
sudo nodemgr sysreport
Step 3 : Node configuration
sudo nodemgr compliance fix --attach --moduleset mariadb.node
sudo nodemgr compliance attach --moduleset mariadb.node
sudo nodemgr compliance check --moduleset mariadb.node
sudo nodemgr compliance fix --moduleset mariadb.node
Step 4 : Service deployment via agent template
docker_user [] > svar
subnet_cidr [10.0.0.0/24] >
backend_ips
[10.0.0.231,10.0.0.232,10.0.0.233] >
replication_manager_img
[tanji/replication-manager] >
ip_pod01 [10.0.0.229] >
mysql_root_password [mariadb] >
vip_netmask [10.0.0.1] >
ip_pod02 [10.0.0.230] >
port_r_lb [3308] >
subnet_name [spdnet] >
vip_addr [10.0.0.1] >
nodes [{nodename}] >
base_dir
[/Users/{env.docker_user}/{svcname}] >
maxscale_img [tanji/maxscale:keepalived] >
port_http [10001] >
port_rw [3306] >
port_rw_split [3307] >
Step 4 : Service deployment via collector
•
•
Step 4 : Service deployment
•
sudo svcmgr -s mysvc pull
•
sudo svcmgr -s mysvc provision
32
Q&A
Thank You
33

More Related Content

What's hot

Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1
PacSecJP
 

What's hot (19)

HA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedHA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and Keepalived
 
Load Balancing with HAproxy
Load Balancing with HAproxyLoad Balancing with HAproxy
Load Balancing with HAproxy
 
Using HAProxy to Scale MySQL
Using HAProxy to Scale MySQLUsing HAProxy to Scale MySQL
Using HAProxy to Scale MySQL
 
Introduction to Haproxy
Introduction to HaproxyIntroduction to Haproxy
Introduction to Haproxy
 
Load Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesLoad Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - Slides
 
Web Server Load Balancer
Web Server Load BalancerWeb Server Load Balancer
Web Server Load Balancer
 
How To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - SlidesHow To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - Slides
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validations
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1
 
Attacking http2 implementations (1)
Attacking http2 implementations (1)Attacking http2 implementations (1)
Attacking http2 implementations (1)
 
What is new in BIND 9.11?
What is new in BIND 9.11?What is new in BIND 9.11?
What is new in BIND 9.11?
 
Observability tips for HAProxy
Observability tips for HAProxyObservability tips for HAProxy
Observability tips for HAProxy
 
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our ServersHTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
HTTP/2, HTTP/3 and SSL/TLS State of the Art in Our Servers
 
ReplacingSquidWithATS
ReplacingSquidWithATSReplacingSquidWithATS
ReplacingSquidWithATS
 
Why Managed Service Providers Should Embrace Container Technology
Why Managed Service Providers Should Embrace Container TechnologyWhy Managed Service Providers Should Embrace Container Technology
Why Managed Service Providers Should Embrace Container Technology
 
Keeping DNS server up-and-running with “runit
Keeping DNS server up-and-running with “runitKeeping DNS server up-and-running with “runit
Keeping DNS server up-and-running with “runit
 
HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战
 
HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know? HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know?
 
H2O - the optimized HTTP server
H2O - the optimized HTTP serverH2O - the optimized HTTP server
H2O - the optimized HTTP server
 

Similar to MariaDB Replication manager and HAProxy (HAProxy Paris Meetup)

MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931
Baruch Osoveskiy
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 
Web scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannelWeb scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannel
purpleocean
 
Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)
Ontico
 

Similar to MariaDB Replication manager and HAProxy (HAProxy Paris Meetup) (20)

M|18 Under the Hood: Galera Cluster
M|18 Under the Hood: Galera ClusterM|18 Under the Hood: Galera Cluster
M|18 Under the Hood: Galera Cluster
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialBest practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
 
Meet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web SummitMeet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web Summit
 
MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 
MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
 
Data Streaming Ecosystem Management at Booking.com
Data Streaming Ecosystem Management at Booking.com Data Streaming Ecosystem Management at Booking.com
Data Streaming Ecosystem Management at Booking.com
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
Machine Learning and Logging for Monitoring Microservices
Machine Learning and Logging for Monitoring Microservices Machine Learning and Logging for Monitoring Microservices
Machine Learning and Logging for Monitoring Microservices
 
Devopstore
DevopstoreDevopstore
Devopstore
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Galera Cluster 3.0 Features
Galera Cluster 3.0 FeaturesGalera Cluster 3.0 Features
Galera Cluster 3.0 Features
 
Porting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability SystemsPorting Rails Apps to High Availability Systems
Porting Rails Apps to High Availability Systems
 
Web scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannelWeb scale infrastructures with kubernetes and flannel
Web scale infrastructures with kubernetes and flannel
 
Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)Maria db the new mysql (Colin Charles)
Maria db the new mysql (Colin Charles)
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
WSO2CON 2024 - Unlocking the Identity: Embracing CIAM 2.0 for a Competitive A...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 

MariaDB Replication manager and HAProxy (HAProxy Paris Meetup)

  • 3. 13.5 Billion year ago was nothing ! For backup and Point In Time recovery the BINARY LOGS was born
  • 4. Early after the replication was born in MySQL 3.23. Replicas track binlog files position and get notified for new events ! IO Thread for copying events SQL thread for applying events BINARY LOGS ARE CROSS ENGINES AND STATEMENT BASED
  • 5. But the story get more complex GOTCHA WITH BINARY LOGS DON’T SCALE FOR WRITES # FSYNC IS LIMITED ON DISK Workaround was not to sync bin logs making repli CRASH UNSAFE MariaDB Fixed it in 5.5 with TC + GROUP COMMIT
  • 6. WRITE PERFORMANCE IS BACK REPLICAS CRASH SAFE in 10.0 According to Facebook first implementation of google patch for group commit
  • 7. But the story get more complex NOW LEADER IS TO FAST REPLICAS CAN’T CATCH DON’T SCALE FOR WRITES Need Parallel Replication Workaround was using Tungsten replicator, Galera Group replication , implement prefetch events on slaves MariaDB Fixed it in 10.0 and improved it 10.1 with In order parallel replication and Optimistic Commit
  • 8. WRITE PERF IS BACK ON REPLICAS According to Booking slave group commits enable to go faster vs the workload x4 http://www.slideshare.net/JeanFranoisGagn/mysql-parallel-replication-inventory-usecase-and-limitations
  • 9. In the last microsecond of evolution ! REPLICATION BECOME CRASH SAFE AND REPLICAS CAN CATCH BINARY LOGS STILL NO GOOD FOR REPLICAS ELECTION
  • 10. But the story get more complex Replicas track position in files and not unique TX ID Need GTID Workaround: pseudo GTID, parse diff like MHA, TUNGSTEN or BINLOG server MariaDB 10.0 Fixed it without gotcha Domain ID - Server ID - Transaction seq # No downtime implementation
  • 11. But the story get more complex TRX on Leader not guaranteed to be on any replicas Fixing can be seen as regression ? Workaround: Galera , NDB cluster, MongoDB MariaDB 10.1 Not fixing only with Galera but improved Semi-Sync Google patches for parallel Semi-Sync with group commit
  • 12. In the last nanosecond of evolution ! MariaDB was feature ready for LEADER ELECTION and so was born Replication-Manager
  • 15. Failover - False Positive Detection
  • 19. Settings # REPLICATION #skip_slave_start = 1 plugin_load = "semisync_master.so;semisync_slave.so;sql_errlog.so" rpl_semi_sync_master = ON rpl_semi_sync_slave = ON loose_rpl_semi_sync_master_enabled = ON loose_rpl_semi_sync_slave_enabled = ON log_slave_updates = ON slave_parallel_mode = optimistic slave_domain_parallel_threads = %%ENV:NODES_CPU_CORES%% slave_parallel_threads = %%ENV:NODES_CPU_CORES%% relay_log = ./.system/repl/relay-bin relay_log_index = ./.system/repl/relay-bin.index relay_log_space_limit = 1G log_bin = ./.system/repl/mariadb-bin log_bin_index = ./.system/repl/mariadb-bin.index binlog_format = ROW binlog_checksum = 1 binlog_cache_size = 1M binlog_stmt_cache_size = 1M expire_logs_days = 5 sync_binlog = 1 replicate_annotate_row_events = 1 report_host='host_%%ENV:SERVER_ID%%' # TOPOLOGY hosts = "%%ENV:SVC_CONF_ENV_BACKEND_IPS%%" user = "root:%%ENV:SVC_CONF_ENV_MYSQL_ROOT_PASSWORD%%" rpluser = "root:%%ENV:SVC_CONF_ENV_MYSQL_ROOT_PASSWORD%%" # LOG logfile = "./dashboard/replication-manager.log" #verbose = true # HTTP & ALERTS http-server = true http-bind-address = "0.0.0.0" http-port = "%%ENV:SVC_CONF_ENV_PORT_HTTP%%" http-root = "./dashboard" mail-from = "mrm@localhost" mail-smtp-addr = "localhost:25" mail-to = "mrm@mariadb.com" # FAILOVER autorejoin = true readonly = true wait-kill = 5000 post-failover-script = "" pre-failover-script ="" # CHECK check-type = "tcp" failcount = 5 failover-limit = 3 failover-time-limit = 10 gtidcheck = true maxdelay = 30 # HA PROXY WRAPPER MODE # --------------------- haproxy = true haproxy-binary-path = "/usr/sbin/haproxy" haproxy-write-port= %%ENV:SVC_CONF_ENV_PORT_RW%% haproxy-read-port=%%ENV:SVC_CONF_ENV_PORT_R_LB%%
  • 20. Downloads • Source & Documentation • Roadmap and Features Management • Talk to us •
  • 24. Step 1 : User account bootstrap •
  • 25. Step 2 : Agent bootstrap • wget -O/tmp/opensvc.deb http://repo.opensvc.com/deb/current sudo dpkg -i /tmp/opensvc.deb • sudo nodemgr set --param node.repopkg --value http://repo.opensvc.com/ sudo nodemgr set --param node.repocomp --value http://repo.opensvc.com/compliance/ sudo nodemgr set --param node.dbopensvc --value https://collector.opensvc.com
  • 26. Step 2 : Agent bootstrap is generating a node conf file • [node] repopkg = http://repo.opensvc.com/ repocomp = http://repo.opensvc.com/compliance/ dbopensvc = https://collector.opensvc.com/feed/default/call/xmlrpc dbcompliance = https://collector.opensvc.com/init/compliance/call/xmlrpc host_mode = PRD uuid = d5bccb78-a2b2-4809-b036-ac7c7bfa7101 [compliance] auto_update = true schedule = @1440 [stats] schedule = @60 [gcedisks] scheduler = @120
  • 27. Step 2 : Agent bootstrap • sudo nodemgr register --user my.self@corp.com sudo nodemgr set --param node.uuid --value d5bccb78-a2b2-4809-b036-ac7c7bfa7101 sudo nodemgr pushasset sudo nodemgr pushdisks sudo nodemgr pushpkg sudo nodemgr pushpatch sudo nodemgr checks sudo nodemgr sysreport
  • 28. Step 3 : Node configuration sudo nodemgr compliance fix --attach --moduleset mariadb.node sudo nodemgr compliance attach --moduleset mariadb.node sudo nodemgr compliance check --moduleset mariadb.node sudo nodemgr compliance fix --moduleset mariadb.node
  • 29. Step 4 : Service deployment via agent template docker_user [] > svar subnet_cidr [10.0.0.0/24] > backend_ips [10.0.0.231,10.0.0.232,10.0.0.233] > replication_manager_img [tanji/replication-manager] > ip_pod01 [10.0.0.229] > mysql_root_password [mariadb] > vip_netmask [10.0.0.1] > ip_pod02 [10.0.0.230] > port_r_lb [3308] > subnet_name [spdnet] > vip_addr [10.0.0.1] > nodes [{nodename}] > base_dir [/Users/{env.docker_user}/{svcname}] > maxscale_img [tanji/maxscale:keepalived] > port_http [10001] > port_rw [3306] > port_rw_split [3307] >
  • 30. Step 4 : Service deployment via collector • •
  • 31. Step 4 : Service deployment • sudo svcmgr -s mysvc pull • sudo svcmgr -s mysvc provision