SlideShare a Scribd company logo
Swapping
Pacemaker/Corosync for
repmgr
pgDay Asia 2016
Ang Wei Shan
17th March 2016 Disclaimer: I don’t work for 2ndQuadrant
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
● Database Administrator
● > 4 years of experience in databases
● Worked with majority of the RDBMS
● ≈ 350 days with PostgreSQL
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
● Open-source alternative to Red Hat Cluster Suite
● Extremely popular choice in the open-source world
● Made up of 2 different stack of software
○ Pacemaker
○ Corosync/Heartbeat
● Complicated to get the configuration correct
Online: [ node1 node2 ]
Full list of resources:
stonith_node1 (stonith:fence_ipmilan): Stopped
stonith_node2 (stonith:fence_ipmilan): Stopped
vip-slave (ocf::heartbeat:IPaddr2): Started node1
Master/Slave Set: msPostgresql [pgsql]
Masters: [ node1 ]
Stopped: [ pgsql:1 ]
Resource Group: master-group
vip-master (ocf::heartbeat:IPaddr2): Started node1
vip-rep (ocf::heartbeat:IPaddr2): Started node1
Node Attributes:
* Node node1:
+ master-pgsql : 1000
+ pgsql-data-status : LATEST
+ pgsql-master-baseline : 00000070C6FCF9F0
+ pgsql-status : PRI
* Node node2:
+ master-pgsql : -INFINITY
+ pgsql-data-status : DISCONNECT
+ pgsql-status : STOP
Migration summary:
* Node node2:
stonith_node1: migration-threshold=1000000 fail-count=1000000 last-failure='Thu Feb 4 13:43:49 2016'
pgsql:0: migration-threshold=1 last-failure='Thu Feb 4 13:46:14 2016'
* Node node1:
stonith_node2: migration-threshold=1000000 fail-count=1000000 last-failure='Thu Feb 4 13:38:45 2016'
pgsql_start_0 (node=node2, call=84, rc=1, status=complete): unknown error
Feb 4 17:08:12 node1 attrd[3149]: notice: attrd_perform_update: Sent delete 46: node=node1, attr=last-f
ailure-stonith_node2, id=<n/a>, set=(null), section=status
Feb 4 17:08:12 node1 stonith-ng[3147]: notice: stonith_device_register: Device 'stonith_node2' already existed in device
list (2 active devices)
Feb 4 17:08:14 node1 stonith-ng[3147]: notice: log_operation: Operation 'monitor' [8201] for device 'stonith_node2' retur
ned: -1001 (Generic Pacemaker error)
Feb 4 17:08:14 node1 stonith-ng[3147]: warning: log_operation: stonith_node2:8201 [ ERROR: Failed to authenticate to https
://cathy.rocketwork.com.sg:4000 as node1 with key /etc/chef/client.pem ]
Feb 4 17:08:14 node1 stonith-ng[3147]: warning: log_operation: stonith_node2:8201 [ Getting status of IPMI:10.51.113.22...
Spawning: '/usr/bin/ipmitool -I lanplus -H '10.51.113.22' -U 'pacemaker' -L 'OPERATOR' -P '' -v chassis power status'... ]
Feb 4 17:08:14 node1 stonith-ng[3147]: warning: log_operation: stonith_node2:8201 [ Failed ]
Feb 4 17:08:15 node1 crmd[3151]: error: process_lrm_event: LRM operation stonith_node2_start_0 (call=52, status=4, cib-u
pdate=48, confirmed=true) Error
Feb 4 17:08:15 node1 crmd[3151]: warning: status_from_rc: Action 5 (stonith_node2_start_0) on node1 fai
led (target: 0 vs. rc: 1): Error
Feb 4 17:08:15 node1 crmd[3151]: warning: update_failcount: Updating failcount for stonith_node2 on node1
after failed start: rc=1 (update=INFINITY, time=1454576895)
Feb 4 17:08:15 node1 attrd[3149]: notice: attrd_trigger_update: Sending flush op to all hosts for: fail-count-stonith_dain
a2 (INFINITY)
Feb 4 17:08:15 node1 crmd[3151]: warning: update_failcount: Updating failcount for stonith_node2 on node1
after failed start: rc=1 (update=INFINITY, time=1454576895)
Feb 4 17:08:15 node1 crmd[3151]: notice: run_graph: Transition 12 (Complete=2, Pending=0, Fired=0, Skipped=1, Incomplete=0
, Source=unknown): Stopped
Feb 4 17:08:15 node1 attrd[3149]: notice: attrd_perform_update: Sent update 51: fail-count-stonith_node2=INFINITY
Feb 4 17:08:15 node1 attrd[3149]: notice: attrd_trigger_update: Sending flush op to all hosts for: last-failure-stonith_da
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
● Lightweight connection pooler for PostgreSQL
● Open-source
● Acts as the single point of entry to the database
● Useful for managing huge number of incoming
connections to the database
● Latest version - v1.7.2
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
● Common Address Redundancy Protocol (CARP)
● Linux’s implementation of CARP from FreeBSD
● Allows multiple hosts to share a single IP address
● Management of Virtual IP for failover purpose
● For client connectivity to Pg_bouncer
● Latest version => v1.5.2
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
● Developed by 2ndQuadrant
● Open-source
● Manages replication and failover for your
PostgreSQL HA cluster
● Latest version - v3.1.1
● Linux or Unix only
● repmgr 2.0 is for PostgreSQL 9.0 to 9.4
● repmgr 3.0 is for PostgreSQL 9.3 or higher
● Does not take care of client failover!!
● Automatic failover capabilities
● Provisioning of standby servers
● 2 main tools
○ repmgr => Perform administrative tasks
○ repmgrd => Perform monitoring, automatic failover and
notification events
● Requires a database to store cluster metadata
● Runs as postgres user
● Password-less SSH connectivity between all
hosts
● Recommended to run at with an odd number
cluster
The decision whether a server can be promoted depends whether the majority of servers are
"visible". If you have three servers - primary and standby in one location, and a second
standby in another location - and the network to the second standby goes down, the second
standby will see it's in the minority (its location represents 1/3 of the servers) and won't
promote itself.
If you have two servers in each location, you'd need an additional witness server so one
location still has a "majority" - otherwise in the event of a network disconnection you might
end up with one standby in each location promoting itself.
Agenda
● Introduction
● Challenges with Pacemaker/Corosync
● Pg_bouncer
● Linux’s UCARP
● 2ndQuadrant’s repmgr
● Demo
Thank you for your attention!
weishan.ang@gmail.com
newbiedba.wordpress.com
sg.linkedin.com/in/weishan

More Related Content

PDF
BHAGVAD GITA CHAPTER 11 FLOWCHARTS
PPTX
LORD CHAITANYA MAHAPRABHU.pptx
PDF
Bhagavad Gita Chapter 01
PDF
Report_LPG Market Analysis And Forecast
PDF
Srimad Bhagavad Gita, AS IT IS, Chapter 5, Presentation Notes
PDF
Bhagavad Gita Preface
PDF
Real Estate Magazine Vol 2 Issue 3
PPT
Bhagavad gita for all
BHAGVAD GITA CHAPTER 11 FLOWCHARTS
LORD CHAITANYA MAHAPRABHU.pptx
Bhagavad Gita Chapter 01
Report_LPG Market Analysis And Forecast
Srimad Bhagavad Gita, AS IT IS, Chapter 5, Presentation Notes
Bhagavad Gita Preface
Real Estate Magazine Vol 2 Issue 3
Bhagavad gita for all

What's hot (12)

PDF
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
PDF
Bhagavad Gita Introduction
PPS
Bhagvad Gita PPT
PDF
Srimad Bhagavad Gita, AS IT IS, Chapter 4, Presentation Notes
PDF
BHAGVAD GITA CHAPTER 10 FLOWCHARTS
PDF
Valmiki Ramayana - Uttara Kanda, Session 1
DOCX
PSO internship
PPTX
Electric car reva
PDF
CGD Business in India: a report
PPTX
Gita Chapter 9 - Newton (Chinmaya Mission Boston)
PPT
Introduction to Bhagavad-Gita: As It Is
DOCX
Capital budgeting copy
디지털 트윈 플랫폼 기술과 사례(LX공사 특강)
Bhagavad Gita Introduction
Bhagvad Gita PPT
Srimad Bhagavad Gita, AS IT IS, Chapter 4, Presentation Notes
BHAGVAD GITA CHAPTER 10 FLOWCHARTS
Valmiki Ramayana - Uttara Kanda, Session 1
PSO internship
Electric car reva
CGD Business in India: a report
Gita Chapter 9 - Newton (Chinmaya Mission Boston)
Introduction to Bhagavad-Gita: As It Is
Capital budgeting copy
Ad

Viewers also liked (20)

PDF
PostgreSQL Enterprise Class Features and Capabilities
PDF
Lightening Talk - PostgreSQL Worst Practices
PDF
Lessons PostgreSQL learned from commercial databases, and didn’t
PDF
PostgreSQL on Amazon RDS
PDF
PostgreSQL: Past present Future
PDF
Security Best Practices for your Postgres Deployment
PDF
PostgreSQL WAL for DBAs
PDF
How to teach an elephant to rock'n'roll
PDF
Query Parallelism in PostgreSQL: What's coming next?
PDF
Introduction to Vacuum Freezing and XID
PDF
Why we love pgpool-II and why we hate it!
PDF
(Ab)using 4d Indexing
PDF
PostgreSQL 9.6 Performance-Scalability Improvements
PDF
Go Faster With Native Compilation
PDF
Big Data and PostgreSQL
PDF
Migration From Oracle to PostgreSQL
PDF
Secure PostgreSQL deployment
PDF
On The Building Of A PostgreSQL Cluster
PDF
Use Case: PostGIS and Agribotics
PDF
There is Javascript in my SQL
PostgreSQL Enterprise Class Features and Capabilities
Lightening Talk - PostgreSQL Worst Practices
Lessons PostgreSQL learned from commercial databases, and didn’t
PostgreSQL on Amazon RDS
PostgreSQL: Past present Future
Security Best Practices for your Postgres Deployment
PostgreSQL WAL for DBAs
How to teach an elephant to rock'n'roll
Query Parallelism in PostgreSQL: What's coming next?
Introduction to Vacuum Freezing and XID
Why we love pgpool-II and why we hate it!
(Ab)using 4d Indexing
PostgreSQL 9.6 Performance-Scalability Improvements
Go Faster With Native Compilation
Big Data and PostgreSQL
Migration From Oracle to PostgreSQL
Secure PostgreSQL deployment
On The Building Of A PostgreSQL Cluster
Use Case: PostGIS and Agribotics
There is Javascript in my SQL
Ad

Similar to Swapping Pacemaker Corosync with repmgr (20)

PDF
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
PDF
Container Orchestration from Theory to Practice
PDF
Trevor McDonald - Nagios XI Under The Hood
PDF
Loadays managing my sql with percona toolkit
PDF
OpenNebulaConf 2013 - How Can OpenNebula Fit Your Needs: A European Project F...
PDF
How Can OpenNebula Fit Your Needs: A European Project Feedback
PDF
Pdf c1t tlawaxb
PPTX
Shall we play a game
PDF
Shall we play a game?
PDF
Matthew Mosesohn - Configuration Management at Large Companies
PDF
The Accidental DBA
PDF
How can OpenNebula fit your needs - OpenNebulaConf 2013
PDF
HTTP/3 where are we now? State of the art in our servers.
PPTX
Plone deployment made easy
PDF
Presentation 12c grid_upgrade
PDF
Replication using PostgreSQL Replicator
PDF
Go replicator
PDF
Percona Xtradb Cluster (pxc) 101 percona university 2019
PGConf APAC 2018 - Managing replication clusters with repmgr, Barman and PgBo...
Container Orchestration from Theory to Practice
Trevor McDonald - Nagios XI Under The Hood
Loadays managing my sql with percona toolkit
OpenNebulaConf 2013 - How Can OpenNebula Fit Your Needs: A European Project F...
How Can OpenNebula Fit Your Needs: A European Project Feedback
Pdf c1t tlawaxb
Shall we play a game
Shall we play a game?
Matthew Mosesohn - Configuration Management at Large Companies
The Accidental DBA
How can OpenNebula fit your needs - OpenNebulaConf 2013
HTTP/3 where are we now? State of the art in our servers.
Plone deployment made easy
Presentation 12c grid_upgrade
Replication using PostgreSQL Replicator
Go replicator
Percona Xtradb Cluster (pxc) 101 percona university 2019

More from PGConf APAC (16)

PDF
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PDF
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PDF
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PDF
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
PDF
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
PDF
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PDF
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PDF
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PDF
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
PDF
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PDF
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PDF
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PDF
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
PDF
PGConf APAC 2018 - Tale from Trenches
PDF
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
PDF
Amazon (AWS) Aurora
PGConf APAC 2018: Sponsored Talk by Fujitsu - The growing mandatory requireme...
PGConf APAC 2018: PostgreSQL 10 - Replication goes Logical
PGConf APAC 2018 - Lightening Talk #3: How To Contribute to PostgreSQL
PGConf APAC 2018 - Lightening Talk #2 - Centralizing Authorization in PostgreSQL
Sponsored Talk @ PGConf APAC 2018 - Choosing the right partner in your Postgr...
PGConf APAC 2018 - A PostgreSQL DBAs Toolbelt for 2018
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - Monitoring PostgreSQL at Scale
PGConf APAC 2018 - Where's Waldo - Text Search and Pattern in PostgreSQL
PGConf APAC 2018 - PostgreSQL HA with Pgpool-II and whats been happening in P...
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
Sponsored Talk @ PGConf APAC 2018 - Migrating Oracle to EDB Postgres Approach...
PGConf APAC 2018 - Tale from Trenches
PGConf APAC 2018 Keynote: PostgreSQL goes eleven
Amazon (AWS) Aurora

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Modernizing your data center with Dell and AMD
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Approach and Philosophy of On baking technology
PDF
KodekX | Application Modernization Development
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Monthly Chronicles - July 2025
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Modernizing your data center with Dell and AMD
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.
Approach and Philosophy of On baking technology
KodekX | Application Modernization Development
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks

Swapping Pacemaker Corosync with repmgr

  • 1. Swapping Pacemaker/Corosync for repmgr pgDay Asia 2016 Ang Wei Shan 17th March 2016 Disclaimer: I don’t work for 2ndQuadrant
  • 2. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 3. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 4. ● Database Administrator ● > 4 years of experience in databases ● Worked with majority of the RDBMS ● ≈ 350 days with PostgreSQL
  • 5. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 6. ● Open-source alternative to Red Hat Cluster Suite ● Extremely popular choice in the open-source world ● Made up of 2 different stack of software ○ Pacemaker ○ Corosync/Heartbeat ● Complicated to get the configuration correct
  • 7. Online: [ node1 node2 ] Full list of resources: stonith_node1 (stonith:fence_ipmilan): Stopped stonith_node2 (stonith:fence_ipmilan): Stopped vip-slave (ocf::heartbeat:IPaddr2): Started node1 Master/Slave Set: msPostgresql [pgsql] Masters: [ node1 ] Stopped: [ pgsql:1 ] Resource Group: master-group vip-master (ocf::heartbeat:IPaddr2): Started node1 vip-rep (ocf::heartbeat:IPaddr2): Started node1 Node Attributes: * Node node1: + master-pgsql : 1000 + pgsql-data-status : LATEST + pgsql-master-baseline : 00000070C6FCF9F0 + pgsql-status : PRI * Node node2: + master-pgsql : -INFINITY + pgsql-data-status : DISCONNECT + pgsql-status : STOP Migration summary: * Node node2: stonith_node1: migration-threshold=1000000 fail-count=1000000 last-failure='Thu Feb 4 13:43:49 2016' pgsql:0: migration-threshold=1 last-failure='Thu Feb 4 13:46:14 2016' * Node node1: stonith_node2: migration-threshold=1000000 fail-count=1000000 last-failure='Thu Feb 4 13:38:45 2016' pgsql_start_0 (node=node2, call=84, rc=1, status=complete): unknown error
  • 8. Feb 4 17:08:12 node1 attrd[3149]: notice: attrd_perform_update: Sent delete 46: node=node1, attr=last-f ailure-stonith_node2, id=<n/a>, set=(null), section=status Feb 4 17:08:12 node1 stonith-ng[3147]: notice: stonith_device_register: Device 'stonith_node2' already existed in device list (2 active devices) Feb 4 17:08:14 node1 stonith-ng[3147]: notice: log_operation: Operation 'monitor' [8201] for device 'stonith_node2' retur ned: -1001 (Generic Pacemaker error) Feb 4 17:08:14 node1 stonith-ng[3147]: warning: log_operation: stonith_node2:8201 [ ERROR: Failed to authenticate to https ://cathy.rocketwork.com.sg:4000 as node1 with key /etc/chef/client.pem ] Feb 4 17:08:14 node1 stonith-ng[3147]: warning: log_operation: stonith_node2:8201 [ Getting status of IPMI:10.51.113.22... Spawning: '/usr/bin/ipmitool -I lanplus -H '10.51.113.22' -U 'pacemaker' -L 'OPERATOR' -P '' -v chassis power status'... ] Feb 4 17:08:14 node1 stonith-ng[3147]: warning: log_operation: stonith_node2:8201 [ Failed ] Feb 4 17:08:15 node1 crmd[3151]: error: process_lrm_event: LRM operation stonith_node2_start_0 (call=52, status=4, cib-u pdate=48, confirmed=true) Error Feb 4 17:08:15 node1 crmd[3151]: warning: status_from_rc: Action 5 (stonith_node2_start_0) on node1 fai led (target: 0 vs. rc: 1): Error Feb 4 17:08:15 node1 crmd[3151]: warning: update_failcount: Updating failcount for stonith_node2 on node1 after failed start: rc=1 (update=INFINITY, time=1454576895) Feb 4 17:08:15 node1 attrd[3149]: notice: attrd_trigger_update: Sending flush op to all hosts for: fail-count-stonith_dain a2 (INFINITY) Feb 4 17:08:15 node1 crmd[3151]: warning: update_failcount: Updating failcount for stonith_node2 on node1 after failed start: rc=1 (update=INFINITY, time=1454576895) Feb 4 17:08:15 node1 crmd[3151]: notice: run_graph: Transition 12 (Complete=2, Pending=0, Fired=0, Skipped=1, Incomplete=0 , Source=unknown): Stopped Feb 4 17:08:15 node1 attrd[3149]: notice: attrd_perform_update: Sent update 51: fail-count-stonith_node2=INFINITY Feb 4 17:08:15 node1 attrd[3149]: notice: attrd_trigger_update: Sending flush op to all hosts for: last-failure-stonith_da
  • 9. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 10. ● Lightweight connection pooler for PostgreSQL ● Open-source ● Acts as the single point of entry to the database ● Useful for managing huge number of incoming connections to the database ● Latest version - v1.7.2
  • 11. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 12. ● Common Address Redundancy Protocol (CARP) ● Linux’s implementation of CARP from FreeBSD ● Allows multiple hosts to share a single IP address ● Management of Virtual IP for failover purpose ● For client connectivity to Pg_bouncer ● Latest version => v1.5.2
  • 13. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 14. ● Developed by 2ndQuadrant ● Open-source ● Manages replication and failover for your PostgreSQL HA cluster ● Latest version - v3.1.1
  • 15. ● Linux or Unix only ● repmgr 2.0 is for PostgreSQL 9.0 to 9.4 ● repmgr 3.0 is for PostgreSQL 9.3 or higher ● Does not take care of client failover!!
  • 16. ● Automatic failover capabilities ● Provisioning of standby servers ● 2 main tools ○ repmgr => Perform administrative tasks ○ repmgrd => Perform monitoring, automatic failover and notification events
  • 17. ● Requires a database to store cluster metadata ● Runs as postgres user ● Password-less SSH connectivity between all hosts ● Recommended to run at with an odd number cluster
  • 18. The decision whether a server can be promoted depends whether the majority of servers are "visible". If you have three servers - primary and standby in one location, and a second standby in another location - and the network to the second standby goes down, the second standby will see it's in the minority (its location represents 1/3 of the servers) and won't promote itself. If you have two servers in each location, you'd need an additional witness server so one location still has a "majority" - otherwise in the event of a network disconnection you might end up with one standby in each location promoting itself.
  • 19. Agenda ● Introduction ● Challenges with Pacemaker/Corosync ● Pg_bouncer ● Linux’s UCARP ● 2ndQuadrant’s repmgr ● Demo
  • 20. Thank you for your attention! weishan.ang@gmail.com newbiedba.wordpress.com sg.linkedin.com/in/weishan