MySQL administration in Amazon RDS

3,604 views

Published on

This is a great session for those new to this this tooll. PalominoDB's Ben Black will cover common tasks in RDS and gotchas for DBA's that are new to RDS.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,604
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
39
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

MySQL administration in Amazon RDS

  1. 1. MySQL administration inAmazon RDSPALOMINODBOPERATIONAL EXCELLENCEFOR DATABASESBen Blackwww.palominodb.com
  2. 2. What is RDS"Amazon Relational Database Service is aweb service that makes it easy to set up,operate, and scale a relational database inthe cloud."
  3. 3. Why use RDS1) Easy to set up2) Flexibility/Scalability/Pay as you go3) Easy to create replicas4) Multiple AZ5) Easy Admin/backups
  4. 4. Create an RDS instance
  5. 5. Create an RDS instance
  6. 6. Create an RDS instance
  7. 7. Security Group setup
  8. 8. Parameter Group Setup
  9. 9. Parameter Group Setup
  10. 10. Parameter Group Setup
  11. 11. Anyone have pointyclicky rage yet?
  12. 12. rds-cliDownload rds cli tools from amazon, unzip, and create asymlinkvi /home/bblack/rdscredsAWSAccessKeyId=<DELETED>AWSSecretKey=<DELETED>chmod 600 /home/bblack/rdscredsAdd to .bashrcexport AWS_RDS_HOME=/home/bblack/RDSCliexport AWS_CREDENTIAL_FILE=/home/bblack/rdscreds
  13. 13. rds-clirds-create-db-instancerds-create-db-instance-read-replicards-modify-db-instancerds-modify-db-parameter-grouprds-describe-db-instancesrds-reboot-db-instance
  14. 14. rds-clirds-modify-db-parameter-group dev-pg --parameters="name=sql_mode,value=STRICT_TRANS_TABLES,method=immediate""{TrueIfReplica}"
  15. 15. Limitationssync_binlog=1Broken replication/rebuilding replicas/failover
  16. 16. Things to setlog_bin_trust_function_creatorsmax_connect_errorsslow query loggingsync_binlogquery cache
  17. 17. LimitationsSlow Query Logs (blog on how to do it)http://www.palominodb.com/blog/2011/10/20/exporting-mysqlslowlog-table-slow-query-log-formatMySQL upgradesSchema changesReplication out of RDS
  18. 18. LimitationsForced MaintenanceChanging the size of disk with replicasHow to dump/load data and usersCant dump mysql schema--routines
  19. 19. Dumping Userspt-show-grants -OR-mysql --host=olddatabasehost -BNe "selectconcat(,user,@,host,) from mysql.user where usernot like rds% and user != master" | while read uh; do mysql --host=olddatabasehost -BNe"show grants for $uh" | sed s/$/;/; s///g; done >user_grants.sqlhttp://www.villescorner.com/2012/11/mysqldump-from-amazon-rds-headaches-of.html
  20. 20. LimitationsSingle region replicas/Multi-AZWhat happens when an AZ or region goesdown?"...as if millions of voices suddenly criedout in terror and were suddenlysilenced."
  21. 21. DDLNo option to alter slave and swap with masterBlocking DDLOSC tools (no OS access)show table status like %blah%;Lots more on OSC tomorrow (B @ 2pm)
  22. 22. DDLWhat do you do if you really break replication?CALL mysql.rds_skip_repl_error;Recreate replica(s)one at a timepossible to rename
  23. 23. RDS vs EC2
  24. 24. Cost considerationsInstance typeMulti-AZ => 2xPIOPSReplicasDisk size
  25. 25. QuestionsBen Blackben@palominodb.comwww.palominodb.com

×