From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Josh Berkus <josh(at)agliodbs(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: pg_upgrade and rsync |
Date: | 2015-01-29 15:21:30 |
Message-ID: | 54CA4FFA.4020502@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 01/29/2015 12:26 AM, Josh Berkus wrote:
>> So, for my 2c, I'm on the fence about it. On the one hand, I agree,
>> it's a bit of a complex process to get right. On the other hand, it's
>> far better if we put something out there along the lines of "if you
>> really want to, this is how to do it" than having folks try to fumble
>> through to find the correct steps themselves.
> So, here's the correct steps for Bruce, because his current doc does not
> cover all of these. I really think this should go in as a numbered set
> of steps; the current doc has some steps as steps, and other stuff
> buried in paragraphs.
>
> 1. Install the new version binaries on both servers, alongside the old
> version.
>
> 2. If not done by the package install, initdb the new version's data
> directory.
>
> 3. Check that the replica is not very lagged. If it is, wait for
> traffic to die down and for it to catch up.
>
> 4. Shut down the master using -m fast or -m smart for a clean shutdown.
> It is not necessary to shut down the replicas yet.
>
> 5. pg_upgrade the master using the --link option. Do not start the new
> version yet.
>
> 6. create a data directory for the new version on the replica. This
> directory should be empty; if it was initdb'd by the installation
> package, then delete its contents.
>
> 7. shut down postgres on the replica.
>
> 8. rsync both the old and new data directories from the master to the
> replica, using the --size-only and -H hard links options. For example,
> if both 9.3 and 9.4 are in /var/lib/postgresql, do:
>
> rsync -aHv --size-only -e ssh --itemize-changes /var/lib/postgresql/
> replica-host:/var/lib/postgresql/
>
> 9. Create a recovery.conf file in the replica's data directory with the
> appropriate parameters.
>
> 10. Start the master, then the replica
>
>
I find steps 2 and 6 confusing.
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2015-01-29 15:29:50 | Re: Safe memory allocation functions |
Previous Message | Bruce Momjian | 2015-01-29 15:13:39 | Re: pg_upgrade and rsync |