SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
© 2019 Percona1
Vinicius M. Grippa
Brothers in Arms: Using ProxySQL + PXC
Ensuring transparent high availability and scalability for your application
Support Engineer for MySQL / MongoDB
© 2019 Percona2
About Percona
▪ Solutions for your success with MySQL, MongoDB, and PostgreSQL
▪ Support, Consulting, Managed Services, and Software
▪ Our Software is 100% Open Source and Free
▪ Support Broad Ecosystem
▪ MySQL, MariaDB, Amazon RDS, and others
▪ In Business for 12 years
▪ More than 3000 customers, including top Internet companies and
enterprises
© 2019 Percona3
About me
▪ Support Engineer at Percona since 2017
▪ Working with MySQL for over 6 years
▪ Working with Databases for over 9 years
▪ Speaker at Percona Live
© 2019 Percona4
Percona XtraDB Cluster
© 2019 Percona5
Traditional MySQL replication
- Replication delay
- Switchover interval
- Single point of failure
- Data integrity problem
© 2019 Percona6
PXC/Galera
- All nodes can act as a master
- Data integrity
- Synchronous replication
- Read scalability
© 2019 Percona7
Automatic Node Provisioning
- Bootstrapping cluster
- SST (Snapshot State Transfer)
(rsync, xtrabackup, mysqldump)
- IST(incremental state transfer)
Auto-catchup cluster state
© 2019 Percona8
Workload Conflict
- Brute force abort
- Forceful abort of conflicting
transaction
- Certification failure
© 2019 Percona9
Flow Control
- Trx are queued. Queue full can cause
flow-control
- Dynamic Control of the workload
© 2019 Percona10
Cluster-safe-mode
- Workload that is not safe to the
cluster
- Pxc_strict_mode
(Enforcing,
Master,
Permissive,
Disabled)
© 2019 Percona11
Load Balancer
- PXC can operate with multiple load
balancers (HA Proxy, ProxySQL,
etc…)
- PXC suggests ProxySQL
- Integrated and close
development
- Feature rich load balancer
© 2019 Percona12
ProxySQL 2.0
© 2019 Percona13
ProxySQL Features
•Query Caching
•Query Routing
•Firewall
•Advanced configuration with 0 downtime
•ProxySQL cluster
•Open source :)
© 2019 Percona14
ProxySQL topology
© 2019 Percona15
ProxySQL topology
© 2019 Percona16
ProxySQL topology
© 2019 Percona17
ProxySQL 2.0
•ProxySQL v2.0 has native support for Galera Clustering (In previous versions of
ProxySQL an external scheduler was required to track the status of Galera nodes)
•Introduces mysql_galera_hostgroups and
mysql_server_galera_log tables
© 2019 Percona18
ProxySQL Configuration
© 2019 Percona19
ProxySQL Example
IPs
172.16.2.181 - node3
172.16.1.54 - node2
172.16.3.136 - node1
Hostgroups
Writer HG-> 100
Reader HG-> 101
BackupW HG-> 102
offHG HG-> 9101
© 2019 Percona20
ProxySQL Example
Servers first:
INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight)
VALUES ('172.16.2.181',101,3306,1000);
INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight)
VALUES ('172.16.1.54',101,3306,100);
INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight)
VALUES ('172.16.3.136',101,3306,100);
save mysql servers to disk;
load mysql servers to runtime;
© 2019 Percona21
ProxySQL Example
Creating user (it is necessary to create the user on PXC as well):
insert into mysql_users (username,
password,default_hostgroup) values ('app_test','app_test',
100);
load mysql users to runtime;
save mysql users from runtime;
save mysql users to disk;
© 2019 Percona22
ProxySQL Example
Creating Rules:
insert into mysql_query_rules
(rule_id,proxy_port,schemaname,username,destination_hostgroup,active,
retries,match_digest,apply)
values(1040,6033,'*','app_test',100,1,3,'^SELECT.*FOR UPDATE',1);
insert into mysql_query_rules
(rule_id,proxy_port,schemaname,username,destination_hostgroup,active,
retries,match_digest,apply)
values(1041,6033,'*','app_test',101,1,3,'^SELECT.*@@',1);
save mysql query rules to disk;
load mysql query rules to run;
© 2019 Percona23
ProxySQL Example
Then the galera settings:
insert into mysql_galera_hostgroups
(writer_hostgroup,backup_writer_hostgroup,reader_hostgroup,
offline_hostgroup,active,max_writers,writer_is_also_reader,ma
x_transactions_behind) values (100,102,101,9101,0,1,1,16);
# max_transactions_behind - determines the maximum number of writesets
behind the cluster that ProxySQL should allow before shunning the node to
prevent stale reads (this is determined by querying the
wsrep_local_recv_queue Galera variable).
© 2019 Percona24
ProxySQL Example
Setting version:
update global_variables set variable_value='5.7.25' where
variable_name='mysql-server_version';
LOAD MYSQL VARIABLES TO RUNTIME;SAVE MYSQL VARIABLES TO DISK;
© 2019 Percona25
ProxySQL Example
Create monitor user on MySQL and adjust on ProxySQL:
UPDATE global_variables SET variable_value='admin'WHERE
variable_name='mysql-monitor_username';
UPDATE global_variables SET variable_value='admin'WHERE
variable_name='mysql-monitor_password';
© 2019 Percona26
ProxySQL Example
PXC: admin@127.0.0.1 ((none)) > select * from
runtime_mysql_galera_hostgroups G
*************************** 1. row ***************************
writer_hostgroup: 100
backup_writer_hostgroup: 102
reader_hostgroup: 101
offline_hostgroup: 9101
active: 0 ← https://github.com/sysown/proxysql/issues/1902
max_writers: 1
writer_is_also_reader: 1
max_transactions_behind: 16
comment: NULL
1 row in set (0.01 sec)
© 2019 Percona27
ProxySQL+PXC Features
PXC: root@localhost ((none)) > set global pxc_maint_mode = maintenance;
# Sends a shutdown signal
$ systemctl stop mysqld
© 2019 Percona28
ProxySQL Features
PXC: admin@127.0.0.1 ((none)) > select hostgroup_id,hostname,status from
runtime_mysql_servers;
+--------------+--------------+---------+
| hostgroup_id | hostname | status |
+--------------+--------------+---------+
| 101 | 172.16.2.181 | ONLINE |
| 9101 | 172.16.1.54 | SHUNNED |
| 9101 | 172.16.3.136 | SHUNNED |
| 100 | 172.16.2.181 | ONLINE |
+--------------+--------------+---------+
4 rows in set (0.00 sec)
© 2019 Percona29
ProxySQL Features
© 2019 Percona30
Compile
yum install make cmake gcc gcc-c++ epel-release
https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm git wget zlib-devel openssl-devel
yum --disablerepo=mysql80-community --enablerepo=mysql57-community install mysql-community-libs-compat.x86_64
boost-devel.x86_64 mysql-community-devel
cd /usr/include/mysql
MYSQL_VERSION=$(rpm -qa | grep mysql-community-devel | awk -F'-' '{print $4}')
wget https://raw.githubusercontent.com/mysql/mysql-server/mysql-${MYSQL_VERSION}/include/hash.h
cd
git clone https://github.com/sysown/proxysql_mysqlbinlog.git
cd proxysql_mysqlbinlog
cd libslave/
cmake . && make
cd ..
ln -s /usr/lib64/mysql/libmysqlclient.a /usr/lib64/libmysqlclient.a
make
ProxySQL Features
© 2019 Percona31
Run
yum install epel-release
yum install boost-system
./proxysql_binlog_reader -h 127.0.0.1 -u root -psekret -P 3306 -l 3307 -L binlogreader.log
ProxySQL Features
© 2019 Percona32
PMM + ProxySQL + PXC
# ProxySQL
https://pmmdemo.percona.com/graph/d/fwWR9oiiz/proxysql-overview?refresh=1m&
orgId=1
#PXC
https://pmmdemo.percona.com/graph/d/s_k9wGNiz/pxc-galera-cluster-overview?refr
esh=1m&orgId=1
© 2019 Percona33
Questions?
© 2019 Percona34
© 2019 Percona35
● Write for our community blog
percona.com/community-blog
● Join in with our community forums
percona.com/forums
● Contribute to our open source projects
Join in: Percona Community
© 2019 Percona36
We are hiring!
● We are a remote first company
● Current EMEA roles: Database QA Engineer,
DevOps/QA Engineer, Golang and Kubernetes Software
Engineer, Senior MySQL DBA, C/C++ Software Engineer,
Solution Engineer, MongoDB Technical Lead, MySQL DBA,
UK Enterprise Sales, Director Marketing Communications,
Director Marketing Operations
● We offer $1000 for successful referrals
● See percona.com/careers for more info or talk to us today!
DATABASE PERFORMANCE
MATTERS
Database Performance MattersDatabase Performance MattersDatabase Performance MattersDatabase Performance Matters
Champions of Unbiased
Open Source Database Solutions

