+ All Categories
Home > Documents > Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

Date post: 09-Feb-2022
Category:
Upload: others
View: 21 times
Download: 0 times
Share this document with a friend
33
USE IMPROVE EVANGELIZE Availability of PostgreSQL in the Datacenter Detlef Ulherr Sun Microsystems
Transcript
Page 1: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

USE IMPROVE EVANGELIZE

Availability of PostgreSQL in the Datacenter●Detlef Ulherr●Sun Microsystems●

Page 2: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

2

USE IMPROVE EVANGELIZE

Outline

● Increasing the availability of PostgreSQL● Why is High Availability Important?● What is “Open High Availability Cluster”?● How Solaris Cluster Provides High

Availability● Cluster Agents● PostgreSQL and Open HA Cluster● Cluster in Action

Page 3: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

3

USE IMPROVE EVANGELIZE

Increasing the Availability of PostgreSQL

Page 4: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

4

USE IMPROVE EVANGELIZE

PostgreSQL availability with Solaris

● Use the features in Solaris 10 / Nevada● Use the shared disk approach (Sun Cluster /

Open HA Cluster), shared nothing available as well

● Configure a warm standby with pg_standby● Use master slave replication with Slony-I● Combine the replication with shared disk● If you need desaster recovery, use Sun

Cluster Geo /Open Ha Geo

Page 5: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

5

USE IMPROVE EVANGELIZE

Solaris Features for more PostgreSQL Availability

Page 6: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

6

USE IMPROVE EVANGELIZE

Solaris 10 availability features

● Service Management Facility (SMF)● Offers process monitoring

● IP Multipathing (IPMP)● Protects from network adapter failures

● Isolation with Containers● Separate multiple PostgreSQL installations

Page 7: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

7

USE IMPROVE EVANGELIZE

Why Is High Availability Important?

Page 8: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

8

USE IMPROVE EVANGELIZE

Why is HA Important?

● Downtime is costly● Failures are inevitable– Hardware, Software, Human Error, Disaster– Automated recovery the goal

● With a single physical system, single points of failure are catastrophic– Network card dies, CPU misbehaves, Disk

drive crashes ...

HA Clusters and Solaris automate the recovery process from inevitable failures, minimizing downtime and cost

Page 9: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

9

USE IMPROVE EVANGELIZE

What is Open High Availability Cluster?

Page 10: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

10

USE IMPROVE EVANGELIZE

Open High Availability Cluster

● The open-source code base for SolarisTM Cluster– Based on Solaris Cluster 3.2

● Hosted by the HA Clusters community group on opensolaris.org– http://www.opensolaris.org/os/community/ha-

clusters/ohac/

● Code available under the CDDL

Page 11: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

11

USE IMPROVE EVANGELIZE

How Solaris Cluster Provides High Availability

Page 12: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

12

USE IMPROVE EVANGELIZE

Platform for High Availability● Tolerates Single Points of Failure (and some double

failures)● Hardware redundancy with off-the-shelf hardware● Robust software HA infrastructure– Monitors the health of cluster infrastructure (hosts, shared storage,

and network)

– Orchestrates recovery of applications and cluster infrastructure (shared storage and IP networking)

– Integrated tightly with Solaris Operating System

– Robust membership including quorum to prevent partitions

– Disk Fencing ensures Data Integrity in spite of failures

Page 13: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

13

USE IMPROVE EVANGELIZE

Solaris Cluster Stack

OperatingSystem

Cluster Infrastructure

Agents

Applications

Heartbeats

Membership

Page 14: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

14

USE IMPROVE EVANGELIZE

●HA Failover Service● Application failover

● Within nodes or container● Containers failover● Failover IP address

Failover Service

Page 15: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

15

USE IMPROVE EVANGELIZE

Scalable ServiceSoftware Load Balancing

Global Network Service Provides Global IP address

with failure protection

Scalable Service

Page 16: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

16

USE IMPROVE EVANGELIZE

Apache (Scalable)

Global Network Service Provides Global IP address

with failure protection

