15.2. Configuration

A sample configuration for repmgr.conf on each BDR node would look like this:

        # Node information
        node_id=1
        node_name='node1'
        conninfo='host=node1 dbname=bdrtest user=repmgr connect_timeout=2'
        data_directory='/var/lib/postgresql/data'
        replication_type='bdr'

        # Event notification configuration
        event_notifications=bdr_failover
        event_notification_command='/path/to/bdr-pgbouncer.sh %n %e %s "%c" "%a" >> /tmp/bdr-failover.log 2>&1'

        # repmgrd options
        monitor_interval_secs=5
        reconnect_attempts=6
        reconnect_interval=5

Adjust settings as appropriate; copy and adjust for the second node (particularly the values node_id, node_name and conninfo).

Note that the values provided for the conninfo string must be valid for connections from both nodes in the replication cluster. The database must be the BDR-enabled database.

If defined, the event_notifications parameter will restrict execution of the script defined in event_notification_command to the specified event(s).

Note

event_notification_command is the script which does the actual "heavy lifting" of reconfiguring the proxy server/ connection pooler. It is fully user-definable; see section Defining the BDR failover "event_notification command" for a reference implementation.