Posts

Showing posts with the label repmgr
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

How to configure Repmgr in postgresrel Replication and how to monitor that and how to perform Switchover/Failover and How to taking backup using barman tools

In this Tutorial Explained about How to configure Repmgr in postgresrel Replication and how to monitor that and how to perform Switchover/Failover and How to taking backup using barman tools. First, install postgres and repmgr on all'a dem nodes: echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list apt-get install wget ca-certificates wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - apt-get update apt-get install postgresql-9.5 postgresql-9.5-repmgr Edit  /etc/postgresql/9.5/main/pg_hba.conf  to include all your nodes: host replication postgres 192.168.142.30/32 md5 host replication postgres 192.168.142.31/32 md5 host replication postgres 192.168.142.32/32 md5 host all postgres 192.168.142.30/32 md5 host all postgres 192.168.142.31/32 md5 host...

PostgreSQL Replication slot

Configuration You can create a replication slot like this: postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot'); slot_name | xlog_position -------------+--------------- node_a_slot | postgres=# SELECT * FROM pg_replication_slots; slot_name | slot_type | datoid | database | active | xmin | restart_lsn | confirmed_flush_lsn -------------+-----------+--------+----------+--------+------+-------------+--------------------- node_a_slot | physical | | | f | | | (1 row) To configure the standby to use this slot,  primary_slot_name  should be configured in the standby's  recovery.conf . Here is a simple example: standby_mode = 'on' primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass' primary_slot_name = 'node_a_slot'

How to configure Replication Manager (repmgr) ?

`repmgr` is a suite of open-source tools to manage replication and failover within a cluster of PostgreSQL servers. It enhances PostgreSQL's built-in replication capabilities with utilities to set up standby servers, monitor replication, and perform administrative tasks such as failover or switchover operations. The current `repmgr` version (3.3) supports all PostgreSQL versions from 9.3 to 9.6. Overview The repmgr suite provides two main tools: 1.repmgr - a command-line tool used to perform administrative tasks such as: - setting up standby servers - promoting a standby server to master - switching over master and standby servers - displaying the status of servers in the replication cluster 2.repmgrd is a daemon which actively monitors servers in a replication cluster and performs the following tasks: - monitoring and recording replication performance - performing failover by detecting failure of the master and promoting the most ...