Contenu connexe

Tendances

Lab 10 instruction 2017
Lab 10 instruction   2017Lab 10 instruction   2017
Lab 10 instruction 2017trayyoo
 
Install elasticsearch, logstash and kibana
Install elasticsearch, logstash and kibana Install elasticsearch, logstash and kibana
Install elasticsearch, logstash and kibana Chanaka Lasantha
 
Percona Xtrabackup Best Practices
Percona Xtrabackup Best PracticesPercona Xtrabackup Best Practices
Percona Xtrabackup Best PracticesMarcelo Altmann
 
Whitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxWhitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxRoger Eisentrager
 
Site-to-Site IPSEC VPN Between Cisco ASA and Pfsense
Site-to-Site IPSEC VPN Between Cisco ASA and PfsenseSite-to-Site IPSEC VPN Between Cisco ASA and Pfsense
Site-to-Site IPSEC VPN Between Cisco ASA and PfsenseHarris Andrea
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyAmit Aggarwal
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB ClusterFrederic Descamps
 
[OpenStack 하반기 스터디] HA using DVR
[OpenStack 하반기 스터디] HA using DVR[OpenStack 하반기 스터디] HA using DVR
[OpenStack 하반기 스터디] HA using DVROpenStack Korea Community
 
Redis学习笔记
Redis学习笔记Redis学习笔记
Redis学习笔记yongboy
 
