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
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
Toc

Setting up an asynchronous replication


After going through the transaction log related issues, it is time to set up the asynchronous replication. The process itself is pretty simple. However, it is important to gain some overview of the problem.

Obtaining a high-level overview

So, before digging into details, I would like to list the steps necessary to set up a streaming replication slave.

Note

Slaves are always read-only. Writes are not allowed on slaves.

The steps are as follows:

  1. Install PostgreSQL and create a data directory in the slave as follows:

    • mkdir /data # for example

    • chmod 700 /data # to start PostgreSQL

    • chown postgres.postgres /data # if running as postgres

  2. Edit postgresql.conf in the master:

    • Set wal_level to hot_standby

    • Set max_wal_senders to a reasonably high number

    • Set hot_standby to on (for making things easier later on)

  3. Edit pg_hba.conf in the master and add replication rules to make sure remote boxes can connect to your server.

  4. Restart PostgreSQL on the master...

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