Growing a live database

From: Rick Genter <rick(dot)genter(at)gmail(dot)com>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Cc: rick(dot)genter(at)gmail(dot)com
Subject: Growing a live database
Date: 2011-05-06 13:27:47
Message-ID: BANLkTimU+f3Lu3zQnsASjuVEsTO0mZ3jHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a PostgreSQL 8.4.4 database that is running 24/7. The drive that the
database is on is becoming full and I need to expand it. We are currently
doing log-shipping of the WAL files to a slave system to run in a hot
standby mode. I have two servers: S1 (currently running as master) and S2
(currently running as slave)

My current plan is to do the following:

- fail S1 over to S2 by doing pg_ctl stop on S1, then ending the recovery
process on S2 and let it come up as the master
- add a new larger drive to S1
- swap roles; backup S2 and restore it on S1, then start log shipping from
S2 to S1
- let the S1 "catch up" on the log files from S2
- fail S2 back over to S1 by doing pg_ctl stop on S2, then ending the
recovery process on S1 and let it come up as the master
- add a new larger drive to S2
- backup S1 and restore it on S2, then start log shipping from S1 to S2

I believe that this accomplishes the goal (increasing available drive space)
with a minimum amount of down time. Am I thinking correctly, or have I
missed something?

--
Rick Genter
rick(dot)genter(at)gmail(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jakub Królikowski 2011-05-06 13:42:47 Default Operator Class for datatype
Previous Message Vick Khera 2011-05-06 13:15:37 Re: Bidirectional replication