PostgreSQL (Failover)

Example: Apache and PostgreSQL

Page 17: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

17

USE IMPROVE EVANGELIZE

Heartbeats

Membership

Quorum

Disk Fencing ●Resource Group Manager● Resource (application) dependencies● Inter RG dependencies● RG affinities

●HA Failover Service● Application failover

● Within nodes or container● Containers failover● Failover IP address

Global File ServiceFailover File service

Scalable ServiceSoftware Load Balancing

Global Network Service Provides Global IP address

with failure protection

Mon

itorin

g

Solaris Cluster Architecture

Page 18: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

18

USE IMPROVE EVANGELIZE

Cluster Agents

Page 19: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

19

USE IMPROVE EVANGELIZE

Solaris Cluster Stack

OperatingSystem

Cluster Infrastructure

Agents

Applications

Page 20: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

20

USE IMPROVE EVANGELIZE

Cluster Agents (Data Services)

● Applications run on cluster unmodified (off-the-shelf)● Cluster Agents are the “glue” layer between applications

and cluster infrastructure– Custom agent for each application

Interacts with cluster core through APIs Provides start, stop, and other commands specific to the application

to be called by the cluster framework Provides monitor daemon specific to the application

● Application cannot break into the high availability business on Solaris Cluster without an agent!

Page 21: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

21

USE IMPROVE EVANGELIZE

Agents Development

Several choices available● Sun Cluster Agent Builder– Generic Data Service (GDS)

– Data Service Development Library (DSDL)

– RGM Application Programming Interface (API)

● Advanced GDS Template available from OHAC

Page 22: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

22

USE IMPROVE EVANGELIZE

PostgreSQL and Open Ha Cluster

Page 23: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

23

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Disk) Global Zone

PostgreSQL

Storage Log. Host

Application

Node1 Node2

Page 24: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

24

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Disk) Global Zone

Node1 Node2

Storage based replicationTruecopy (3.2)SRDF (3.2U1)

PostgreSQL

Storage Log. Host

Application

Page 25: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

25

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Disk) Local Zone

Node1 : Zone1 Node2 : Zone2

PostgreSQL

Storage Log. Host

Application

Page 26: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

26

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Disk) Failover Zone

PostgreSQL

Storage Log. Host

Node1 Node2

Zone1

Application

Page 27: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

27

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Nothing) Global Zone (near future)

Node2 StandbyNode1 Primary

Quorum Server

PostgreSQL-P PostgreSQL-SWAL file shipping

Rolechanger

Log. Host

Application

Page 28: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

28

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Nothing) Local Zone (near future)

Rolechanger

Log. Host

Application

Node2 : Zone2 Standby

Node1 : Zone 1 Primary

Quorum Server

PostgreSQL-P PostgreSQL-SWAL file shipping

Page 29: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

29

USE IMPROVE EVANGELIZE

PostgreSQL (Shared Disk) Multiple Clusters (near future)

PostgreSQL

Storage Log. Host

Node1 (Zone) Node2 (Zone)

PostgreSQL

Storage Log. Host

Node3 (Zone) Node4 (Zone)

WAL file shipping

Cluster 1 Cluster 2

Page 30: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

30

USE IMPROVE EVANGELIZE

Geographic ClusteringMulti-Cluster and Multi-Site capability

Site 1

Admin.Client

UserClient

Site 2

Optional heartbeat networks

Optional storage network

IP NetInter/Intra

Dial,Sat Net, etc.

ClusterCluster

Storage NetStorage Net

StorageStorage

WAL and Slony-I repare future projects

Page 31: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

31

USE IMPROVE EVANGELIZE

Cluster in Action

Page 32: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

32

USE IMPROVE EVANGELIZE

PostgreSQL● The demo will show a live cluster with

PostgreSQL

Page 33: Availability of PostgreSQL in the Datacenter - PostgreSQL wiki

USE IMPROVE EVANGELIZE

Thank you!

Detlef [email protected]

“open” artwork and icons by chandan: http://blogs.sun.com/chandan


Recommended