We may earn an affiliate commission when you visit our partners.
Loles Ferrándiz

A database system must be available when it is needed, and even more so in specific business cases such as large companies, emergency services, banks, etc.

To guarantee an availability close to 100% it is necessary to implement a replica system that allows us to ensure that clients can work with another server when the main database server has to be disconnected to carry out maintenance tasks or expansion tasks. Anothre feature this replica system enables is that in the event of an uncontrolled drop in service, clients have another server to work with while the problem is resolved.

Read more

A database system must be available when it is needed, and even more so in specific business cases such as large companies, emergency services, banks, etc.

To guarantee an availability close to 100% it is necessary to implement a replica system that allows us to ensure that clients can work with another server when the main database server has to be disconnected to carry out maintenance tasks or expansion tasks. Anothre feature this replica system enables is that in the event of an uncontrolled drop in service, clients have another server to work with while the problem is resolved.

The availability of 99.99% is possible and in this course I install, configure and monitor a replica system to teach you how to do it, step by step, so that you do not have any difficulties when backing up your PostgreSQL databases with this system. .

Not only will you have a secondary server (also called standby or slave) with which to work, with all the data, in the event of a main server crash, but also you will be able to use that secondary server for reading operations. In so doing, customers who access the system to perform reports, statistics, pattern analysis, etc., will be able to do it through the standby server, reducing the workload on the main server, for the benefit of the entire system.

The replication system that we will configure in this course will have a failover system implemented. This means that, in the event of an unexpected crash of the database service, the standby server will become the new master without intervention from the DBA,  automatically, whatever time it is, whatever day it is, and the service can continue without problems.

Finally, and to further assure the clients of this availability, we will use two virtual IPs, one to connect to the main database, and another to connect to the replica, so that clients do not have the need to know how many servers form part of the replica system, if they are active or down, nor the role that each one of them has.

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Learning objectives

  • High availability
  • Replication system
  • Streaming replication asynchronous
  • Hot standby to allow read-only connections
  • Failover so that when the primary database goes down, a replica is activated immediately and the service is not interrupted
  • Switchover to reverse the roles between the primary and standby
  • Promote a standby, that is, make it a master
  • Clone a standby to connect it to the master
  • Virtual ip to connect to the main database
  • Virtual ip to connect to the standby database

Syllabus

Introduction
Instructor's message

In this class I explain everything you can expect from a mirroring system, and I show you, through a simple animation, the behavior of the mirroring system before each event that may occur in the system.

Read more

We configure the replica system using the asynchronous streaming replication technique. At the end of this practical class you will have a replica system working between the main database server and a standby server.

We download, install and configure the repmgr package with which we can configure the failover, a very useful feature that allows a standby server to promote to new master server in the event of a failure of the current master.

All nodes that are part of the replica system must be registered in the repmgr database with their corresponding configuration (connection information, name, role, etc.).

In this practical class we will see how to register the nodes and how to monitor them to know their status at all times.

In this practical class we simulate a serious failure in the main server that causes the service to crash. Thanks to the failover configuration carried out in the previous class, we will see how the standby server promotes to master, thus allowing the continuity of the service.

Once the problem that caused the primary server crash has been solved, it has to be recovered (cloned) and incorporated back into the replica system as a "new replica" that acts as a backup for the "new master" that was promoted after the failover.

In this class we will see how a server is cloned and incorporated into the replica system as a standby.

Switchover means reversing the roles between the two servers.

Often the main server is a much more powerful server regarding the processor, memory, etc. When a failover occurs, a standby server promotes to "new master" which is fine, as it provides that High Availability that we are after. The master can be cloned and incorporated into the replica system as a "new standby" but perhaps we do not want to remain in this state for long and we want the powerful server to be the master again.

This is why we have the switchover process, which we will explain in PostgreSQL.

In this class we configure two virtual IPs in each of the nodes: one for the connection with the master and another for the connection with the standby.

Each server will pick up the corresponding virtual IP and, from that moment, clients can be reconfigured to always connect to a single IP.

We need the virtual IPs to go up and down on the servers as the role changes occur. For example, if one of the two servers is down, the other will assume the two virtual IPs.

In so doing, customers will not need to know how many nodes the replica system has, which nodes are active and which ones are down, or what role each active node has. They always connect to the virtual IP with which they work (IP of the master, or IP of the standby) and do not have to make changes in their connection strings.

In this practical class we do the final failover test: we cause the main server to crash and watch how the failover takes place, and the correct configuration of the virtual IPs.

In this practical class we recover the crashed server (the old master) and check that it is perfectly incorporated into the replica system as a new standby, and acquires the virtual IP of the standby which, in turn, falls from the server that currently acts as "new master".

This time we perform a switchover, a role reversal to return the master role to the main server and the standby role to the secondary server. Virtual IPs are reversed too, as expected ;-)

This theoretical class mentions other high availability systems that could be configured.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Covers failover and switchover procedures, which are essential for maintaining database uptime and minimizing disruptions during planned maintenance or unexpected outages
Uses PostgreSQL 12+, which is a recent version, so learners can apply these skills to modern database environments and infrastructure
Employs repmgr, a widely used package for managing replication and failover in PostgreSQL clusters, which is valuable for real-world deployments
Focuses on asynchronous streaming replication, which is a common and efficient method for replicating data between PostgreSQL servers
Requires familiarity with database administration concepts and command-line operations, which may not be suitable for complete beginners
Teaches the configuration of virtual IPs, which adds complexity and may require additional networking knowledge and configuration

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Practical postgresql high availability setup

According to learners, this course provides a practical, step-by-step guide to setting up PostgreSQL high availability using Streaming Replication and repmgr. Students particularly appreciate the hands-on demonstrations covering crucial aspects like failover, switchover, and the implementation of virtual IPs. Many found the explanations clear and easy to follow, making complex configurations approachable. Reviewers frequently noted that the course is highly relevant for real-world scenarios and provides immediately applicable skills for DBAs and system administrators. While the course is largely positive, some mentioned the benefit of having a foundational understanding of Linux environments and basic PostgreSQL administration before starting.
Beneficial to have prior technical knowledge.
"Having some prior experience with Linux command line and basic PostgreSQL administration is definitely helpful for this course."
"It moves quickly into the practical steps, so a foundational understanding is assumed."
"While clear, it's best if you're comfortable with server environments and database basics before starting."
"I found having a basic understanding of PostgreSQL replication concepts before starting made it easier."
Specific tool for failover/switchover used.
"The course focuses heavily on repmgr, which is a popular and effective tool for PostgreSQL HA."
"It gives a solid understanding of how to use repmgr for automatic failover and manual operations."
"Good deep dive into configuring and managing HA using repmgr."
"The course is centered around setting up repmgr, which is exactly what I needed to learn."
Concepts are explained clearly and logically.
"The instructor explains complex concepts like failover and switchover very clearly, making them easy to grasp."
"His explanations are concise and to the point. I didn't get lost in jargon."
"Everything was explained well, building up the system piece by piece."
"Easy to understand explanations even for someone relatively new to PostgreSQL replication."
Content is highly relevant for production systems.
"This is exactly what I needed to implement high availability for PostgreSQL in my company's infrastructure."
"The course covers essential topics like virtual IPs and automatic failover, which are critical for production."
"Highly practical and directly applicable to administering PostgreSQL in a real-world environment."
"Provides immediately usable skills for DBAs."
Focus on practical setup and demonstrations.
"The step-by-step practical examples are extremely helpful. I could follow along and set up my own test environment easily."
"I really appreciated the hands-on labs showing failover and switchover. Seeing it work in practice solidified the concepts."
"This course provides a great practical guide to setting up streaming replication and repmgr for high availability."
"Learned exactly how to configure HA for my production environment. The demos are the best part."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in How to configure a High Availability System in PostgreSQL with these activities:
Review PostgreSQL Fundamentals
Solidify your understanding of PostgreSQL fundamentals before diving into high availability configurations. This will make it easier to grasp the more advanced concepts covered in the course.
Browse courses on Database Fundamentals
Show steps
  • Review basic SQL syntax and commands.
  • Practice creating and managing databases and tables.
  • Familiarize yourself with PostgreSQL's architecture.
Read 'PostgreSQL Administration Cookbook'
Supplement the course material with practical examples and solutions for PostgreSQL administration. This book offers a hands-on approach to learning and implementing high availability solutions.
Show steps
  • Read the chapters related to replication and failover.
  • Try out the examples provided in the book on a test environment.
  • Compare the book's approach with the course's approach.
Set up a Test HA Environment
Gain hands-on experience by setting up a high availability PostgreSQL environment in a virtualized or cloud-based setting. This will allow you to apply the concepts learned in the course and troubleshoot any issues that arise.
Show steps
  • Choose a virtualization platform or cloud provider.
  • Install PostgreSQL on multiple virtual machines.
  • Configure replication and failover according to the course instructions.
  • Test the failover mechanism by simulating a primary server failure.
