Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid,...

23
Openstack for MySQL DBA's Yves Trudeau September 2014

Transcript of Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid,...

Page 1: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL DBA's

Yves TrudeauSeptember 2014

Page 2: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Agenda

Part 1: MySQL for Openstack

• Planning• HA

Part 2: Openstack for MySQL

• Options• Performance• HA

2

Page 3: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack

3

Page 4: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : planning

Query load

• If Acid, commit #1, many empty commits

• Careful with keystone tokens if in database

– cron keystone-manage token_flush

• Updates to services/agents tables are frequent

4

Page 5: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : planning

Query load (cont.)

• Simplest cluster, ~7 QPS, small one ~15 QPS

• Many subqueries, best handled by 5.6.x

• Some poor queries (working on it)

• Some missing keys (working on it)

5

Page 6: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : planning

Database size

• The Openstack dataset is tiny

• Openstack deletes very few rows → cleanup

• You need a big cluster for 1GB+ data set.

6

Page 7: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : planning

Multiple data centers

• Really only keystone and maybe glance matters

• If you replicate glance, you need to replicate images

7

Page 8: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : HA solutions

PXC/Galera

• Preferred solution

• Needs HAProxy to connect to a good node

• Should ideally use one a at time

• Needs 3 nodes, 1 can be a garbd

8

Page 9: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : HA solutions

NDB

• I know... it is complex

• The fit is quite good, many small queries, tiny dataset

• All SQL nodes active, still need HAProxy or similar

9

Page 10: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : HA solutions

Pacemaker/PRM

• Replication based, some updates could be lost after failover

• One active MySQL master, accessed through a VIP

• After failover, MySQL is warm

• 3 Pacemaker nodes (1 can be standby)

11

Page 11: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : HA solutions

Multiple data centers, geo-DR

• Large Openstack cluster with PXC/Galera over WAN = commit latency

• Mixed solution, PXC local with replication (PRM) for wan would be best (*working on it)

12

Page 12: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

MySQL for Openstack : Summary

● Dataset size and load are moderate● PXC/Galera preferred scaling/HA● Multi-site → async replication OK

13

Page 13: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL

14

Page 14: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : options

Standalone/replication

• Obviously works...

• Suggest using fixed IP with a neutron port

15

Page 15: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : options

PXC/Galera

• Works also well

• Again, fixed IPs make setup easier

• No multicast

• Need a way to load balance to valid nodes

16

Page 16: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : options

PXC/Galera (cont.)

• If Cinder backend supports snapshot → new super fast SST method!

17

Page 17: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : options

NDB

• Works also well

• Again, fixed IPs make setup easier

• If SQL nodes are cohosted with the application nodes, no need to load balance

18

Page 18: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : options

Trove

• Interesting but new

• Setup is not an easy ride

• Only supports replication for now

• Galera support coming → Percona working on it

19

Page 19: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : Performance

Cinder backends

• LVM/iSCSI, SAN → You get what you have

• NFS → Not a big fan for MySQL

• GlusterFS → User space fuse driver :(

• Ceph → Complex but interesting + snapshots

20

Page 20: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : HA

MySQL HA considerations in Openstack

• No VIPs, a least not easily → spoofing prev.

• Floating IPs...

• HAProxy

• Pacemaker/Corosync udpu → iptables DNAT

21

Page 21: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : HA

MySQL HA considerations in Openstack (cont.)

• If cinder supports easy snapshots → custom SST for PXC

• Think about availability zone → per rack?

22

Page 22: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Openstack for MySQL : Summary

• Well known solutions work

• Trove is promising

• Backend choice is very important

• Fixed IPs with Neutron port ease the pain

23

Page 23: Openstack for MySQL DBA's - Percona · MySQL for Openstack : planning Query load • If Acid, commit #1, many empty commits • Careful with keystone tokens if in database – cron

Questions?

24