deploying database clusters in the cloud - cloudopen europe

47
©Continuent 2013 Deploying Database clusters in the Cloud Neil Armitage - Continuent CloudOpen - Europe Tuesday, 24 September 13

Upload: narmitag

Post on 10-Jun-2015

193 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Deploying Database clusters in the Cloud

Neil Armitage - ContinuentCloudOpen - Europe

Tuesday, 24 September 13

Page 2: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013 2

• DBA Oracle/Mainframes/MySQL (25 Years)

• Deployment Engineer @ Continuent

• 1 or 2 Customer Deployments/Week

• On Premise or Cloud deployments

• Developer for Cloud Operations and Deployments @ Continuent

whoami

Tuesday, 24 September 13

Page 3: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013 3

On-premise/Colo deployments

• Raise a project

• Get Approval

• Order hardware

• Rack and cable hardware

• Connect to network

• Install Operating System

• Connect to SAN

Tuesday, 24 September 13

Page 4: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013 4

Tuesday, 24 September 13

Page 5: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud deployments

• Enter credit card number

• call APInova boot --image centos6-x86_64 --flavor m1.large db1nova boot --image centos6-x86_64 --flavor m1.large db2nova boot --image centos6-x86_64 --flavor m1.large db3

ec2-run-instances ami-xxxxx -k ${EC2_KEYPAIR} -t m1.largeec2-run-instances ami-xxxxx -k ${EC2_KEYPAIR} -t m1.largeec2-run-instances ami-xxxxx -k ${EC2_KEYPAIR} -t m1.large

5

Tuesday, 24 September 13

Page 6: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud Providers

• Amazon AWS

• RackSpace

• HP Cloud

• .......

• On Premise Clouds

• Openstack

• VMWare

6

Tuesday, 24 September 13

Page 7: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Where is a cloud server located ?

7

Ireland(3 AZ)

Sao Paulo(2 AZ)

Northern Virginia(5 AZ)

Oregon(3 AZ)

California(3 AZ)

Singapore(2 AZ)

Tokyo(3 AZ)

Sydney(2 AZ)

Tuesday, 24 September 13

Page 8: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

AWS Availability Zones

8

Region

Availability Zone Availability Zone

Availability Zone

Region

Availability Zone Availability Zone

Tuesday, 24 September 13

Page 9: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud Instance Location

9

db1

db2db3

EC2 Server A

EC2 Server BProvision 3 nodes DB1->DB3

Tuesday, 24 September 13

Page 10: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud Instance Location

10

db3

EC2 Server BServer A has died

Tuesday, 24 September 13

Page 11: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Where is your data?

11

Tuesday, 24 September 13

Page 12: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Where is your data?

12

X

Tuesday, 24 September 13

Page 13: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Where is your data?

13

X

X

Tuesday, 24 September 13

Page 14: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Where is your data?

14

X

X

X

Tuesday, 24 September 13

Page 15: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Networking in the Cloud

• Can be unreliable

• Where it is?

• What it is?

• Security?

15

Tuesday, 24 September 13

Page 16: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

High Availability

16

Tuesday, 24 September 13

Page 17: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

High Availability - On Premise

• Ensure servers in di!erent Racks

• Redundant Power

• Redundant Network

• Redundant Disk

• Backup Server in DR location

• Redundant network between DC’s

17

Tuesday, 24 September 13

Page 18: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

High Availability - Cloud

18

Tuesday, 24 September 13

Page 19: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud Environments Fail

19

Tuesday, 24 September 13

Page 20: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud Environments Fail

20

Tuesday, 24 September 13

Page 21: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Cloud Environments Fail

21

Tuesday, 24 September 13

Page 22: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Simple

22

Region

Availability Zone Availability Zone

US-EAST-1

1B 1C

S3 Backups

MasterSlave

Separate Nodes across AZ’s

Tuesday, 24 September 13

Page 23: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Better

23

Region

Availability Zone Availability Zone

Region

Availability Zone

US-EAST-1 US-WEST-1

1B 1C 1C

S3 Backups

S3 Backups

Master SlaveSlave

Separate Nodes across AZ’s and Regions

Tuesday, 24 September 13

Page 24: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Even Better

24

Region

Availability Zone Availability Zone

Region

Availability Zone

US-EAST-1

US-WEST-11B 1C

1C

S3 Backups

S3 Backups

Master

Slave

Slave

Slave RackspaceCloud Backups

Separate Nodes across Providers

Tuesday, 24 September 13

Page 25: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

High Availability in the Cloud

• Need to consider locations

• Have more nodes than you would with on premise

• Nodes can just disappear or stop functioning

“Spain  cluster  has  had  an  issue  this  afternoon  -­‐  the  current  master  DB  has  dropped  off  the  network/out  of  AWS”

