Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:02:05+00:00 2026-06-12T12:02:05+00:00

I am trying to set up synchronous replication with Postgres 9.1, but I cannot

  • 0

I am trying to set up synchronous replication with Postgres 9.1, but I cannot get it to work. I was able to configure streaming replication, but not synchronous.
I hope I have not missed anything obvious. I have read carefully many sections of ch 17, 18, 14, 25, 26 and 29 in the admin guide.

I am running ubuntu 12.04 and my master postgresql.conf has these, among all the other standard settings:

listen_addresses = '*'              # what IP address(es) to listen on;
wal_level = archive                 # minimal, archive, or hot_standby
archive_mode = on                   # allows archiving to be done
archive_command = 'test ! -f /data/pgWalArchive/%f && cp %p /data/pgWalArchive/%f'
wal_keep_segments = 100             # in logfile segments, 16MB each; 0 disables ??? What should this be ???? 
max_wal_senders = 3                 # max number of walsender processes

My pg_hba.conf has this, in addition to the standard stuff:

host    all             all             XX.6.35.0/24            md5
host    replication     postgres        XX.6.35.0/24            md5

My master db has just one sequence, so it is tiny. I successfully created a backup of the master in the primary and restored it:

sudo -u postgres pg_basebackup -D ~/backup -F tar -x -z -l ~/backup/base1 -v -h XX.6.35.51 -U postgres

I also copied the WAL archive files to the standby. My standby recovery.conf file has this:

restore_command = '/usr/lib/postgresql/9.1/bin/pg_standby /data/pgWalArchive %f %p %r'
archive_cleanup_command = '/usr/lib/postgresql/9.1/bin/pg_archivecleanup /data/pgWalArchive %r'
standby_mode = on
primary_conninfo = 'host=XX.6.35.51 port=5432' # e.g. 'host=masterIpAddressOrName port=5432'

Both servers start up with no problems and the logs seem ok. My standby has this:

2012-06-08 10:23:51 MDT LOG:  shutting down
2012-06-08 10:23:51 MDT LOG:  database system is shut down
2012-06-08 10:23:53 MDT LOG:  database system was shut down in recovery at 2012-06-08 10:23:51 MDT
2012-06-08 10:23:53 MDT LOG:  entering standby mode
2012-06-08 10:23:53 MDT LOG:  consistent recovery state reached at 0/1D000078
2012-06-08 10:23:53 MDT LOG:  record with zero length at 0/1D000078
2012-06-08 10:23:53 MDT LOG:  streaming replication successfully connected to primary
2012-06-08 10:23:53 MDT LOG:  incomplete startup packet
2012-06-08 10:23:54 MDT FATAL:  the database system is starting up
2012-06-08 10:23:54 MDT FATAL:  the database system is starting up
2012-06-08 10:23:55 MDT FATAL:  the database system is starting up
2012-06-08 10:23:55 MDT FATAL:  the database system is starting up
2012-06-08 10:23:56 MDT FATAL:  the database system is starting up
2012-06-08 10:23:56 MDT FATAL:  the database system is starting up
2012-06-08 10:23:57 MDT FATAL:  the database system is starting up
2012-06-08 10:23:57 MDT FATAL:  the database system is starting up
2012-06-08 10:23:58 MDT FATAL:  the database system is starting up
2012-06-08 10:23:58 MDT FATAL:  the database system is starting up
2012-06-08 10:23:59 MDT FATAL:  the database system is starting up
2012-06-08 10:23:59 MDT LOG:  incomplete startup packet
2012-06-08 10:24:40 MDT LOG:  redo starts at 0/1D000078

The problem is that when I issue statements against the master, they hang forever. Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:02:06+00:00Added an answer on June 12, 2026 at 12:02 pm

    I was the first person to put Streaming Replication (AKA “Binary Replication”) into production when 9.0 came out two years ago, but skipped over 9.1 because Postgres’ replication feature was in a state of flux. Now, as of about the second week of September or thereabouts, 9.2 is out – you WANT to know about it!

    With 9.2, replication has been simplified and GREATLY improved!

    Now you can have replication cascade! Previously, you had to have the master serve all the slaves directly. Now you can off-load the master by streaming to just ONE slave, and then have that slave stream to as many as you like! This lets you set up your first-level slave as a potential hot-stand-by system that will take over in the event your master fails.

    The whole strategy for configuring this has been revamped and I found your question because I myself was looking for a quick-setup-guide type of thing because I already know all the basics. However, you can get started with the new 9.2 stuff here:

    Postgres 9.2 High Availability, Load Balancing, and Replication

    Meanwhile, at least one vendor has come out with something to help mere mortals make good use of this: Science Tools announced “Dual Mode” has been added to their PolyglotSQL product. PolyglotSQL lets an application operate against most any SQL database and ignore dialect differences. Similarly, the “dual mode” feature lets you have one read-only connection and another connection for writes, without having to re-write your application (!!), so you can take advantage of the Postgres Synchronous Replication, offloading the master of all writes, and putting that load on whatever readers you have configured.

    I highly recommend you move to Postgres v 9.2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to set DoMatchParen I get the following error: E492: Not an editor
It's not in the documentation, but I'm trying to figure out how to set
Trying to set a flag in the post to allow processing or not. The
I am trying to validate weather the connection was successful but have been getting
I am trying to send a sms with smslib but It did not send
I've been trying to somehow get my javascript function (which I have in the
I just succeed to set in place my rails server. But when I'm trying
Im trying set the single table inheritance model type in a form. So i
Trying to set up a self signed certificate, for our intranet's web services site.
Trying to set it so if a certain condition is met then one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.