Configuration file

Default configuration file

The default configuration file contents are:

## $Id: eranger-replication.cfg 21976 2017-01-06 16:33:29Z abianchi $
##
## You *MUST* set [primary].ip and [standby].host to set up replication
## This file must be identical on primary, standby and all external collectors
##
## to activate NAT:
##   - uncomment and edit "192.168.1.37=10.1.0.43"
##        where 192.168.1.37 is the physical-IP as seen from postgresql
##        and 10.1.0.43 is the NAT-IP as seen from eranger-collector
##   - uncomment section title "[NAT]"

# pid_file=/var/opt/run/eranger-replication.pid
# replication_script=/opt/eranger/bin/eranger-server-replication.pl
# remote_tmp=/var/tmp
# local_tmp=${TEMP:-/tmp}
# scp_command=scp -Cp
# ssh_command=ssh -C
# ssh_user=reranger

#
# [NAT]
# 192.168.1.37=10.1.0.43
# 192.168.1.38=10.1.0.42

# [db]
# user=replication

# [primary]
# ip=

## if primary.email is non empty, standby will send email if primary is down
# [standby]
# host=
# email=
# email_status=/var/opt/run/eranger/collector/tmp/replication.status
# server_ping=/opt/eranger/bin/eranger-server-ping.pl

# # owner of /var/lib/pgsql/data:
# [postgresql]
# group=postgres
# user=postgres

## if a machine has more than one configured ethernet interface
# ifconfig-first-ip = ip-to-be-used
# [my_own_ip]
# 10.1.0.60=10.1.0.60
# 192.168.0.60=10.1.0.60

## scripts to be executed before and after switch
# [scripts]
# pre_script=
# post_script=
# pre_timeout=30
# post_timeout=30

Minimum configuration

A minimum valid configuration for the layout shown in section Database replication concept is shown here:

[primary]
ip=10.1.0.88

[standby]
host=10.1.0.89
email=support@skoor.com

Sections [primary] and [standby] define which system will be the default primary/standby. The email entry defines who will receive one (exactly one) email, once the standby detects that the SKOOR engine is not running anymore on the primary.

The configuration files on the primary, the standby and all external collectors (if any) must be identical, otherwise the script will complain. So edit the file on the primary and then use e.g. scp to transfer it from primary to standby  and all external collectors.

Multiple network interfaces

Section [my_own_ip] is only required, if primary and/or standby server have more than one configured network interface. In this case, enable the section (uncomment) and add one line for each configured interface. The following example assumes both primary and standby have each 3 interfaces:

primary

standby

IP 1

10.1.0.88

10.1.0.89

IP 2

159.144.132.95

159.144.132.156

IP 3

10.251.25.30

10.251.25.243

With this setup, add the following lines:

[my_own_ip]
10.1.0.88=10.1.0.88
159.144.132.95=10.1.0.88
10.251.25.30=10.1.0.88
10.1.0.89=10.1.0.89
159.144.132.156=10.1.0.89
10.251.25.243=10.1.0.89

On the left side specify each IP address available on primary or standby, on the right side the IP that will be used for replication on the given system. The first 3 lines are used to map the interfaces for the primary, the last 3 lines for the standby.

NAT configuration

Section [NAT] will only be used if the external collectors are connecting to the server using a NAT address. The line is read like:

<IP of physical interface of primary>=<NAT IP of primary>
<IP of physical interface of standby >=<NAT IP of standby>