25

Tuesday, 24 September 13

Page 26: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

High Availability in the Cloud

• Plan for and expect node failures

• Don’t assume that you will be able to quickly provision new nodes.

• Take plenty of backups (S3 costs only $100/month to store 1TB)

• Expect a few ‘bad’ nodes

• poor cpu performance

• poor disk performance

• throw them away - shoot them

26

VS

Tuesday, 24 September 13

Page 27: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Running Databases in the Cloud

27

Tuesday, 24 September 13

Page 28: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

AWS Relational Database Service (RDS)

• MySQL, Oracle, SQL Service

• Read Slaves

• Multi-AZ deployments

• Simple to set up and use

28

Tuesday, 24 September 13

Page 29: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

AWS Relational Database Service (RDS)

29

Tuesday, 24 September 13

Page 30: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

AWS Relational Database Service (RDS)

• AWS Only

• Can not replicate data out

• Very limited options for replicating in *

• No Multi-Region

• Slow failover with AZ’s (10 mins +)

30

Tuesday, 24 September 13

Page 31: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Rackspace Databases

• MySQL Only

• Single Node?

• Replication?

• No Backups

31

Tuesday, 24 September 13

Page 32: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Others

• Google Cloud

• Google only

• HP Cloud

• trove ? (private beta)

• OpenStack

• trove ?

32

Tuesday, 24 September 13

Page 33: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

How we deploy clusters (in the cloud)

33

Tuesday, 24 September 13

Page 34: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

What our customers want

• All on-premise

• All in AWS

• Main Site on-premise - backup/DR in AWS

• Main Site in AWS - backup in Rackspace

• Flexibility and no vendor lock in

• Most on-premise clouds are VMWare

34

Tuesday, 24 September 13

Page 35: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

What our customers don’t want

35

Tuesday, 24 September 13

Page 36: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Deploying in the Cloud

• Automate everything

• Puppet allows us to work across clouds

• No need to maintain AMI’s/Images just use a standard o/s images

• ‘masterless’ puppet to ensure we don’t have a SPOF

• Our install tools work across multi-nodes in parallel

• Prototype GUI/CLI launcher to deploy and scale clusters automatically

36

Tuesday, 24 September 13

Page 37: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Need to setup secure connections

• OpenVPN

• Need multiple servers to avoid a SPOF

• Software

• We now support secure connections

• Between DB’s

• Between Apps and DB’s

37

Tuesday, 24 September 13

Page 38: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Best Practices

• RAID EBS Volumes (RAID1)

• Backups

• xtrabackup (backed up into S3)

• EBS Snapshot

• ec2-­‐consistent-­‐snapshot  \--mysql --freeze-#lesystem /vol \--region eu-west-1  \--description "$(hostanme) RAID snapshot $(date +'%Y-%m-%d %H:%M:%S')" \vol-1f9a6446 vol-649a643d

38

Tuesday, 24 September 13

Page 39: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Best Practices

• Monitoring

• Nagios

• Zabbix

• Email Alerts

• New Relic

39

Tuesday, 24 September 13

Page 40: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

The future / Coming Soon

40

Tuesday, 24 September 13

Page 41: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013 41

hetzner.de

GUI CLI

RESTAPI

Queue

OpenShift OpenStack AWS Private

backofficewebfacing1 webfacing2crosscloud

tdf

usa

west

east

puppet

Worker

Tuesday, 24 September 13

Page 42: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Demo

42

Tuesday, 24 September 13

Page 43: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Whats next

• Instance Autoscaling

• MongoDB

• Oracle

• Postgres

• Better support for VMWare and On-Premise installs

43

Tuesday, 24 September 13

Page 44: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Lesson Learnt

• EC2 Instances fail

• One of anything is never enough

• Don’t assume you can spin up more resources instantly

• Think multi-cloud, public/private

• Resources are disposable - throw away and rebuild if needed

44

Tuesday, 24 September 13

Page 45: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Lesson Learnt

• Monitor everything

• Automate as much as possible

• Backup everything (twice)

45

Tuesday, 24 September 13

Page 46: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013

Questions

46

Tuesday, 24 September 13

Page 47: Deploying database clusters in the cloud - CloudOpen Europe

©Continuent 2013 47

Continuent Website:http://www.continuent.com

Tungsten Replicator 2.0:http://code.google.com/p/tungsten-replicator

Our Blogs:http://scale-out-blog.blogspot.comhttp://datacharmer.blogspot.comhttp://flyingclusters.blogspot.com

560 S. Winchester Blvd., Suite 500 San Jose, CA 95128 Tel +1 (866) 998-3642 Fax +1 (408) 668-1009e-mail: [email protected]

Tuesday, 24 September 13