deploying database clusters in the cloud database...deploying database clusters in the cloud neil...

40
©Continuent 2013 Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13

Upload: others

Post on 30-May-2020

24 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Deploying Database clusters in the Cloud

Neil Armitage - Continuent

Sunday, 1 September 13

Page 2: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013 2

whoami

Sunday, 1 September 13

Page 3: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013 3

• DBA Oracle/Mainframes/MySQL (25 Years)

• Deployment Engineer for Continuent

• Developer for Cloud Operations and Deployments @ Continuent

Sunday, 1 September 13

Page 4: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013 4

On-premise/Colo deployments

• Raise a project

• Get Approval

• Order hardware

• Rack and cable hardware

• Connect to network

• Install Operating System

• Connect to SAN

Sunday, 1 September 13

Page 5: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013 5

Sunday, 1 September 13

Page 6: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

6

Sunday, 1 September 13

Page 7: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Cloud Providers

• Amazon AWS

• RackSpace

• HP Cloud

• .......

• On Premise Clouds

• Openstack

• VMWare

7

Sunday, 1 September 13

Page 8: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Where is a cloud server located ?

8

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)

Sunday, 1 September 13

Page 9: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

AWS Availability Zones

9

Region

Availability Zone Availability Zone

Availability Zone

Region

Availability Zone Availability Zone

Sunday, 1 September 13

Page 10: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Instance Location

10

db1

db2db3

EC2 Server A

EC2 Server BProvision 3 nodes DB1->DB3

Sunday, 1 September 13

Page 11: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Instance Location

11

db3

EC2 Server BServer A had died

Sunday, 1 September 13

Page 12: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Where is your data?

12

EBS Data is replicated within AZ

Sunday, 1 September 13

Page 13: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Where is your data?

13

EBS Data is replicated within AZ X

Sunday, 1 September 13

Page 14: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Where is your data?

14

EBS Data is replicated within AZ X

X

Sunday, 1 September 13

Page 15: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Where is your data?

15

EBS Data is replicated within AZ X

X

X

Sunday, 1 September 13

Page 16: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Networking in the Cloud

• Can be unreliable

• Not sure where it is

• What it is

• Security?

16

Sunday, 1 September 13

Page 17: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

High Availability

17

Sunday, 1 September 13

Page 18: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

18

Sunday, 1 September 13

Page 19: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Separate Nodes across AZ’s

19

Region

Availability Zone Availability Zone

US-EAST-1

1B 1C

S3 Backups

MasterSlave

Sunday, 1 September 13

Page 20: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Separate Nodes across Regions

20

Region

Availability Zone Availability Zone

Region

Availability Zone

US-EAST-1 US-WEST-1

1B 1C 1C

S3 Backups

S3 Backups

Master SlaveSlave

Sunday, 1 September 13

Page 21: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Separate Nodes across Providers

21

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

Sunday, 1 September 13

Page 22: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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”

22

Sunday, 1 September 13

Page 23: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

23

Sunday, 1 September 13

Page 24: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Running Databases in the Cloud

24

Sunday, 1 September 13

Page 25: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

AWS Relational Database Service (RDS)

• MySQL, Oracle, SQL Service

• Read Slaves

• Multi-AZ deployments

• Simple to set up and use

25

Sunday, 1 September 13

Page 26: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

AWS Relational Database Service (RDS)

26

Sunday, 1 September 13

Page 27: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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 +)

27

Sunday, 1 September 13

Page 28: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Rackspace Databases

• MySQL Only

• Single Node?

• Replication?

• No Backups

28

Sunday, 1 September 13

Page 29: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Others

• Google Cloud

• Google only

• HP Cloud

• ?

• OpenStack

• trove ?

29

Sunday, 1 September 13

Page 30: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

How we deploy clusters (in the cloud)

30

Sunday, 1 September 13

Page 31: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

What out customers want

• All on-premise

• All in AWS

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

• Main in AWS - backup in Rackspace

• Flexibility and no vendor lock in

• Most on-premise clouds are VMWare

31

Sunday, 1 September 13

Page 32: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

32

Sunday, 1 September 13

Page 33: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

33

Sunday, 1 September 13

Page 34: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

34

Sunday, 1 September 13

Page 35: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Best Practices

• Monitoring

• Nagios scripts converted to email alerts

• New Relic

35

Sunday, 1 September 13

Page 36: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Demo

36

Sunday, 1 September 13

Page 37: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©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

37

Sunday, 1 September 13

Page 38: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Lesson Learnt

• Monitor everything

• Automate as much as possible

• Backup everything (twice)

38

Sunday, 1 September 13

Page 39: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013

Questions

39

Sunday, 1 September 13

Page 40: Deploying Database clusters in the Cloud Database...Deploying Database clusters in the Cloud Neil Armitage - Continuent Sunday, 1 September 13 ©Continuent 2013 2 ... • Openstack

©Continuent 2013 40

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]

Sunday, 1 September 13