Mysql Fun
Mysql FunMysql Fun
Mysql FunSHC
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXNGINX, Inc.
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX, Inc.
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX, Inc.
 
Mysql master slave setup
Mysql master slave setupMysql master slave setup
Mysql master slave setupARUN SUNDAR B
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库maclean liu
 
NAT with ASA & ASA Security Context
NAT with ASA & ASA Security ContextNAT with ASA & ASA Security Context
NAT with ASA & ASA Security ContextNetProtocol Xpert
 
Rate Limiting with NGINX and NGINX Plus
Rate Limiting with NGINX and NGINX PlusRate Limiting with NGINX and NGINX Plus
Rate Limiting with NGINX and NGINX PlusNGINX, Inc.
 
Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501robertguerra
 

Tendances (20)

Lab 10 instruction 2017
Lab 10 instruction   2017Lab 10 instruction   2017
Lab 10 instruction 2017
 
Install elasticsearch, logstash and kibana
Install elasticsearch, logstash and kibana Install elasticsearch, logstash and kibana
Install elasticsearch, logstash and kibana
 
Percona Xtrabackup Best Practices
Percona Xtrabackup Best PracticesPercona Xtrabackup Best Practices
Percona Xtrabackup Best Practices
 
Whitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxWhitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on Linux
 
Site-to-Site IPSEC VPN Between Cisco ASA and Pfsense
Site-to-Site IPSEC VPN Between Cisco ASA and PfsenseSite-to-Site IPSEC VPN Between Cisco ASA and Pfsense
Site-to-Site IPSEC VPN Between Cisco ASA and Pfsense
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
 
Query logging with proxysql
Query logging with proxysqlQuery logging with proxysql
Query logging with proxysql
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
 
[OpenStack 하반기 스터디] HA using DVR
[OpenStack 하반기 스터디] HA using DVR[OpenStack 하반기 스터디] HA using DVR
[OpenStack 하반기 스터디] HA using DVR
 
Redis学习笔记
Redis学习笔记Redis学习笔记
Redis学习笔记
 
Mysql Fun
Mysql FunMysql Fun
Mysql Fun
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
 
Mysql master slave setup
Mysql master slave setupMysql master slave setup
Mysql master slave setup
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
 
NAT with ASA & ASA Security Context
NAT with ASA & ASA Security ContextNAT with ASA & ASA Security Context
NAT with ASA & ASA Security Context
 
OTRS
OTRSOTRS
OTRS
 
Rate Limiting with NGINX and NGINX Plus
Rate Limiting with NGINX and NGINX PlusRate Limiting with NGINX and NGINX Plus
Rate Limiting with NGINX and NGINX Plus
 
Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501
 

Similaire à Proxy SQL 2.0 with PXC

Deploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftDeploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftAlexander Rubin
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19Alkin Tezuysal
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...Geir Høydalsvik
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQLI Goo Lee
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?Alkin Tezuysal
 
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 FebMysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 FebAlkin Tezuysal
 
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Big Data Spain
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18Derek Downey
 
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim TkachenkoNoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim TkachenkoData Con LA
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...NETWAYS
 
PartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC SolutionPartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC SolutionTimothy Spann
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - WebinarAlkin Tezuysal
 
stackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsev
stackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsevstackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsev
stackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter ZaitsevNETWAYS
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX, Inc.
 
Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast SlidesOracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast SlidesLudovico Caldara
 
CISCO - Presentation at Hortonworks Booth - Strata 2014
CISCO - Presentation at Hortonworks Booth - Strata 2014CISCO - Presentation at Hortonworks Booth - Strata 2014
CISCO - Presentation at Hortonworks Booth - Strata 2014Hortonworks
 

Similaire à Proxy SQL 2.0 with PXC (20)

Deploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftDeploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in Openshift
 
Guob - MySQL e LGPD
Guob - MySQL e LGPDGuob - MySQL e LGPD
Guob - MySQL e LGPD
 
ProxySQL para mysql
ProxySQL para mysqlProxySQL para mysql
ProxySQL para mysql
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
 
Intro ProxySQL
Intro ProxySQLIntro ProxySQL
Intro ProxySQL
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 FebMysql 8 vs Mariadb 10.4 Webinar 2020 Feb
Mysql 8 vs Mariadb 10.4 Webinar 2020 Feb
 
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
Securing Big Data at rest with encryption for Hadoop, Cassandra and MongoDB o...
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim TkachenkoNoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
 
PartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC SolutionPartnerSkillUp_Enable a Streaming CDC Solution
PartnerSkillUp_Enable a Streaming CDC Solution
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - Webinar
 
stackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsev
stackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsevstackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsev
stackconf 2020 | The Path to OpenSource DBaaS with Kubernetes by Peter Zaitsev
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEA
 
Percona Server 8.0
Percona Server 8.0Percona Server 8.0
Percona Server 8.0
 
Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013Stackato Presentation Techzone 2013
Stackato Presentation Techzone 2013
 
Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast SlidesOracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
 
CISCO - Presentation at Hortonworks Booth - Strata 2014
CISCO - Presentation at Hortonworks Booth - Strata 2014CISCO - Presentation at Hortonworks Booth - Strata 2014
CISCO - Presentation at Hortonworks Booth - Strata 2014
 

Plus de Vinicius M Grippa

MySQL up and running 30 minutes.pdf
MySQL up and running 30 minutes.pdfMySQL up and running 30 minutes.pdf
MySQL up and running 30 minutes.pdfVinicius M Grippa
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxVinicius M Grippa
 
MySQL backup and restore performance
MySQL backup and restore performanceMySQL backup and restore performance
MySQL backup and restore performanceVinicius M Grippa
 
Moving mongo db to the cloud strategies and points to consider
Moving mongo db to the cloud  strategies and points to considerMoving mongo db to the cloud  strategies and points to consider
Moving mongo db to the cloud strategies and points to considerVinicius M Grippa
 
Cpu analysis with flamegraphs
Cpu analysis with flamegraphsCpu analysis with flamegraphs
Cpu analysis with flamegraphsVinicius M Grippa
 
Percona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityPercona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityVinicius M Grippa
 

Plus de Vinicius M Grippa (8)

MySQL up and running 30 minutes.pdf
MySQL up and running 30 minutes.pdfMySQL up and running 30 minutes.pdf
MySQL up and running 30 minutes.pdf
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptx
 
MySQL backup and restore performance
MySQL backup and restore performanceMySQL backup and restore performance
MySQL backup and restore performance
 
Moving mongo db to the cloud strategies and points to consider
Moving mongo db to the cloud  strategies and points to considerMoving mongo db to the cloud  strategies and points to consider
Moving mongo db to the cloud strategies and points to consider
 
Cpu analysis with flamegraphs
Cpu analysis with flamegraphsCpu analysis with flamegraphs
Cpu analysis with flamegraphs
 
Percona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityPercona Live 2019 - MySQL Security
Percona Live 2019 - MySQL Security
 
K8s - Setting up minikube
K8s  - Setting up minikubeK8s  - Setting up minikube
K8s - Setting up minikube
 
Enhancing MySQL Security
Enhancing MySQL SecurityEnhancing MySQL Security
Enhancing MySQL Security
 

