Hands On Trove: Database as a Service in OpenStack

5,927 views
5,832 views

Published on

A quick introduction to Trove, the Database-as-a-Service subsystem in OpenStack. Presented at Percona Live 2014.

Published in: Technology

Hands On Trove: Database as a Service in OpenStack

  1. 1. HX111 OpenStack Database as a Service Version 12c1c1e Copyright © 2014 hastexo Professional Services GmbH
  2. 2. An Introduction to Database-as-a- Service HX111 OpenStack Database as a Service
  3. 3. FROM IAAS TO PAAS "A step up the stack" HX111.1 An Introduction to Database-as-a-Service
  4. 4. EVERYONE NEEDS A DATABASE... Well, almost everyone. HX111.1 An Introduction to Database-as-a-Service
  5. 5. ... BUT DOES EVERYONE NEED TO BUILD THEIR OWN? • Platform/Distribution Support • System Tuning Idiosyncrasies • Flavors, Forks, Branches HX111.1 An Introduction to Database-as-a-Service
  6. 6. WHAT'S SPECIAL ABOUT THE CLOUD? • Little to no control over infrastructure • Everything is virtualized and orchestrated • QoS is limited HX111.1 An Introduction to Database-as-a-Service
  7. 7. ONE APPROACH The DBA now becomes a cloud operator. But that's rather undesirable. HX111.1 An Introduction to Database-as-a-Service
  8. 8. THE ALTERNATIVE: DBAAS Provides a database as a service HX111.1 An Introduction to Database-as-a-Service
  9. 9. PRECEDENT: AMAZON RDS Reliable Database Service: DBaaS for Amazon Web Services HX111.1 An Introduction to Database-as-a-Service
  10. 10. An Introduction to OpenStack Trove HX111 OpenStack Database as a Service
  11. 11. MOTIVATION Provide DBaaS within the OpenStack framework HX111.2 An Introduction to OpenStack Trove
  12. 12. A BIT OF PROJECT HISTORY • Originally named Reddwarf (alternatively RedDwarf) • First public presentation at Percona Live 2012 by Brian Aker • Renamed Trove in 2013 HX111.2 An Introduction to OpenStack Trove
  13. 13. RELEASE HISTORY • Incubated until Havana release (October 2013) • Graduated shortly before Icehouse Summit • Integrated in Icehouse release (April 2014) HX111.2 An Introduction to OpenStack Trove
  14. 14. CONTRIBUTORS AND SUPPORTERS • Original project sponsor: Hewlett-Packard • Current major backers: eBay, HP, Rackspace • More than 75 individual contributors • Current PTL: Michael Basnight, Rackspace HX111.2 An Introduction to OpenStack Trove
  15. 15. Trove's Moving Parts HX111 OpenStack Database as a Service
  16. 16. MULTIPLE MANAGEABLE PIECES OpenStack Abhors A Monolith HX111.3 Trove's Moving Parts
  17. 17. WHAT TROVE BUILDS UPON • Keystone: authentication, authorization, access control • Nova: compute • Cinder: persistent storage • Neutron or nova-network: networking HX111.3 Trove's Moving Parts
  18. 18. WHAT TROVE CONSISTS OF • trove-api: ReSTful API service • trove-taskmanager: implements API service calls and fires up guest • trove-guestagent: configures guest for datastore use HX111.3 Trove's Moving Parts
  19. 19. TROVE TERMINOLOGY • Datastore • Datastore version • Instance • Configuration Group • Database HX111.3 Trove's Moving Parts
  20. 20. DATASTORE A specific RDBMS or NoSQL datastore that Trove can manage: • MySQL • MongoDB • Cassandra • ... HX111.3 Trove's Moving Parts
  21. 21. DATASTORE VERSION • Is linked to datastore • Defines base image • Defines sets of packages to be installed HX111.3 Trove's Moving Parts
  22. 22. INSTANCE • Is one incarnation of a datastore version • Is managed by Nova and uses persistent volumes managed in Cinder • Runs a full OS plus trove-guestagent HX111.3 Trove's Moving Parts
  23. 23. CONFIGURATION GROUP • A set of configuration options you can set for an instance • Enables admins to define and use best-practice configurations for specific use cases HX111.3 Trove's Moving Parts
  24. 24. DATABASES • Several can run in one instance • All database management is through OpenStack APIs and trove-guestagent HX111.3 Trove's Moving Parts
  25. 25. GETTING TROVE OPERATIONAL • Install required OpenStack services • Install Trove services • Prepare an image • Create a datastore • Create a datastore version HX111.3 Trove's Moving Parts
  26. 26. DEPLOYING TROVE • Low maturity • DevStack/Redstack • Ubuntu packages in trusty (but not in Cloud Archive) • Only client packages in RDO • Puppet modules being worked on at eBay HX111.3 Trove's Moving Parts
  27. 27. Working With Trove HX111 OpenStack Database as a Service
  28. 28. GETTING STARTED So we've installed Trove. What's Next? HX111.4 Working With Trove
  29. 29. LISTING DATASTORES trove datastore -list Lists currently configured datastores HX111.4 Working With Trove
  30. 30. LISTING VERSIONS FOR A DATASTORE trove datastore -version -list <datastore -name> Lists currently configured versions for a datastore HX111.4 Working With Trove
  31. 31. GETTING DETAILS FOR A DATASTORE VERSION trove datastore -version -show --datastore <name> <version -id> HX111.4 Working With Trove
  32. 32. CREATING A DATASTORE trove-manage datastore_update "<name >" "" HX111.4 Working With Trove
  33. 33. CREATING A DATASTORE VERSION trove-manage datastore_version_update "<name >" "<versionname >" "<type >" "<imageid >" "<packagelist >" {0|1} HX111.4 Working With Trove
  34. 34. SETTING A DEFAULT VERSION FOR A DATASTORE trove-manage datastore_update "<name >" "<versionname >" HX111.4 Working With Trove
  35. 35. CREATING AN INSTANCE trove create <instancename > <flavor > --size <size> --datastore <name> --datastore_version <versionname > --nic net-id=<net-id> HX111.4 Working With Trove
  36. 36. WHAT DOES TROVE CREATE DO? • Allocate persistent storage space (through Cinder) • Create a new guest (through Nova) HX111.4 Working With Trove
  37. 37. WHAT HAPPENS WHEN THE INSTANCE BOOTS? • cloud-init (as always) • trove-guestagent HX111.4 Working With Trove
  38. 38. LISTING CONFIGURED INSTANCES trove list HX111.4 Working With Trove
  39. 39. GETTING DETAILS FOR AN INSTANCE trove show <instanceid > HX111.4 Working With Trove
  40. 40. LISTING DATABASES IN AN INSTANCE trove database -list <instanceid > HX111.4 Working With Trove
  41. 41. CREATING A DATABASE trove database -create <instanceid > <dbname > HX111.4 Working With Trove
  42. 42. CREATING A USER AND ENABLING DATABASE ACCESS trove user-create <instanceid > <username > <password > [--host=<host >] [--databases=<db1>,<db2>,...] HX111.4 Working With Trove
  43. 43. GRANTING USER ACCESS trove user-grant-access <instanceid > <username > <password > <db1>,<db2>,... [--host=<host >] HX111.4 Working With Trove
  44. 44. ENABLING ROOT ACCESS trove root-enable <instanceid > HX111.4 Working With Trove
  45. 45. CONFIGURATION GROUPS Configuration groups allow DBAs to set configuration options, in bulk, on one or multiple databases HX111.4 Working With Trove
  46. 46. CREATING A CONFIGURATION GROUP trove configuration -create <name> '{ <values > }' [--description <description >] HX111.4 Working With Trove
  47. 47. SETTING PARAMETERS Parameters are a JSON dictionary { "<key>": "<string >", "<key>": <int>, ... } HX111.4 Working With Trove
  48. 48. LISTING SUPPORTED CONFIGURATION PARAMETERS trove configuration -parameter -list <datastore -version -id> HX111.4 Working With Trove
  49. 49. ATTACHING A CONFIGURATION GROUP TO AN INSTANCE trove configuration -attach <configuration -group-id> <instance -id> HX111.4 Working With Trove
  50. 50. DETACHING A CONFIGURATION GROUP FROM AN INSTANCE trove configuration -detach <instance -id> HX111.4 Working With Trove
  51. 51. MODIFYING A CONFIGURATION GROUP ON THE FLY trove configuration -patch <configuration -group-id> '{ <values > }' HX111.4 Working With Trove
  52. 52. FINDING INSTANCES FOR A CONFIGURATION GROUP trove configuration -instances <configuration -group-id> HX111.4 Working With Trove
  53. 53. DELETING A CONFIGURATION GROUP trove configuration -delete <configuration -group-id> HX111.4 Working With Trove
  54. 54. Summary HX111 OpenStack Database as a Service
  55. 55. WHAT YOU LEARNED TODAY Why DBaas? • A step up the stack • Almost everyone needs a database • Cloud shifts control over infrastructure away from DBA HX111.5 Summary
  56. 56. WHAT YOU LEARNED TODAY What's Trove? • DBaaS within the OpenStack Framework • Originally "Red Dwarf" • Integrated for Icehouse • Backed by HP, Rackspace, eBay, Tesora HX111.5 Summary
  57. 57. WHAT YOU LEARNED TODAY Trove's Moving Parts • Builds on OpenStack Nova, Glance, Neutron, Cinder • Contains API, task manager, guest agent • Datastores, Versions, Instances, Databases • Deployment Considerations HX111.5 Summary
  58. 58. WHAT YOU LEARNED TODAY Working with Trove • Creating an instance • Creating a database • Assigning users and granting permissions • Using configuration groups HX111.5 Summary

×