Three other activities
Expand to see all activities and additional details
Show all six activities
Document Your HA Setup
Reinforce your understanding by documenting the steps you took to configure your high availability PostgreSQL system. This will help you solidify your knowledge and provide a valuable reference for future use.
Show steps
  • Describe the architecture of your HA setup.
  • Document the configuration steps for each component.
  • Include diagrams and screenshots to illustrate the process.
  • Explain the troubleshooting steps you took to resolve any issues.
Read 'PostgreSQL High Availability, 2nd Edition'
Deepen your knowledge of PostgreSQL high availability with a comprehensive guide covering advanced topics and techniques. This book provides a broader perspective on HA solutions.
Show steps
  • Read the chapters on advanced replication techniques.
  • Explore different failover mechanisms and their trade-offs.
  • Learn about monitoring and alerting strategies for HA systems.
Contribute to Repmgr Documentation
Enhance your understanding of Repmgr by contributing to its documentation. This could involve improving existing documentation, adding new examples, or translating the documentation into another language.
Show steps
  • Identify areas in the Repmgr documentation that need improvement.
  • Submit a pull request with your proposed changes.
  • Respond to feedback from the Repmgr community.

Career center

Learners who complete How to configure a High Availability System in PostgreSQL will develop knowledge and skills that may be useful to these careers:
Database Reliability Engineer
A database reliability engineer focuses on the availability, performance, and scalability of database systems. Database reliability engineers need expertise in replication, failover, and switchover techniques. This course is highly relevant because it focuses on configuring high availability in PostgreSQL. The skills developed in this course, such as setting up replication, managing failovers, and configuring virtual IPs, are essential for maintaining reliable database services. Anyone interested in becoming a database reliability engineer, particularly those working with PostgreSQL, should take this course.
Database Administrator
A database administrator is responsible for the performance, integrity, and security of an organization's databases. This role includes setting up and maintaining database systems. This course, focused on configuring a high availability system in PostgreSQL, is directly relevant. Database administrators implement replication systems, such as the one taught in this course, to ensure database availability and business continuity. The course's emphasis on failover and switchover mechanisms is critical for ensuring a database administrator can maintain robust systems. The practical skills gained from setting up a virtual IP configuration will also be valuable. Anyone wishing to enter the field of database administration, particularly within systems using PostgreSQL, should take this course.
Systems Engineer
A systems engineer designs, implements, and manages complex systems, often including databases, servers, and networks. This role requires a broad understanding of how different components work together to enable operational efficiency. This course helps build the foundation for understanding crucial aspects of a high availability database system, a common component in many systems. A systems engineer who understands the importance of replication, failover, and switchover, as taught in this course, ensures system uptime and resilience. Additionally, the ability to configure virtual IPs will be useful when designing and deploying infrastructure. Anyone looking for a career as a systems engineer, working with databases, would find this course extremely beneficial.
Database Consultant
A database consultant provides expert advice and guidance to organizations on database management and optimization. This role requires an in-depth understanding of database technologies and best practices, including high availability configurations. This course, which is centered on configuring a high availability system in PostgreSQL, is extremely useful for a database consultant. The course provides the practical skills required to implement replication, failover, and switchover, all of which are important when creating robust systems. The knowledge regarding virtual IP configuration covered in this course is highly valuable when designing solutions for clients who require constant and reliable database access. Anyone pursuing a career as a database consultant, especially with PostgreSQL, should consider taking this course.
Site Reliability Engineer
A site reliability engineer ensures that systems are always available and performant. This role involves deploying, monitoring, and maintaining infrastructure, as well as automating operational processes. This course, focused on a high availability database system, is extremely relevant for a site reliability engineer. The course's focus on replication, failover, and switchover helps build a foundation for ensuring the reliability of a system. Additionally, the course teaches how to work with virtual IPs, which provides valuable skills in maintaining service availability even during failures. Site reliability engineers who utilize PostgreSQL will find the knowledge gained in this course to be very relevant to their daily tasks.
DevOps Engineer
A DevOps engineer oversees the integration of development and operations, focusing on automation, infrastructure, and continuous delivery. This role requires a strong understanding of database systems, particularly regarding their availability and performance. This course, which covers the configuration of high availability systems with PostgreSQL, is directly relevant for a DevOps engineer. The failover and switchover mechanisms taught in the course are necessary for maintaining continuous service. Also, the ability to configure virtual IPs is very useful when setting up reliable deployment pipelines. Anyone interested in becoming a DevOps engineer, particularly those who work with database systems, should consider taking this course.
Cloud Engineer
A cloud engineer is responsible for designing, building, and maintaining cloud infrastructure and applications. This role requires a strong grasp of database technologies, particularly for high availability and disaster recovery. This course's focus on configuring high availability PostgreSQL systems is highly relevant to a cloud engineer. The course material on setting up replication, including failover and switchover, is essential for maintaining reliable cloud services. Cloud engineers often use virtual IPs, so the course's training in configuring them is extremely valuable. Someone seeking to become a cloud engineer, particularly those who will manage database systems in the cloud, will find this course extremely helpful.
Infrastructure Engineer
An infrastructure engineer is responsible for managing the hardware and software that supports an organization's systems. This role involves maintaining servers, networks, and databases. This course, which focuses on setting up high availability in PostgreSQL databases, is very relevant to the role of an infrastructure engineer. The course's teachings on replication, failover, and switchover are essential for ensuring a stable and reliable infrastructure. The practical skills developed in this course, such as configuring virtual IPs, will be useful in managing system downtime related to database issues. If you're seeking a career as an infrastructure engineer, and you will be working with databases, this course could be helpful.
Solutions Architect
A solutions architect designs and oversees the architecture of complex systems, from conception to implementation. This role requires a broad understanding of the technical aspects of various technologies, including databases. This course provides a foundation for understanding how to implement high availability in PostgreSQL, an important element for many enterprise systems. A solutions architect must consider different scenarios, such as failovers and switchovers, which this course covers in detail. The skills learned in this course are extremely useful for any solutions architect designing database solutions that must be reliable. For anyone becoming a solutions architect, this course may be very valuable.
Data Architect
A data architect designs and manages data infrastructure, ensuring it meets business needs. This role involves planning data storage, movement, and access strategies, often with a high focus on reliability and performance. This course, centered on configuring high availability in PostgreSQL, contributes to the skill set of a data architect. The replication, failover, and switchover procedures covered are extremely relevant. By using techniques taught in this course, data architects can better ensure the resilience of data systems. Those wishing to work as data architects, particularly with systems that use PostgreSQL, should consider taking this course.
Technical Support Engineer
A technical support engineer provides assistance to customers experiencing technical issues with software or systems. This role requires a deep understanding of how systems work. This course, about configuring a high availability system in PostgreSQL, may be helpful to a technical support engineer. The course will enhance their understanding of how databases function and how replication works. The knowledge of replication, failover, and switchover mechanisms covered in the course can help technical support engineers diagnose and troubleshoot issues related to database availability. For those seeking to help customers with their technical database issues, this course may be beneficial.
Network Engineer
A network engineer is responsible for designing, implementing, and maintaining an organization's network infrastructure. Although this role isn't specifically about databases, the course's focus on virtual IPs is relevant. The practical skills regarding their configuration, as provided in this course, can enhance a network engineer's understanding of how IP addresses are used in high availability systems. The course can help a network engineer ensure reliable connectivity for database servers. While databases aren't the main focus, this course's knowledge of virtual IPs may be useful for network engineers.
Software Developer
A software developer writes and maintains code for applications. This role may require knowledge of databases, including how to ensure they are always available. While this course does not teach the developer how to write applications, this course may be useful to software developers because it provides a deeper understanding of database reliability, especially regarding replication, failover, and switchover. The skills taught in this course, such as working with virtual IPs, are useful to know for software developers who use databases. While not directly focused on development, this course may be beneficial to a software developer.
Technical Project Manager
A technical project manager oversees projects related to software or hardware development. While project managers don't typically perform hands-on technical work, they must possess a broad understanding of the technologies being used. This course's focus on the configuration of high availability systems in PostgreSQL may be useful for a technical project manager. The skills taught in this course may help technical project managers better assess the requirements for infrastructure, and appreciate the challenges of database reliability. While this course is not central to their duties, technical project managers may find it valuable.
IT Manager
An information technology manager oversees an organization's IT infrastructure, including databases, servers, and networks. While the IT manager may not perform technical tasks hands-on, they must understand how the technology works. This course, which provides an in-depth look at how to configure high availability in PostgreSQL, might be useful to an IT manager. An IT manager needs to understand the challenges of maintaining database reliability. The knowledge of replication, failover, and switchover taught in the course may inform IT managers making decisions about their infrastructure. While not directly involved in implementation, this course may benefit an IT manager.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in How to configure a High Availability System in PostgreSQL.
Provides a comprehensive guide to building robust and scalable PostgreSQL high availability solutions. It covers various replication techniques, failover mechanisms, and monitoring strategies. It valuable resource for understanding the intricacies of PostgreSQL HA and implementing advanced configurations. This book adds more depth to the existing course.
Provides practical solutions for administering PostgreSQL databases, including topics like replication and high availability. It serves as a valuable reference for implementing the concepts taught in the course. The cookbook format allows you to quickly find solutions to specific problems you might encounter. It is commonly used by database administrators.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser