Make the monitoring history capabilities of repmgr be optional and

turned off by default. Most of it has been superseeded by
pg_stat_replication view, we can still start it by using the switch
--monitoring-history
This commit is contained in:
Jaime Casanova
2012-07-06 01:51:22 -05:00
parent 41dbc39527
commit bf241ba1d6
2 changed files with 13 additions and 7 deletions

View File

@@ -1013,6 +1013,7 @@ The output from this program looks like this::
--help show this help, then exit
--version output version information, then exit
--verbose output verbose activity information
--monitoring-history track advance or lag of the replication in every standby in repl_monitor
-f, --config_file=PATH database to connect to
repmgrd monitors a cluster of servers.
@@ -1043,6 +1044,10 @@ Lag monitoring
repmgrd helps monitor a set of master and standby servers. You can
see which node is the current master, as well as how far behind each
is from current.
To activate the monitor capabilities of repmgr you must include the
option --monitoring-history when running it::
repmgrd --monitoring-history --config-file=/path/to/repmgr.conf &
To look at the current lag between primary and each node listed
in ``repl_node``, consult the ``repl_status`` view::

View File

@@ -65,7 +65,7 @@ const char *progname;
char *config_file = DEFAULT_CONFIG_FILE;
bool verbose = false;
bool no_history = false;
bool monitoring_history = false;
char repmgr_schema[MAXLEN];
/*
@@ -114,7 +114,7 @@ main(int argc, char **argv)
{
{"config", required_argument, NULL, 'f'},
{"verbose", no_argument, NULL, 'v'},
{"no-history", no_argument, NULL, 'N'},
{"monitoring-history", no_argument, NULL, 'm'},
{NULL, 0, NULL, 0}
};
@@ -139,7 +139,7 @@ main(int argc, char **argv)
}
}
while ((c = getopt_long(argc, argv, "f:v:N", long_options, &optindex)) != -1)
while ((c = getopt_long(argc, argv, "f:v:m", long_options, &optindex)) != -1)
{
switch (c)
{
@@ -149,8 +149,8 @@ main(int argc, char **argv)
case 'v':
verbose = true;
break;
case 'N':
no_history = true;
case 'm':
monitoring_history = true;
break;
default:
usage();
@@ -358,7 +358,7 @@ WitnessMonitor(void)
}
/* Fast path for the case where no history is requested */
if (no_history)
if (!monitoring_history)
return;
/*
@@ -479,7 +479,7 @@ StandbyMonitor(void)
}
/* Fast path for the case where no history is requested */
if (no_history)
if (!monitoring_history)
return;
/*
@@ -925,6 +925,7 @@ void help(const char *progname)
printf(_(" --help show this help, then exit\n"));
printf(_(" --version output version information, then exit\n"));
printf(_(" --verbose output verbose activity information\n"));
printf(_(" --monitoring-history track advance or lag of the replication in every standby in repl_monitor\n"));
printf(_(" -f, --config_file=PATH configuration file\n"));
printf(_("\n%s monitors a cluster of servers.\n"), progname);
}