Commit Graph

1096 Commits

Author SHA1 Message Date
Ian Barwick ecabe2c294 Fix pg_ctl path generation in do_standby_switchover() 2016-03-30 16:45:47 +09:00
Gianni Ciolli 2ba57e5938 Rewording comment for clarity. 2016-03-30 09:27:37 +02:00
Ian Barwick 2eec17e25f Add headers as dependencies in Makefile 2016-03-30 10:28:41 +09:00
Ian Barwick c48c248c15 Regularly sync witness server repl_nodes table.
Although the witness server will resync the repl_nodes table following
a failover, other operations (e.g. removing or cloning a standby)
were previously not reflected in the witness server's copy of this
table.

As a short-term workaround, automatically resync the table at regular
intervals (defined by the configuration file parameter
"witness_repl_nodes_sync_interval_secs", default 30 seconds).
2016-03-29 16:49:28 +09:00
Martín Marqués 958e45f2b8 Merge pull request #165 from dhyannataraj/master
Better use /24 network mask in this example
2016-03-28 13:32:09 -03:00
Nikolay Shaplov daafd70383 Better use /24 network mask in this example 2016-03-28 18:56:50 +03:00
Ian Barwick c828598bfb It's unlikely this situation will occur on a witness server
Which is why the error message is for master/standby only.
2016-03-28 15:53:25 +09:00
Ian Barwick b55519c4a2 Add hint about registering the server after cloning it.
This step is easy to forget.
2016-03-02 09:41:06 +09:00
Ian Barwick 4cafd443e1 README: Add note about 'repmgr_funcs' 2016-02-25 16:36:19 +09:00
Ian Barwick d400d7f9ac repmgrd: fix error message 2016-02-24 15:33:36 +09:00
Ian Barwick 62bb3db1f8 Fix code comment 2016-02-24 15:27:08 +09:00
Ian Barwick d9961bbb17 Minor fixes to README.md 2016-02-23 14:25:26 +09:00
Ian Barwick e1b8982c14 Ensure witness node is registered before the repl_nodes table is copied
This fixes a bug introduced into the previous commit, where the
witness node was registered last to prevent a spurious node record
being created even if witness server creation failed.
2016-02-23 07:36:41 +09:00
Martin 2fe3b3c2a3 Fix a few paragraphs from the README.md. 2016-02-22 09:20:11 -03:00
Ian Barwick c6e1bc205a Prevent repmgr/repmgrd running as root 2016-02-22 14:58:17 +09:00
Ian Barwick 7241391ddc Better handling of errors during witness creation
Ensure witness is only registered after all steps for creation
have been successfully completed.

Also write an event record if connection could not be made to
the witness server after initial creation.

This addresses GitHub issue #146.
2016-02-16 14:28:33 +09:00
Ian Barwick c8f449f178 witness creation: extract database and user names from the local conninfo string
99.9% of the time they'll be the same as the primary connection, but
it's more consistent to use the provided local conninfo string
(from which the port is already extracted).
2016-02-09 15:59:28 +09:00
Ian Barwick 49420c437f README.md: update witness server section 2016-02-09 15:58:51 +09:00
Ian Barwick 827ffef5f9 Add '-P/--pwprompt' option for "repmgr create witness"
Optionally prompt for superuser and repmgr user when creating a witness.
This ensures a password can be provided if the primary's pg_hba.conf
mandates it.

This deprecates '--initdb-no-pwprompt'; and changes the default behaviour of
"repmgr create witness", which previously required a superuser password
unless '--initdb-no-pwprompt' was supplied.

This behaviour is more consistent with other PostgreSQL utilities such
as createuser.

