immutable database infrastructure with pxc
play

Immutable Database Infrastructure with PXC Satoshi Mitani | @mita2 - PowerPoint PPT Presentation

Immutable Database Infrastructure with PXC Satoshi Mitani | @mita2 Yahoo Japan Corporation Agenda Yahoo! JAPAN Introduction Demo What is Immutable Infrastructure Architecture Why Percona XtraDB Cluster Disadvantages of


  1. Immutable Database Infrastructure with PXC Satoshi Mitani | @mita2 Yahoo Japan Corporation

  2. Agenda • Yahoo! JAPAN Introduction • Demo • What is Immutable Infrastructure • Architecture • Why Percona XtraDB Cluster • Disadvantages of our method • Q&A 2

  3. Yahoo! JAPAN Introduction

  4. Yahoo! JAPAN Introduction 4

  5. Daily Unique Browser 90+ Million Daily Unique Browser (Only Smartphone) 60+ Million Monthly Page Views 70+ Billion Number of services 100+ Yahoo! JAPAN Introduction

  6. Demo

  7. Demo • Our steps to release new software 1. Take the node offline 2. Rebuild the node with image including new software 3. Bring the node back online

  8. What is Immutable Infrastructure?

  9. Legacy infrastructure (Mutable) SoftA SoftB SoftB SoftA • Accumulated changes • Long life-span v.1.0 v.1.0 v.2.0 v.2.0 • Advantage v.1.1 • Existing Infrastructure • Persistent v.2.1 v.2.1 • Disadvantage • Need to track states v.1.2 v.2.2 v.2.2 • Need to upgrade perfectly • Difficult to test all combinations Server A Server B

  10. Immutable Infrastructure • Does not change after creation SoftB SoftA • Disposable v.1.0 v.2.0 • Replace servers to release new features • Short life-span SoftA SoftB v.1.1 v.2.1 • Advantage. • Always fresh • Less combinations SoftA SoftB • Disadvantage v.1.2 v.2.2 • Volatile

  11. Why do we need Immutable Infrastructure? • huge number of DBs • hard to track state • hard to test all combination 12

  12. Architecture

  13. Architecture overview Chef recipes GitHub Enterprise Image Repo IaaS API Screwdriver.cd Config Backup (CI System) Storage IaaS API my.cnf Golden etc… � � Image VM Databases on IaaS Image factory

  14. Architecture – Image factory • Golden Image Chef recipes • Include all software • PXC GitHub Enterprise • Prometheus Screwdriver.cd • Fluentd (CI System) • etc.. IaaS API Golden Image VM Image factory

  15. Architecture – Image factory 1. Update Chef recipe yum_package ['Percona-XtraDB-Cluster-' + pxc_pkg_version, Chef 'Percona-XtraDB-Cluster-shared-' + pxc_pkg_version] do recipes version [pxc_version, pxc_version] action [:install, :lock] GitHub Enterprise options '--enablerepo="percona-release"' end1 Screwdriver.cd cookbook_file (CI System) "/etc/systemd/system/mysql.service.d/override.conf" do source 'etc/systemd/system/mysqld.service.d/override.conf' mode 00444 IaaS API owner 'root' group 'root' Golden end Image VM Image factory

  16. Architecture – Image factory • chef-client local mode Chef recipes • No workstation • No server GitHub Enterprise 2. Boot new VM 3. Run chef-client Screwdriver.cd (CI System) IaaS API $ sudo chef-client –z –r “role[some-role]” Golden Image VM Image factory

  17. Architecture – Image factory • Snapshot VM Chef recipes GitHub Enterprise 4. Create Snapshot Screwdriver.cd (CI System) IaaS API Golden Image VM Image factory

  18. Architecture – Image factory • Tests • Based on new Golden Image Chef recipes • Creating new Database Cluster • Monitoring Process GitHub Enterprise • Load Balancing • etc… Screwdriver.cd • Tests are covered by our own python scripts (CI System) • Fabric IaaS API Golden Image VM Image factory 5. Tests

  19. Architecture - Database • Re-imaging clears all data • MySQL configuration • OS configuration • MySQL data Image Repo IaaS API • etc.. Config Backup Storage • MySQL configuration files • Other OS configuration files • network-scripts/if-cfg, /etc/hosts etc.. my.cnf • Generated automatically by IaaS etc… � � Database

  20. Architecture - Database 6. Rebuild • Database consists of 3 nodes • Re-imaging the node one by one my.cnf Image Repo etc… • To avoid downtime IaaS API Config Backup Storage • Pass the backed up config file to rebuild OpenStack IaaS API my.cnf etc… � � Database

  21. Why Percona XtraDB Cluster

  22. Our maintenance requirements • No downtime • Anytime, without scheduling

  23. Percona XtraDB Cluster (PXC) • MySQL compatible High-availability solution • Multi-writer • Galera replication • Automatic data recovery • State Snapshot Transfer (SST) 24

  24. Zero-downtime maintenance • Taking node offine before re-imaging • Wait for all client connections move to others • Possible write across the nodes • PXC supports multi-writer App App App

  25. SST - Automatic data recovery • All data cleared by re-imaging • State Snapshot Transfer • full data copy from one node to the joining node Joining node

  26. Disadvantages of our method

  27. SST Problem (1) 1. SST compatibility issue between 5.7.22 and before 5.7.21 • If you have TDE tables (ENCRYPTION=Y) • Need to upgrade all node before SST 2. SST failed with TDE and Compressed Table • ENCRYPTION=Y, ROW_FORMAT=COMPRESSED • Will be fixed in next Percona XtraBackup release 2.4.15 • https://jira.percona.com/browse/PXB-1867

  28. SST Problem (2) 3. SST blocks DDL Not a bug ! • • xtrabackup runs with –lock-ddl for safety • App with frequent DDL faces this problem

  29. Disadvantage of our method • PXC has some limitations • Deploy takes much time • Emergency release by manual operation • Limited volume • Large data cause long SST • We limited < 500GB

  30. Q&A

  31. Thank you

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend