Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
PostgreSQL Administration Essentials

You're reading from   PostgreSQL Administration Essentials Discover efficient ways to administer, monitor, replicate, and handle your PostgreSQL databases

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher Packt
ISBN-13 9781783988983
Length 142 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Hans-Jürgen Schönig Hans-Jürgen Schönig
Author Profile Icon Hans-Jürgen Schönig
Hans-Jürgen Schönig
Arrow right icon
View More author details
Toc

Understanding timelines


Until now you have seen how to set up a single slave. Basically, having more than just one slave is easy. Just repeat the process that consists of the creation of pg_basebackup and recovery.conf. This is all it takes to create more slaves on the fly. Of course you can also simply clone existing base backups.

Running many slaves in parallel is easy; however, the failover process is not too trivial. For the sake of simplicity, let's assume there is one master and two slaves. What happens if the master dies? The answer is nothing. PostgreSQL does not care. Those two slaves will try to reconnect again and again but otherwise nothing will happen—there is no automatic failover process.

Your task is to elect a new master and make sure that things can move on as expected. And this is when timelines start to matter. If you start your setup from scratch, everybody will be in timeline 1. As soon as a slave is promoted to master, it will automatically move to timeline 2. So, let...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images