mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-24 15:46:29 +00:00
Changes in repmgr are:
- Add checks to test if the directories are useful for us (basically the checks follow the same approach as initdb does) - Add connection parameters - Better use of rsync - Some more clean up of code Changes in repmgrd are: - Add a parameter to allow the user specify an repmgr.conf - Change the name of the repl_status table for repl_monitor - Create a repl_status view that also shows lag in time - Some more clean up of code
This commit is contained in:
34
repmgr.sql
34
repmgr.sql
@@ -1,17 +1,37 @@
|
||||
drop table if exists repl_nodes;
|
||||
|
||||
/*
|
||||
* The table repl_nodes keeps information about all machines in
|
||||
* a cluster
|
||||
*/
|
||||
CREATE TABLE repl_nodes (
|
||||
id integer primary key,
|
||||
cluster text not null,
|
||||
conninfo text not null
|
||||
cluster text not null, -- Name to identify the cluster
|
||||
conninfo text not null
|
||||
);
|
||||
|
||||
drop table if exists repl_status;
|
||||
|
||||
CREATE TABLE repl_status(
|
||||
/*
|
||||
* Keeps monitor info about every node and their "position" relative
|
||||
* to primary
|
||||
*/
|
||||
CREATE TABLE repl_monitor(
|
||||
primary_node INTEGER NOT NULL,
|
||||
standby_node INTEGER NOT NULL,
|
||||
last_monitor_timestamp TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
last_wal_primary_location TEXT NOT NULL,
|
||||
last_monitor_time TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
last_wal_primary_location TEXT NOT NULL,
|
||||
last_wal_standby_location TEXT NOT NULL,
|
||||
replication_lag BIGINT NOT NULL,
|
||||
apply_lag BIGINT NOT NULL
|
||||
replication_lag BIGINT NOT NULL,
|
||||
apply_lag BIGINT NOT NULL
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* A useful view
|
||||
*/
|
||||
CREATE VIEW repl_status AS
|
||||
SELECT *, now() - (select max(last_monitor_time) from repl_monitor b
|
||||
where b.primary_node = a.primary_node
|
||||
and b.standby_node = a.standby_node)
|
||||
FROM repl_monitor;
|
||||
|
||||
Reference in New Issue
Block a user