Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Troubleshooting PostgreSQL

You're reading from   Troubleshooting PostgreSQL Intercept problems and challenges typically faced by PostgreSQL database administrators with the best troubleshooting techniques

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher Packt
ISBN-13 9781783555314
Length 164 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Installing PostgreSQL FREE CHAPTER 2. Creating Data Structures 3. Handling Indexes 4. Reading Data Efficiently and Correctly 5. Getting Transactions and Locking Right 6. Writing Proper Procedures 7. PostgreSQL Monitoring 8. Fixing Backups and Replication 9. Handling Hardware and Software Disasters 10. A Standard Approach to Troubleshooting Index

Making use of asynchronous replication


While point-in-time recovery is nice, it might not be enough. In many cases, people want an up-to-date standby server that can also serve as a read-only slave. A feature called streaming replication is exactly what is needed in this case.

Setting up streaming replication is easy and can be performed in a handful of steps:

  1. Adapt postgresql.conf on the master server.

  2. Change pg_hba.conf to allow remote base backups.

  3. Run pg_basebackup to get an initial copy.

  4. Fire up the slave.

To set up postgresql.conf, the following settings are needed:

wal_level = hot_standby
max_wal_senders = 5
hot_standby = on

The first two settings are mandatory on the master. The wal_level field tells the server to create enough xlog to allow streaming replication, and max_wal_senders will indicate the number of streams the master is allowed to keep open.

Tip

If you are planning to run one slave, consider setting max_wal_senders to 3 or higher. During streaming, only one wal-sender process...

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 $19.99/month. Cancel anytime