Commit Graph

410 Commits

Author SHA1 Message Date
Ian Barwick f19d546fa1 Merge pull request #2 from gciolli/master
Small clarification on sudo-based configuration (#1)
2017-09-11 10:23:37 +09:00
Ian Barwick 9b2a35c5e3 Add/update various documents 2017-09-11 10:21:20 +09:00
Ian Barwick 3447257ae4 repmgrd: minor fixes and comment updates 2017-09-08 20:59:21 +09:00
Ian Barwick e16f68dfce Use "MODULE_PATHNAME" in function definitions 2017-09-08 20:46:45 +09:00
Ian Barwick ba38b99590 repmgrd: fix logging when reloading configuration 2017-09-08 14:52:33 +09:00
Ian Barwick e4f7dc8234 Add copyright notices 2017-09-08 13:27:39 +09:00
Ian Barwick 82db2237ad Add files as placeholders 2017-09-08 08:16:34 +09:00
Ian Barwick ab8cb9d471 "standby register": remove database connection parameter warning 2017-09-07 17:09:29 +09:00
Ian Barwick b6a27b975d "standby clone": improve handling when designated upstream doesn't yet exist
This situation can occur in provisioning environments, where a node's
upstream may not exist at the point it's cloned. If replication slots
are in use, we'll need to make sure no attempt is made to create
the replication slot on the designated upstream, as that will end in
tears. We assume the user will be prepared to complete this step manually.
2017-09-07 12:35:27 +09:00
Ian Barwick 3787dd3795 "standby switchover": better handling of remote execution failure 2017-09-07 11:50:56 +09:00
Ian Barwick edee80cc37 Rename option "node check --is-shutdown" to "--is-shutdown-cleanly"
As that's what we really want to know. Also return "UNCLEAN_SHUTDOWN"
if that's the case, rather than "RUNNING" which is confusing, even
though it's a command for internal use.
2017-09-07 11:15:27 +09:00
Ian Barwick 79531ae9da "standby switchover": fix check for remote repmgr binary
Also add a useful hint about setting "pg_bindir".
2017-09-07 10:26:46 +09:00
Gianni Ciolli 6d63c0f941 Small clarification on sudo-based configuration (#1)
Now we are more explicit on what we recommend for the various
service_X_command settings when using sudo.

Signed-off-by: Gianni Ciolli <gianni.ciolli@2ndQuadrant.com>
2017-09-06 20:32:54 +01:00
Ian Barwick ee7a5b6e66 Minor bug and log fixes 2017-09-06 17:28:31 +09:00
Ian Barwick 03f400617c "standby register": add --dry-run and check node is attached to upstream 2017-09-06 15:48:23 +09:00
Ian Barwick 66219c3097 README and "repmgr standby --help" updates 2017-09-06 14:13:06 +09:00
Ian Barwick a28bbd68eb "standby clone": improve replication slots handling
Ensure replication slot is created on the upstream node and deleted from
the source node, if upstream node and source nodes differ.
2017-09-06 12:16:02 +09:00
Ian Barwick bd07a34472 "standby clone": improve log messages
Make it clearer which nodes are being connected to, and why.
2017-09-06 10:15:52 +09:00
Ian Barwick e21a3ef7ec Fix typo 2017-09-06 09:31:16 +09:00
Ian Barwick 1c015c72a0 "cluster show": display "location" field too 2017-09-05 14:25:29 +09:00
Ian Barwick 9f0d44373b "cluster show": syntax fix 2017-09-05 13:35:25 +09:00
Ian Barwick 1ef00f5a3b repmgrd: parse "follow_command" during cascaded standby failover 2017-09-05 11:19:25 +09:00
Ian Barwick eeef0b5df5 Trim recovery.conf lines when outputting as debug log lines 2017-09-05 10:33:41 +09:00
Ian Barwick 5b5b456ecb "standby switchover": improve logging
Also no need to disconnect/reconnect from/to local node while it promotes.
2017-09-05 10:26:27 +09:00
Ian Barwick d82e936556 "standby promote": improve logging
Specifically state which server is being promoted; this is particularly
important when the promotion occurs as part of a series of other operations,
e.g. "standby switchover".

Also no need to disconnect/reconnect while the server is promoted.
2017-09-05 09:43:16 +09:00
Ian Barwick 78e6bdeebe Have repmgrd parse "standby follow --upstream-node-id=%n" 2017-09-04 13:42:50 +09:00
Ian Barwick 9a0f45d7d3 Standardize quotation marks in log messages 2017-09-04 10:56:57 +09:00
Ian Barwick 1445d1002c Clean up log messages
Remove legacy trailing new lines.
2017-09-04 10:52:42 +09:00
Ian Barwick 22f5576cc2 Fix typo 2017-09-04 09:41:00 +09:00
Ian Barwick 47a4b49890 Add "repmgr standby follow --upstream-node-id"
In an automatic failover situation, after a standby has been promoted
there's a risk the original primary may become available again before
"standby follow" is issued on another standby node, in which case "standby
follow" will reconnect to the original primary.

As the standby's repmgrd will have received a notification from the new
primary, it will know the primary's ID and can therefore explicitly
direct "standby follow" to follow that primary.
2017-09-04 09:11:59 +09:00
Ian Barwick 3aeceab081 "standby follow": add missing sleep() call when --wait specified 2017-09-02 13:11:03 +09:00
Ian Barwick 72e037d55b SCRIPTS_built also required for 9.4 2017-09-02 12:03:17 +09:00
Ian Barwick 4ba3e67e11 Hacky workaround for hacky workaround in 9.4
For some reason 9.4 doesn't install the repmgr/repmgrd binaries
with "SCRIPTS_built". "SCRIPTS" seems to work for both 9.4 and
later versions.
2017-09-02 11:54:07 +09:00
Ian Barwick ab6702891a Minor fixes to cascading standby failover. 2017-09-01 13:09:17 +09:00
Ian Barwick edb74ccef9 Various fixes to "repmgr node rejoin" 2017-09-01 11:30:31 +09:00
Ian Barwick f9f05158d2 Fix "cluster show --csv" output 2017-09-01 00:14:01 +09:00
Ian Barwick c7423ebb44 Various minor fixes 2017-08-31 23:54:52 +09:00
Ian Barwick 91941183bc Use replication user, if set, when checking replication connections 2017-08-31 17:54:49 +09:00
Ian Barwick 1517c06bb1 Document "replication_user" configuration file parameter. 2017-08-31 17:29:09 +09:00
Ian Barwick 04c9779561 Add documentation about passwords and recovery.conf 2017-08-31 15:24:09 +09:00
Ian Barwick 0e0b221507 Add configuration file setting "use_primary_conninfo_password"
If, for whatever reason, the upstream server password needs to be set
in "primary_conninfo", enable it to be extracted from $PGPASSWORD.
2017-08-31 14:57:07 +09:00
Ian Barwick 677cd9073a Document parameter "degraded_monitoring_timeout"
Also ensure it can be reloaded.
2017-08-31 14:48:51 +09:00
Ian Barwick 7fecc611a9 Update minimum version check in configure.in 2017-08-31 13:33:45 +09:00
Ian Barwick ed16c32fe7 Check minimum server version for pg_rewind 2017-08-31 13:30:59 +09:00
Ian Barwick 705b52fde4 Use actual program name rather than "repmgr" when executing remote commands
It's possible some distribution packages may assign a different name to the
"repmgr" binary (typically appending a version number), so we shouldn't hard-code
into the command string.

However it's reasonable to assume the "repmgr" binary will have the same name
across a replication cluster so we won't engage in any contortions to account
for possible variations.

See: https://github.com/2ndQuadrant/repmgr/issues/323
2017-08-31 11:04:11 +09:00
Ian Barwick ae634100a3 "standby switchover": sanity-check remote "repmgr" binary before proceeding 2017-08-31 11:00:14 +09:00
Ian Barwick 8e35a415a9 Refactor extraction of value to use for "primary_conninfo"
Also add improved error detection.

Basically in the worst case we want to enable the user to clone a standby
from Barman even if the upstream node is not running/reachable, as long as
the user explicitly provides a string to use for "primary_conninfo".
2017-08-31 09:59:30 +09:00
Ian Barwick dfb796ca8f Check config file *before* checking command line parameters
Validity of command line parameters may depened on settings in the configuration
file.
2017-08-31 09:55:32 +09:00
Ian Barwick 13f2d46e92 "standby clone": exit with 0 after successful --dry-run 2017-08-30 10:00:48 +09:00
Ian Barwick 8b03859dbe "standby clone": add early sanity check for external configuration files
This still requires an SSH connection, so we need to check early before
the cloning starts, and also emit useful information for --dry-run.
2017-08-29 22:11:16 +09:00