Dernier

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Dernier (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Proxy SQL 2.0 with PXC

  • 1. © 2019 Percona1 Vinicius M. Grippa Brothers in Arms: Using ProxySQL + PXC Ensuring transparent high availability and scalability for your application Support Engineer for MySQL / MongoDB
  • 2. © 2019 Percona2 About Percona ▪ Solutions for your success with MySQL, MongoDB, and PostgreSQL ▪ Support, Consulting, Managed Services, and Software ▪ Our Software is 100% Open Source and Free ▪ Support Broad Ecosystem ▪ MySQL, MariaDB, Amazon RDS, and others ▪ In Business for 12 years ▪ More than 3000 customers, including top Internet companies and enterprises
  • 3. © 2019 Percona3 About me ▪ Support Engineer at Percona since 2017 ▪ Working with MySQL for over 6 years ▪ Working with Databases for over 9 years ▪ Speaker at Percona Live
  • 4. © 2019 Percona4 Percona XtraDB Cluster
  • 5. © 2019 Percona5 Traditional MySQL replication - Replication delay - Switchover interval - Single point of failure - Data integrity problem
  • 6. © 2019 Percona6 PXC/Galera - All nodes can act as a master - Data integrity - Synchronous replication - Read scalability
  • 7. © 2019 Percona7 Automatic Node Provisioning - Bootstrapping cluster - SST (Snapshot State Transfer) (rsync, xtrabackup, mysqldump) - IST(incremental state transfer) Auto-catchup cluster state
  • 8. © 2019 Percona8 Workload Conflict - Brute force abort - Forceful abort of conflicting transaction - Certification failure
  • 9. © 2019 Percona9 Flow Control - Trx are queued. Queue full can cause flow-control - Dynamic Control of the workload
  • 10. © 2019 Percona10 Cluster-safe-mode - Workload that is not safe to the cluster - Pxc_strict_mode (Enforcing, Master, Permissive, Disabled)
  • 11. © 2019 Percona11 Load Balancer - PXC can operate with multiple load balancers (HA Proxy, ProxySQL, etc…) - PXC suggests ProxySQL - Integrated and close development - Feature rich load balancer
  • 13. © 2019 Percona13 ProxySQL Features •Query Caching •Query Routing •Firewall •Advanced configuration with 0 downtime •ProxySQL cluster •Open source :)
  • 17. © 2019 Percona17 ProxySQL 2.0 •ProxySQL v2.0 has native support for Galera Clustering (In previous versions of ProxySQL an external scheduler was required to track the status of Galera nodes) •Introduces mysql_galera_hostgroups and mysql_server_galera_log tables
  • 18. © 2019 Percona18 ProxySQL Configuration
  • 19. © 2019 Percona19 ProxySQL Example IPs 172.16.2.181 - node3 172.16.1.54 - node2 172.16.3.136 - node1 Hostgroups Writer HG-> 100 Reader HG-> 101 BackupW HG-> 102 offHG HG-> 9101
  • 20. © 2019 Percona20 ProxySQL Example Servers first: INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight) VALUES ('172.16.2.181',101,3306,1000); INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight) VALUES ('172.16.1.54',101,3306,100); INSERT INTO mysql_servers (hostname,hostgroup_id,port,weight) VALUES ('172.16.3.136',101,3306,100); save mysql servers to disk; load mysql servers to runtime;
  • 21. © 2019 Percona21 ProxySQL Example Creating user (it is necessary to create the user on PXC as well): insert into mysql_users (username, password,default_hostgroup) values ('app_test','app_test', 100); load mysql users to runtime; save mysql users from runtime; save mysql users to disk;
  • 22. © 2019 Percona22 ProxySQL Example Creating Rules: insert into mysql_query_rules (rule_id,proxy_port,schemaname,username,destination_hostgroup,active, retries,match_digest,apply) values(1040,6033,'*','app_test',100,1,3,'^SELECT.*FOR UPDATE',1); insert into mysql_query_rules (rule_id,proxy_port,schemaname,username,destination_hostgroup,active, retries,match_digest,apply) values(1041,6033,'*','app_test',101,1,3,'^SELECT.*@@',1); save mysql query rules to disk; load mysql query rules to run;
  • 23. © 2019 Percona23 ProxySQL Example Then the galera settings: insert into mysql_galera_hostgroups (writer_hostgroup,backup_writer_hostgroup,reader_hostgroup, offline_hostgroup,active,max_writers,writer_is_also_reader,ma x_transactions_behind) values (100,102,101,9101,0,1,1,16); # max_transactions_behind - determines the maximum number of writesets behind the cluster that ProxySQL should allow before shunning the node to prevent stale reads (this is determined by querying the wsrep_local_recv_queue Galera variable).
  • 24. © 2019 Percona24 ProxySQL Example Setting version: update global_variables set variable_value='5.7.25' where variable_name='mysql-server_version'; LOAD MYSQL VARIABLES TO RUNTIME;SAVE MYSQL VARIABLES TO DISK;
  • 25. © 2019 Percona25 ProxySQL Example Create monitor user on MySQL and adjust on ProxySQL: UPDATE global_variables SET variable_value='admin'WHERE variable_name='mysql-monitor_username'; UPDATE global_variables SET variable_value='admin'WHERE variable_name='mysql-monitor_password';
  • 26. © 2019 Percona26 ProxySQL Example PXC: admin@127.0.0.1 ((none)) > select * from runtime_mysql_galera_hostgroups G *************************** 1. row *************************** writer_hostgroup: 100 backup_writer_hostgroup: 102 reader_hostgroup: 101 offline_hostgroup: 9101 active: 0 ← https://github.com/sysown/proxysql/issues/1902 max_writers: 1 writer_is_also_reader: 1 max_transactions_behind: 16 comment: NULL 1 row in set (0.01 sec)
  • 27. © 2019 Percona27 ProxySQL+PXC Features PXC: root@localhost ((none)) > set global pxc_maint_mode = maintenance; # Sends a shutdown signal $ systemctl stop mysqld
  • 28. © 2019 Percona28 ProxySQL Features PXC: admin@127.0.0.1 ((none)) > select hostgroup_id,hostname,status from runtime_mysql_servers; +--------------+--------------+---------+ | hostgroup_id | hostname | status | +--------------+--------------+---------+ | 101 | 172.16.2.181 | ONLINE | | 9101 | 172.16.1.54 | SHUNNED | | 9101 | 172.16.3.136 | SHUNNED | | 100 | 172.16.2.181 | ONLINE | +--------------+--------------+---------+ 4 rows in set (0.00 sec)
  • 30. © 2019 Percona30 Compile yum install make cmake gcc gcc-c++ epel-release https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm git wget zlib-devel openssl-devel yum --disablerepo=mysql80-community --enablerepo=mysql57-community install mysql-community-libs-compat.x86_64 boost-devel.x86_64 mysql-community-devel cd /usr/include/mysql MYSQL_VERSION=$(rpm -qa | grep mysql-community-devel | awk -F'-' '{print $4}') wget https://raw.githubusercontent.com/mysql/mysql-server/mysql-${MYSQL_VERSION}/include/hash.h cd git clone https://github.com/sysown/proxysql_mysqlbinlog.git cd proxysql_mysqlbinlog cd libslave/ cmake . && make cd .. ln -s /usr/lib64/mysql/libmysqlclient.a /usr/lib64/libmysqlclient.a make ProxySQL Features
  • 31. © 2019 Percona31 Run yum install epel-release yum install boost-system ./proxysql_binlog_reader -h 127.0.0.1 -u root -psekret -P 3306 -l 3307 -L binlogreader.log ProxySQL Features
  • 32. © 2019 Percona32 PMM + ProxySQL + PXC # ProxySQL https://pmmdemo.percona.com/graph/d/fwWR9oiiz/proxysql-overview?refresh=1m& orgId=1 #PXC https://pmmdemo.percona.com/graph/d/s_k9wGNiz/pxc-galera-cluster-overview?refr esh=1m&orgId=1
  • 35. © 2019 Percona35 ● Write for our community blog percona.com/community-blog ● Join in with our community forums percona.com/forums ● Contribute to our open source projects Join in: Percona Community
  • 36. © 2019 Percona36 We are hiring! ● We are a remote first company ● Current EMEA roles: Database QA Engineer, DevOps/QA Engineer, Golang and Kubernetes Software Engineer, Senior MySQL DBA, C/C++ Software Engineer, Solution Engineer, MongoDB Technical Lead, MySQL DBA, UK Enterprise Sales, Director Marketing Communications, Director Marketing Operations ● We offer $1000 for successful referrals ● See percona.com/careers for more info or talk to us today!
  • 37. DATABASE PERFORMANCE MATTERS Database Performance MattersDatabase Performance MattersDatabase Performance MattersDatabase Performance Matters Champions of Unbiased Open Source Database Solutions