high availability

26
High Availability Pascal Robert Druide informatique

Upload: wo-community

Post on 19-May-2015

352 views

Category:

Software


1 download

TRANSCRIPT

Page 1: High availability

High AvailabilityPascal Robert Druide informatique

Page 2: High availability

Business requirements

• Check your requirements!

• Recovery Time Objective (RTO)

• Recovery Point Objective (RPO)

• Budget

• SLA from your providers

Page 3: High availability

DNS

• Think about it!

• Use a solid DNS provider!

• TTL!

Page 4: High availability

Cloud or my own?

• Cloud is more flexible and more scalable on demand

• Easy grow with the cloud

• Own hardware might cost less

• Choose your provider wisely (read the fine prints!)

• Snapshots!

Page 5: High availability

Simple setup

• One Web server + one or more app servers + one db server

• Pros:

• Cost is not too high

• Scales your WO applications

• Cons:

• No high availability for your Web and database services

Page 6: High availability

HA for databases

• Replication/standby

• Only failover, or read-only slaves

• Great for multi locations

• Clustering/load balancing

• Might have some drawbacks

• Not ideal for multi locations

• Amazon RDS

Page 7: High availability

Replication/clustering doesn’t replace backups!!

!

Neither RAID!

Page 8: High availability

Tools for the job

Page 9: High availability

Tools for Linux

• Heartbeat

• HAProxy

• DRBD

Page 10: High availability

Heartbeat

• Can mounts a virtual network interface

• Monitor services and switch over

• Failover or load balancing

Page 11: High availability

HAProxy

• Load balancer as software

• Can use Heartbeat for LB failover

• Can look for session ID in cookie or url path

• Can act as basic firewall

• Not only for HTTP(S)

Page 12: High availability

DRBD

• RAID 1 over a network

• Failover or clustering, depends on file system

Page 13: High availability

Basic HA setup

• Two Web/apps servers with Heartbeat (active/passive)

• Two database servers and Heartbeat and DRBD

Page 14: High availability

Average HA setup

• Two Web servers with Heartbeat

• Two app servers with Heartbeat (for Monitor)

• Two database servers and Heartbeat and DRBD

Page 15: High availability

Fantastic HA setup

• Two load balancers with HAProxy and Heatbeat

• Two active Web servers

• Two or more app servers

• Two database servers, with Heartbeat and DRBD

Page 16: High availability

Tools for the cloud

• Auto scaling

• RackSpace Auto Scale

• Amazon Auto Scaling

• Load balancers

• Amazon Elastic Load Balancer

• Linode NodeBalancers

• Rackspace Cloud Load Balancers

Page 17: High availability

Rackspace Auto Scale

• Can check by memory, CPU, load, file system and network

• Have APIs

• Need VM images

• Specify minimum and maximum

Page 18: High availability

Amazon Auto Scaling

• Works with Cloud Watch

• Will scale based on network requests or load

• Needs AMIs

• Have APIs

• Specify minimum and maximum

Page 19: High availability

Amazon Elastic Load Balancer

• Supports TCP, HTTP, HTTPS and SSL

• Can check path (URL)

• Can load balance between regions

• Integration with CloudWatch

• Can use the application’s session cookie (wosid)

Page 20: High availability

Linode Node Balancers

• Supports TCP, HTTP and HTTPS

• Session Stickiness works with tables of IPs or HTTP cookie

• Health check can do a status (2xx, 3xx) check or regex on body

Page 21: High availability

Rackspace Cloud Load Balancers

• Can cache content (images, audio, video, css)

• Can display error page when all nodes are down

• Session persistence by cookie for http only

• Required for Auto Scale

Page 22: High availability

Mixing

• You can use HAProxy and heartbeat in the cloud

• DRBD might work, but I can’t confirm

Page 23: High availability

Monitoring/relaunch

• You can use Nagios’ event handlers to restart stuck instances

• Amazon Cloud Watch and Rack monitoring are good too

• Start new app instances or VMs based on memory or other criteria

Page 24: High availability

Alternatives

• Use mod_proxy_balancer and Direct Connect

• Use Puppet/Chef

Page 25: High availability

TODOs

• Scripts to monitor state of apps for scaling

• Event handlers for Nagios

• Replace JavaMonitor with something else

• Should we get away from wotaskd and the WO adaptor?

Page 26: High availability

Q&A