Partial fix for GitHub issue #145.
2016-02-09 15:11:50 +09:00
Ian Barwick 16296bb1c3 Bump dev version number 2016-02-01 15:10:03 +09:00
Ian Barwick c9c18d6216 Update comments in SQL upgrade file v3.1 2016-02-01 13:49:58 +09:00
Ian Barwick d21f506614 Add placeholders for old FAILOVER.rst and QUICKSTART.md pointing to new README.md 2016-02-01 08:02:37 +09:00
Ian Barwick fbad18085e README.md: formatting and spelling fixes 2016-01-29 17:09:12 +09:00
Ian Barwick ca08b1c3bb REAMDE.md: formatting 2016-01-29 16:55:47 +09:00
Ian Barwick 3d95fab0ac README.md: minor corrections 2016-01-29 16:47:12 +09:00
Ian Barwick 12d6ce4629 Bump version 2016-01-28 16:09:06 +09:00
Ian Barwick dfb34ae7b6 Update HISTORY 2016-01-28 11:44:28 +09:00
Ian Barwick 98c4eb002a README: add replication slot example 2016-01-28 11:43:42 +09:00
Ian Barwick faed8a65f7 Add new README file
Replaces existing legacy documentation.
2016-01-28 11:32:19 +09:00
Ian Barwick a81cf04614 Update various comments 2016-01-28 11:13:38 +09:00
Ian Barwick ca6cbcf965 Add sanity checks to be sure pg_rewind can be used before executing a switchover 2016-01-28 09:25:00 +09:00
Ian Barwick 16c1e13019 Sanity check for presence of pg_rewind on remote server 2016-01-28 07:25:23 +09:00
Ian Barwick 1375adcac8 Standardize capitalisation in log messages 2016-01-28 07:24:45 +09:00
Ian Barwick e859a58405 Change some repmgrd log messages to NOTICE
So key events during failover on promoted and following standbys
logged at the same level.
2016-01-27 18:39:27 +09:00
Ian Barwick 1a6d830314 Various logging, help output and comment tweaks 2016-01-27 17:10:54 +09:00
Ian Barwick a96f478a43 Allow negative values in configuration parameters, where appropriate.
Make the code match the documentation.

As pointed out by GitHub user phyber (#142).

Also various other minor improvements to error reporting during
config file parsing.
2016-01-27 09:10:19 +09:00
Ian Barwick 8f20ab16dd Display default log level in -?/--help output 2016-01-25 14:39:21 +09:00
Ian Barwick 3ec436f30d Better document default values in repmgr.conf.sample 2016-01-22 15:22:22 +09:00
Ian Barwick 61e00bf1c7 Improve handling of default connection parameters 2016-01-22 14:14:14 +09:00
Ian Barwick 5d71869fc1 --help output: put default values in quotation marks
Similar to psql.
2016-01-20 15:56:26 +09:00
Ian Barwick 7598e08b6f Display default connection options in --help output 2016-01-20 15:46:41 +09:00
Ian Barwick ba71e1eedf Use maxlen_snprintf() in do_witness_create() 2016-01-20 15:13:52 +09:00
Ian Barwick a4c07b23fb Document --pg_rewind option in help output 2016-01-20 15:09:03 +09:00
Ian Barwick 0c36f921f7 help() -> do_help()
For consistency and easier location of the function body.
2016-01-20 15:02:03 +09:00
Ian Barwick 8ac5a5444e Enable repmgr standby switchover for 9.3/9.4 by recloning
A bit of a hack and unsuited for large databases - install
pg_rewind instead. Or upgrade to 9.5.
2016-01-20 14:51:16 +09:00
Ian Barwick f60e7346e2 Don't copy 'recovery.done' or 'recovery.conf' when cloning a standby
'recovery.conf' will be overwritten, but we don't want a 'recovery.done'
for another server.
2016-01-20 14:34:13 +09:00
Ian Barwick 855ca8fe1a Support separately-compiled pg_rewind for "repmgr standby switchover" in 9.3/9.4 2016-01-20 14:21:02 +09:00
Ian Barwick daa79d1a0f Remove any recovery.done file copied in by pg_rewind
It'll be the old standby/new primary's old recovery.conf file,
which we don't want floating about confusing things.
2016-01-20 13:18:52 +09:00
Ian Barwick 211768d911 Support pg_rewind when executing "repmgr standby switchover"
9.5 and later.
2016-01-20 13:05:47 +09:00
Ian Barwick f982708b35 Add function test_db_connection()
The difference between this and establish_db_connection() is that
it outputs any connection failure as a [NOTICE] rather than an
[ERROR]; it's intended for use in e.g. polling a server to wait
for it to come up/go down, while preventing [ERROR] log lines
which may cause confusion.
2016-01-20 07:56:03 +09:00