From 1bdc72a07b43838ced7bdb11713602a08cd551cb Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 26 Dec 2016 11:45:58 +0900 Subject: [PATCH] Updates to README and --help output --- README.md | 33 +++++++++++++++++++++------------ repmgr.c | 7 +++---- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b72de161..2b404de6 100644 --- a/README.md +++ b/README.md @@ -243,14 +243,14 @@ command line options: ### Logging -By default `repmgr` and `repmgrd` will log directly to `STDERR`. For `repmgrd` we -recommend capturing output in a logfile or using your system's log facility; +By default `repmgr` and `repmgrd` will log directly to `STDERR`. For `repmgrd` +we recommend capturing output in a logfile or using your system's log facility; see `repmgr.conf.sample` for details. -As a command line utility, `repmgr` will normally log directly to the console - -this is a change in behaviour from previous versions, where it would always -log to the same location as `repmgrd`. However in some circumstances, e.g. when -`repmgr` is executed by `repmgrd` during a failover event, it makes sense to +As a command line utility, `repmgr` will directly to the console by default +(this is a change in behaviour from versions before 3.3, where it would always +log to the same location as `repmgrd`). However in some circumstances, such as +when `repmgr` is executed by `repmgrd` during a failover event, it makes sense to capture `repmgr`'s log output - this can be done by supplying the command-line option `--log-to-file` to `repmgr`. @@ -289,14 +289,14 @@ Setting up a simple replication cluster with repmgr The following section will describe how to set up a basic replication cluster with a master and a standby server using the `repmgr` command line tool. It is assumed PostgreSQL is installed on both servers in the cluster, -`rsync` is available and password-less SSH connections are possible between +`rsync` is available and passwordless SSH connections are possible between both servers. * * * > *TIP*: for testing `repmgr`, it's possible to use multiple PostgreSQL > instances running on different ports on the same computer, with -> password-less SSH access to `localhost` enabled. +> passwordless SSH access to `localhost` enabled. * * * @@ -736,13 +736,22 @@ string passed to `repmgr` with `-d/--dbname` (see above for details), and/or set appropriate environment variables. Note that PostgreSQL will always set explicit defaults for `sslmode` and -`sslcompression`. +`sslcompression` (and from PostgreSQL 10.0 also `target_session_attrs`). If `application_name` is set in the standby's `conninfo` parameter in `repmgr.conf`, this value will be appended to `primary_conninfo`, otherwise `repmgr` will set `application_name` to the same value as the `node_name` parameter. +By default `repmgr` assumes the user who owns the `repmgr` metadatabase will +also be the replication user; a different replication user can be specified +with `--replication-user`. + +If the upstream server requires a password, and this was provided via +`PGPASSWORD`, `.pgpass` etc., by default `repmgr` will include this in +`primary_conninfo`. Use the command line option `--no-conninfo-password` to +suppress this. + Setting up cascading replication with repmgr -------------------------------------------- @@ -1555,7 +1564,7 @@ which contains connection details for the local database. bootstrapping new installations. To update an existing but 'stale' data directory (for example belonging to a failed master), `rsync` must be used by specifying `--rsync-only`. In this case, - password-less SSH connections between servers are required. + passwordless SSH connections between servers are required. * `standby promote` @@ -1575,7 +1584,7 @@ which contains connection details for the local database. Promotes a standby to master and demotes the existing master to a standby. This command must be run on the standby to be promoted, and requires a - password-less SSH connection to the current master. Additionally the + passwordless SSH connection to the current master. Additionally the location of the master's `repmgr.conf` file must be provided with `-C/--remote-config-file`. @@ -1682,7 +1691,7 @@ which contains connection details for the local database. overview of connections between all databases in the cluster. These commands require a valid `repmgr.conf` file on each node. - Additionally password-less `ssh` connections are required between + Additionally passwordless `ssh` connections are required between all nodes. Example 1 (all nodes up): diff --git a/repmgr.c b/repmgr.c index 6521019a..8e70ab03 100644 --- a/repmgr.c +++ b/repmgr.c @@ -6569,7 +6569,7 @@ do_help(void) printf(_(" --upstream-conninfo 'primary_conninfo' value to write in recovery.conf\n" \ " when the intended upstream server does not yet exist\n")); printf(_(" --recovery-min-apply-delay=VALUE set recovery_min_apply_delay in recovery.conf (PostgreSQL 9.4 and later)\n")); - printf(_(" --replication-user username to set in 'primary_conninfo' in recovery.conf\\n")); + printf(_(" --replication-user username to set in 'primary_conninfo' in recovery.conf\n")); printf(_(" --without-barman do not use Barman even if configured\n")); printf(_(" -w, --wal-keep-segments minimum value for the GUC wal_keep_segments (default: %s)\n"), DEFAULT_WAL_KEEP_SEGMENTS); @@ -6580,11 +6580,10 @@ do_help(void) " standby (optional timeout in seconds)\n")); printf(_(" --recovery-min-apply-delay=VALUE (standby follow) set recovery_min_apply_delay\n" \ " in recovery.conf (PostgreSQL 9.4 and later)\n")); - printf(_(" --replication-user (standby follow) username to set in 'primary_conninfo' in recovery.conf\\n")); + printf(_(" --replication-user (standby follow) username to set in 'primary_conninfo' in recovery.conf\n")); printf(_(" -W, --wait (standby follow) wait for a master to appear\n")); printf(_(" -m, --mode (standby switchover) shutdown mode (\"fast\" - default, \"smart\" or \"immediate\")\n")); - printf(_(" -C, --remote-config-file (standby switchover) path to the configuration file on\n" \ - " the current master\n")); + printf(_(" -C, --remote-config-file (standby switchover) path to the configuration file on the current master\n")); printf(_(" --pg_rewind[=VALUE] (standby switchover) 9.3/9.4 only - use pg_rewind if available,\n" \ " optionally providing a path to the binary\n")); printf(_(" -k, --keep-history=VALUE (cluster cleanup) retain indicated number of days of history (default: 0)\n"));