The cluster properties file v4
Each node in a Failover Manager cluster has a properties file (by default, named efm.properties
) that contains the properties of the individual node on which it resides. The Failover Manager installer creates a file template for the properties file named efm.properties.in
in the /etc/edb/efm-4.<x>
directory.
After completing the Failover Manager installation, make a working copy of the template before modifying the file contents:
# cp /etc/edb/efm-4.10/efm.properties.in /etc/edb/efm-4.10/efm.properties
After copying the template file, change the owner of the file to efm:
# chown efm:efm efm.properties
Note
By default, Failover Manager expects the cluster properties file to be named efm.properties
. If you name the properties file something other than efm.properties
, modify the service script or unit file to instruct Failover Manager to use a different name.
After creating the cluster properties file, add or modify configuration parameter values as required. For detailed information about each property, see Specifying cluster properties.
The property files are owned by root. The Failover Manager service script expects to find the files in the /etc/edb/efm-4.<x>
directory. If you move the property file to another location, you must create a symbolic link that specifies the new location.
Note
All user scripts referenced in the properties file are invoked as the Failover Manager user.
Specifying cluster properties
You can use the properties listed in the cluster properties file to specify connection properties and behaviors for your Failover Manager cluster. Modifications to property settings are applied when Failover Manager starts. If you modify a property value, you must restart Failover Manager to apply the changes.
Property values are case sensitive. While Postgres uses quoted strings in parameter values, Failover Manager doesn't allow quoted strings in property values. For example, while you might specify an IP address in a Postgres configuration parameter as:
listen_addresses='192.168.2.47'
With Failover Manager, don't enclose the value in quotes:
bind.address=192.168.2.54:7800
Use the properties in the efm.properties
file to specify connection, administrative, and operational details for Failover Manager.
Legends: In the following table:
A
: Required on primary or standby nodeW
: Required on witness nodeY
: Yes
Property name | A | W | Default value | Comments |
---|---|---|---|---|
db.user | Y | Y | Username for the database. | |
db.password.encrypted | Y | Y | Password encrypted using 'efm encrypt'. | |
db.port | Y | Y | This value must be same for all the agents. | |
db.database | Y | Y | Database name. | |
db.service.owner | Y | Owner of $PGDATA dir for db.database. | ||
db.service.name | Required if running the database as a service. | |||
db.bin | Y | Directory containing the pg_controldata/pg_ctl commands such as '/usr/edb/asnn/bin'. | ||
db.data.dir | Y | Same as the output of query 'show data_directory;' | ||
db.config.dir | Same as the output of query 'show config_file;'. Specify if it's not the same as db.data.dir. | |||
jdbc.sslmode | Y | Y | disable | See the note. |
user.email | This value must be same for all the agents; can be left blank if using a notification script. | |||
from.email. | efm@localhost | Leave blank to use the default efm@localhost. | ||
notification.level | Y | Y | INFO | See the list of notifications. |
notification.text.prefix | ||||
script.notification | Required if user.email property is not used; both parameters can be used together. | |||
bind.address | Y | Y | Example: <ip_address>:<port> | |
external.address | Example: <ip_address/hostname> | |||
admin.port | Y | Y | 7809 | Modify if the default port is already in use. |
is.witness | Y | Y | See description. | |
local.period | Y | 10 | ||
local.timeout | Y | 60 | ||
local.timeout.final | Y | 10 | ||
remote.timeout | Y | Y | 10 | |
node.timeout | Y | Y | 50 | This value must be same for all the agents. |
encrypt.agent.messages | Y | Y | false | This value must be same for all the agents |
enable.stop.cluster | true | This value must be same for all the agents. Available in Failover Manager 4.2 and later. | ||
stop.isolated.primary | Y | true | This value must be same for all the agents. | |
stop.failed.primary | Y | true | ||
primary.shutdown.as.failure | Y | Y | false | |
update.physical.slots.period | Y | 0 | ||
ping.server.ip | Y | Y | 8.8.8.8 | |
ping.server.command | Y | Y | /bin/ping -q -c3 -w5 | |
auto.allow.hosts | Y | Y | false | |
stable.nodes.file | Y | Y | false | |
db.reuse.connection.count | Y | 0 | ||
auto.failover | Y | Y | true | |
auto.reconfigure | Y | true | This value must be same for all the agents. | |
promotable | Y | true | ||
use.replay.tiebreaker | Y | Y | true | This value must be same for all the agents. |
standby.restart.delay | 0 | |||
application.name | Set to replace the application_name portion of the primary_conninfo entry with this property value before starting the original primary database as a standby. | |||
restore.command | Example: restore.command=scp <db_service_owner>@%h: <archive_path>/%f %p | |||
reconfigure.num.sync | Y | false | If you are on Failover Manager 4.1, see reconfigure_num_sync_max to raise num_sync. | |
reconfigure.num.sync.max | Available in Failover Manager 4.1 and later. | |||
reconfigure.sync.primary | Y | false | ||
minimum.standbys | Y | Y | 0 | This value must be same for all the nodes. |
priority.standbys | Available in Failover Manager 4.2 and later. | |||
recovery.check.period | Y | 1 | ||
restart.connection.timeout | 60 | |||
auto.resume.period | Y | 0 | ||
virtual.ip | (see virtual.ip.single) | Leave blank if you do not specify a VIP. | ||
virtual.ip.interface | Required if you specify a VIP. | |||
virtual.ip.prefix | Required if you specify a VIP. | |||
virtual.ip.single | Y | Y | Yes | This value must be same for all the nodes. |
check.vip.before.promotion | Y | Y | Yes | |
pgpool.enable | false | Available in Failover Manager 4.1 and later. | ||
pcp.user | Required if pgpool.enable is set to true. Available in Failover Manager 4.1 and later. | |||
pcp.host | Required if pgpool.enable is set to true, this value must be same for all the agents. Available in Failover Manager 4.1 and later. | |||
pcp.port | Required if pgpool.enable is set to true, this value must be same for all the agents. Available in Failover Manager 4.1 and later. | |||
pcp.pass.file | Required if pgpool.enable is set to true. Available in Failover Manager 4.1 and later. | |||
pgpool.bin | Required if pgpool.enable is set to true. Available in Failover Manager 4.1 and later. | |||
script.load.balancer.attach | Example: script.load.balancer.attach= /<path>/<attach_script> %h %t | |||
script.load.balancer.detach | Example: script.load.balancer.detach= /<path>/<detach_script> %h %t | |||
detach.on.agent.failure | true | Set to false if you want to keep a running primary database attached. Available in Failover Manager 4.2 and later. | ||
script.fence | Example: script.fence= /<path>/<script_name> %p %f | |||
script.post.promotion | Example: script.post.promotion= /<path>/<script_name> %f %p | |||
script.resumed | Example: script.resumed= /<path>/<script_name> | |||
script.db.failure | Example: script.db.failure= /<path>/<script_name> | |||
script.primary.isolated | Example: script.primary.isolated= /<path>/<script_name> | |||
script.remote.pre.promotion | Example: script.remote.pre.promotion= /<path>/<script_name> %p | |||
script.remote.post.promotion | Example: script.remote.post.promotion= /<path>/<script_name> %p | |||
script.custom.monitor | Example: script.custom.monitor= /<path>/<script_name> | |||
custom.monitor.interval | Required if a custom monitoring script is specified. | |||
custom.monitor.timeout | Required if a custom monitoring script is specified. | |||
custom.monitor.safe.mode | Required if a custom monitoring script is specified. | |||
sudo.command | Y | Y | sudo | |
sudo.user.command | Y | Y | sudo -u %u | |
lock.dir | If not specified, defaults to '/var/lock/efm-<version>' | |||
log.dir | If not specified, defaults to '/var/log/efm-<version>' | |||
syslog.host | localhost | |||
syslog.port | 514 | |||
syslog.protocol | ||||
syslog.facility | UDP | |||
file.log.enabled | Y | Y | true | |
syslog.enabled | Y | Y | false | |
jgroups.loglevel | info | |||
efm.loglevel | info | |||
jvm.options | -Xmx128m |
Cluster properties
Use the following properties to specify connection details for the Failover Manager cluster:
# The value for the password property should be the output from # 'efm encrypt' -- do not include a cleartext password here. To # prevent accidental sharing of passwords among clusters, the # cluster name is incorporated into the encrypted password. If # you change the cluster name (the name of this file), you must # encrypt the password again with the new name. # The db.port property must be the same for all nodes. db.user= db.password.encrypted= db.port= db.database=
The db.user
specified must have enough privileges to invoke selected PostgreSQL commands on behalf of Failover Manager. For more information, see Prerequisites.
For information about encrypting the password for the database user, see Encrypting your database password.
Use the db.service.owner
property to specify the name of the operating system user that owns the cluster that is being managed by Failover Manager. This property isn't required on a dedicated witness node.
# This property tells EFM which OS user owns the $PGDATA dir for # the 'db.database'. By default, the owner is either 'postgres' # for PostgreSQL or 'enterprisedb' for EDB Postgres Advanced # Server. However, if you have configured your db to run as a # different user, you will need to copy the /etc/sudoers.d/efm-XX # conf file to grant the necessary permissions to your db owner. # # This username must have write permission to the # 'db.data.dir' specified below. db.service.owner=
Specify the name of the database service in the db.service.name
property if you use the service
or systemctl
command when starting or stopping the service.
# Specify the proper service name in order to use service commands # rather than pg_ctl to start/stop/restart a database. For example, if # this property is set, then 'service <name> restart' or 'systemctl # restart <name>' # (depending on OS version) will be used to restart the database rather # than pg_ctl. # This property is required if running the database as a service. db.service.name=
Use the same service control mechanism (pg_ctl
, service
, or systemctl
) each time you start or stop the database service. If you use the pg_ctl
program to control the service, specify the location of the pg_ctl
program in the db.bin
property.
# Specify the directory containing the pg_controldata/pg_ctl commands, # for example: # /usr/edb/as12/bin. Unless the db.service.name property is used, the # pg_ctl command is used to start/stop/restart databases as needed # after a failover or switchover. This property is required. db.bin=
Use the db.data.dir
property to specify the location where a standby.signal
or recovery.conf
file will be created. This property is required on primary and standby nodes. It isn't required on a dedicated witness node.
# This is the directory where a standby.signal file will exist for a standby node. # If a primary database fails, a recovery.conf file will be written in this # location to ensure that the failed database can not be restarted as the # primary database. # This corresponds to database environment variable PGDATA and should be same # as the output of query 'show data_directory;' on respective database. db.data.dir=
Use the db.config.dir
property to specify the location of database configuration files if they aren't stored in the same directory as the recovery.conf
or standby.signal
file. This is the value specified by the config_file
parameter directory of your EDB Postgres Advanced Server or PostgreSQL installation. This value is used as the location of the EDB Postgres Advanced Server data
directory when stopping, starting, or restarting the database.
# Specify the location of database configuration files if they are # not contained in the same location as the standby.signal # file. This is most likely the case for Debian installations. The location # specified will be used as the -D value (the location of the data directory # for the cluster) when calling pg_ctl to start or stop the database. # If this property is blank, the db.data.dir location specified by the # db.data.dir property will be used. # This corresponds to the output of query 'show config_file;' on respective database. db.config.dir=
For more information about database configuration files, visit the PostgreSQL website.
Use the jdbc.sslmode
property to instruct Failover Manager to use SSL connections. By default, SSL is disabled.
# Use the jdbc.sslmode property to enable ssl for EFM # connections. Setting this property to anything but 'disable' # will force the agents to use 'ssl=true' for all JDBC database # connections (to both local and remote databases). # Valid values are: # # disable - Do not use ssl for connections. # verify-ca - EFM will perform CA verification before allowing # the certificate. # require - Verification will not be performed on the server # certificate. jdbc.sslmode=disable
Note
If you set the value of jdbc.sslmode
to verify-ca
and you want to use Java trust store for certificate validation, you need to set the following value. This line can be added anywhere in the cluster properties file:
jdbc.properties=sslfactory=org.postgresql.ssl.DefaultJavaSSLFactory
For information about configuring and using SSL, see Secure TCP/IP Connections with SSL and Using SSL in the PostgreSQL documentation.
Use the user.email
property to specify an email address (or multiple email addresses) to receive notifications sent by Failover Manager.
# Email address(es) for notifications. The value of this property must # be the same across all agents. Multiple email addresses must # be separated by space. This is required if not using a 'script.notification' # script. Either/both can be used. user.email=
The from.email
property specifies the value to use as the sender's address for email notifications from Failover Manager. You can:
- Leave
from.email
blank to use the default value (efm@localhost
). - Specify a custom value for the email address.
- Specify a custom email address, using the
%h
placeholder to represent the name of the node host (for example, example@%h). The placeholder is replaced with the name of the host as returned by the Linux hostname utility.
For more information about notifications, see Notifications.
# Use the from.email property to specify the from email address that # will be used for email notifications. Use the %h placeholder to # represent the name of the node host (e.g. example@%h). The # placeholder will be replaced with the name of the host as returned # by the hostname command. # Leave blank to use the default, efm@localhost. from.email=
Use the notification.level
property to specify the minimum severity level at which Failover Manager sends user notifications or when a notification script is called. For a complete list of notifications, see Notifications.
# Minimum severity level of notifications that will be sent by # the agent. The minimum level also applies to the notification # script (below). Valid values are INFO, WARNING, and SEVERE. # A list of notifications is grouped by severity in the user's # guide. notification.level=INFO
Use the notification.text.prefix
property to specify the text to add to the beginning of every notification.
# Text to add to the beginning of every notification. This could # be used to help identify what the cluster is used for, the role # of this node, etc. To use multiple lines, add a backslash \ to # the end of a line of text. To include a newline use \n. # Example: # notification.text.prefix=Development cluster for Example dept.\n\ # Used by Dev and QA \ # See Example group for questions. notification.text.prefix=
Use the script.notification
property to specify the path to a user-supplied script that acts as a notification service. The script is passed a message subject and a message body. The script is invoked each time Failover Manager generates a user notification.
# Absolute path to script run for user notifications. # # This is an optional user-supplied script that can be used for # notifications instead of email. This is required if not using # email notifications. Either/both can be used. The script will # be passed two parameters: the message subject and the message # body. script.notification=
The bind.address
property specifies the IP address and port number of the agent on the current node of the Failover Manager cluster.
# This property specifies the ip address and port that jgroups # will bind to on this node. The value is of the form # <ip>:<port>. # Note that the port specified here is used for communicating # with other nodes, and is not the same as the admin.port below, # used only to communicate with the local agent to send control # signals. # For example, <provide_your_ip_address_here>:7800 bind.address=
Use the external.address
property to specify the IP address or hostname to use for communication with all other Failover Manager agents in a NAT environment.
# This is the ip address/hostname to be used for communication with all # other Failover Manager agents. All traffic towards this address # should be routed by the network to the bind.address of the node. # The value is in the ip/hostname format only. This address will be # used in scenarios where nodes are on different networks and broadcast # an IP address other than the bind.address to the external world. external.address=
Use the admin.port
property to specify a port on which Failover Manager listens for administrative commands.
# This property controls the port binding of the administration # server which is used for some commands (ie cluster-status). The # default is 7809; you can modify this value if the port is # already in use. admin.port=7809
Set the is.witness
property to true
to indicate that the current node is a witness node. If is.witness
is true
, the local agent doesn't check to see if a local database is running.
# Specifies whether or not this is a witness node. Witness nodes # do not have local databases running. is.witness=
The EDB Postgres Advanced Server pg_is_in_recovery()
function is a Boolean function that reports the recovery state of a database. The function returns true
if the database is in recovery or false
if the database isn't in recovery. When an agent starts, it connects to the local database and invokes the pg_is_in_recovery()
function.
- If the server responds true, the agent assumes the role of standby.
- If the server responds false, the agent assumes the role of primary.
- If there's no local database, the agent assumes an idle state.
Note
If is.witness
is true
, Failover Manager doesn't check the recovery state.
The following properties apply to the local server:
- The
local.period
property specifies the number of seconds between attempts to contact the database server. - The
local.timeout
property specifies the number of seconds an agent waits for a positive response from the local database server. - The
local.timeout.final
property specifies the number of seconds an agent waits after the previous checks have failed to contact the database server on the current node. If a response isn't received from the database within the number of seconds specified by thelocal.timeout.final
property, the database is assumed to have failed.
For example, given the default values of these properties, a check of the local database happens once every 10 seconds. If an attempt to contact the local database doesn't come back positive within 60 seconds, Failover Manager makes a final attempt to contact the database. If a response isn't received within 10 seconds, Failover Manager declares database failure and notifies the administrator listed in the user.email
property. These properties aren't required on a dedicated witness node.
# These properties apply to the connection(s) EFM uses to monitor # the local database. Every 'local.period' seconds, a database # check is made in a background thread. If the main monitoring # thread does not see that any checks were successful in # 'local.timeout' seconds, then the main thread makes a final # check with a timeout value specified by the # 'local.timeout.final' value. All values are in seconds. # Whether EFM uses single or multiple connections for database # checks is controlled by the 'db.reuse.connection.count' # property. local.period=10 local.timeout=60 local.timeout.final=10
If necessary, modify these values to suit your business model.
Use the remote.timeout
property to limit how many seconds an agent waits for a response from a remote agent or database. Agents only send messages to each other during cluster events. Examples include:
- Attempting to connect to a remote database that may have failed and asking other agents if they can connect.
- A primary agent requesting recovery settings from a standby agent as part of a switchover.
- Telling nodes to prepare to shut down when stopping the Failover Manager cluster.
# Timeout for a call to check if a remote database is responsive. # For example, this is how long a standby would wait for a # DB ping request from itself and the witness to the primary DB # before performing failover. remote.timeout=10
Use the node.timeout
property to specify the number of seconds for an agent to wait for a heartbeat from another node when determining if a node has failed.
# The total amount of time in seconds to wait before determining # that a node has failed or been disconnected from this node. # # The value of this property must be the same across all agents. node.timeout=50
Summary/comparison of timeout properties
- The
local.*
properties are for failure detection of an agent's local database. - The
node.timeout
property is for failure detection of other nodes. - The
remote.timeout
property limits how long agents wait for responses from other agents.
Use the encrypt.agent.messages
property to specify whether to encrypt the messages sent between agents.
# Set to true to encrypt messages that are sent between agents. # This property must be the same on all agents or else the agents # will not be able to connect. encrypt.agent.messages=false
Use the enable.stop.cluster
property to enable or disable the stop-cluster
command. The command is a convenience in some environments but can cause issues when unintentionally invoked. In Eager Failover mode, the command results in stopping EDB Postgres Advanced Server without failover.
# Whether or not the 'efm stop-cluster <cluster name>' command is enabled. # Set to false to disable the command, in which case all Failover # Manager agents must be stopped individually. Note that stopping each # agent separately will change the .nodes files on remaining agents # unless stable.nodes.file is also true. This property value must # be the same on all agents if set. The default is true if not set. enable.stop.cluster=true
Use the stop.isolated.primary
property to instruct Failover Manager to shut down the database if a primary agent detects that it's isolated. When true
(the default), Failover Manager stops the database before invoking the script specified in the script.primary.isolated
property.
# Shut down the database after a primary agent detects that it has # been isolated from the majority of the efm cluster. If set to # true, efm will stop the database before running the # 'script.primary.isolated' script, if a script is specified. stop.isolated.primary=true
Use the stop.failed.primary
property to instruct Failover Manager to attempt to shut down a primary database if it can't reach the database. If true
, Failover Manager runs the script specified in the script.db.failure
property after attempting to shut down the database.
# Attempt to shut down a failed primary database after EFM can no # longer connect to it. This can be used for added safety in the # case a failover is caused by a failure of the network on the # primary node. # If specified, a 'script.db.failure' script is run after this attempt. stop.failed.primary=true
Use the primary.shutdown.as.failure
property to treat any shutdown of the Failover Manager agent on the primary node as a failure. If this property is set to true
and the primary agent is shut down, the rest of the cluster treats the shutdown as a failure. This includes any proper shutdown of the agent such as a shutdown of the whole node. None of the timeout properties apply in this case: when the agent exits, the rest of the cluster is notified immediately. After the agent exits, the rest of the cluster performs checks that happen in the case of a primary agent failure. The checks include attempting to connect to the primary database, seeing if the VIP is reachable if used, and so on).
- If the database is reached, a notification is sent informing you of the agent status.
- If the database isn't reached, a failover occurs.
# Treat a primary agent shutdown as an agent failure. This can be set # to true to treat a primary agent shutdown as a failure situation. # Caution should be used when using this feature, as it could # cause an unwanted promotion in the case of performing primary # database maintenance. # Please see the user's guide for more information. primary.shutdown.as.failure=false
The primary.shutdown.as.failure
property is meant to catch user error, rather than failures, such as the accidental shutdown of a primary node. The proper shutdown of a node can appear to the rest of the cluster as if a user has stopped the primary Failover Manager agent, for example to perform maintenance on the primary database. If you set the primary.shutdown.as.failure
property to true
, take care when performing maintenance.
To perform maintenance on the primary database when primary.shutdown.as.failure
is true
, stop the primary agent and wait to receive a notification that the primary agent has failed but the database is still running. Then, it is safe to stop the primary database. Alternatively, you can use the stop-cluster
command to stop all of the agents without performing failure checks.
Use the update.physical.slots.period
property to define the slot advance frequency. When update.physical.slots.period
is set to a positive integer value, the primary agent reads the current restart_lsn
of the physical replication slots after every update.physical.slots.period
seconds. It sends this information with its pg_current_wal_lsn
and primary_slot_name
(if it's set in the postgresql.conf
file) to the standbys. The physical slots must already exist on the primary for the agent to find them. If physical slots don't already exist on the standbys, standby agents create the slots and then update the restart_lsn
parameter for these slots. A non-promotable standby doesn't create new slots but updates them if they exist.
Before updating the restart_lsn
value of a slot, the agent checks to see if an xmin
value has been set, which may happen if this was previously a primary node. If an xmin
value has been set for the slot, the agent drops and recreates the slot before updating the restart_lsn
value.
Note: all slot names, including one set on the current primary if desired, must be unique.
# Period in seconds between having the primary agent update promotable # standbys with physical replication slot information so that # the cluster will continue to use replication slots after a failover. # Set to zero to turn off. update.physical.slots.period=0
Use the ping.server.ip
property to specify the IP address of a server that Failover Manager can use to confirm that network connectivity isn't a problem.
# This is the address of a well-known server that EFM can ping # in an effort to determine network reachability issues. It # might be the IP address of a nameserver within your corporate # firewall or another server that *should* always be reachable # via a 'ping' command from each of the EFM nodes. # # There are many reasons why this node might not be considered # reachable: firewalls might be blocking the request, ICMP might # be filtered out, etc. # # Do not use the IP address of any node in the EFM cluster # (primary, standby, or witness) because this ping server is meant # to provide an additional layer of information should the EFM # nodes lose sight of each other. # # The installation default is Google's DNS server. ping.server.ip=8.8.8.8
Use the ping.server.command
property to specify the command used to test network connectivity.
# This command will be used to test the reachability of certain # nodes. # # Do not include an IP address or hostname on the end of # this command - it will be added dynamically at runtime with the # values contained in 'virtual.ip' and 'ping.server.ip'. # # Make sure this command returns reasonably quickly - test it # from a shell command line first to make sure it works properly. ping.server.command=/bin/ping -q -c3 -w5
Use the auto.allow.hosts
property to instruct the server to use the addresses specified in the .nodes
file of the first node to start to set the allowed host list. Enabling this property by setting auto.allow.hosts
to true
can simplify cluster startup.
# Have the first node started automatically add the addresses from # its .nodes file to the allowed host list. This will make it # faster to start the cluster when the initial set of hosts # is already known. auto.allow.hosts=false
Use the stable.nodes.file
property to instruct the server not to rewrite the nodes file when a node joins or leaves the cluster. This property is most useful in clusters with IP addresses that don't change.
# When set to true, EFM will not rewrite the .nodes file whenever # new nodes join or leave the cluster. This can help starting a # cluster in the cases where it is expected for member addresses # to be mostly static, and combined with 'auto.allow.hosts' makes # startup easier when learning failover manager. stable.nodes.file=false
The db.reuse.connection.count
property allows the administrator to specify the number of times Failover Manager reuses the same database connection to check the database health. The default value is 0, indicating that Failover Manager creates a fresh connection each time. This property isn't required on a dedicated witness node.
# This property controls how many times a database connection is # reused before creating a new one. If set to zero, a new # connection will be created every time an agent pings its local # database. db.reuse.connection.count=0
The auto.failover
property enables automatic failover. By default, auto.failover
is set to true
.
# Whether or not failover will happen automatically when the primary # fails. Set to false if you want to receive the failover notifications # but not have EFM actually perform the failover steps. # The value of this property must be the same across all agents. auto.failover=true
Use the auto.reconfigure
property to instruct Failover Manager to enable or disable automatic reconfiguration of remaining standby servers after the primary standby is promoted to primary. Set the property to true
(the default) to enable automatic reconfiguration or false
to disable automatic reconfiguration. This property isn't required on a dedicated witness node.
# After a standby is promoted, Failover Manager will attempt to # update the remaining standbys to use the new primary. Failover # Manager will change the host parameter of the primary_conninfo # entry in postgresql.auto.conf and restart the database. The # restart command is contained in either the efm_db_functions or # efm_root_functions file; default when not running db as an os # service is: "pg_ctl restart -m fast -w -t <timeout> -D <directory>" # where the timeout is the local.timeout property value and the # directory is specified by db.data.dir. To turn off # automatic reconfiguration, set this property to false. auto.reconfigure=true
Note
primary_conninfo
is a space-delimited list of keyword=value pairs.
Use the promotable
property to indicate not to promote a node. The promotable
property is ignored when a primary agent starts. This simplifies switching back to the original primary after a switchover or failover. To override the setting, use the efm set-priority
command at runtime. For more information about the efm set-priority
command, see Using the efm utility.
# A standby with this set to false will not be added to the # failover priority list, and so will not be available for # promotion. The property will be used whenever an agent starts # as a standby or resumes as a standby after being idle. After # startup/resume, the node can still be added or removed from the # priority list with the 'efm set-priority' command. This # property is required for all non-witness nodes. promotable=true
If the same amount of data was written to more than one standby node and a failover occurs, the use.replay.tiebreaker
value determines how Failover Manager selects a replacement primary. Set the use.replay.tiebreaker
property to true
to instruct Failover Manager to failover to the node that will come out of recovery faster, as determined by the log sequence number. To ignore the log sequence number and promote a node based on user preference, set use.replay.tiebreaker
to false
.
# Use replay LSN value for tiebreaker when choosing a standby to # promote before using failover priority. Set this property to true to # consider replay location as more important than failover priority # (as seen in cluster-status command) when choosing the "most ahead" # standby to promote. use.replay.tiebreaker=true
Use the standby.restart.delay
property to specify the time in seconds for the standby to wait before it gets reconfigured (stoppstarts) to follow the new primary after a promotion.
# Time in seconds for this standby to delay restarting to follow the # primary after a promotion. This can be used to have standbys restart # at different times to increase availability. Caution should be used # when using this feature, as a delayed standby will not be following # the new primary and care must be taken that the new primary retains # enough WAL for the standby to follow it. # Please see the user's guide for more information. standby.restart.delay=0
You can use the application.name
property to provide the name of an application to copy to the primary_conninfo
parameter before restarting an old primary node as a standby.
# During a switchover, recovery settings are copied from a standby # to the original primary. If the application.name property is set, # Failover Manager will replace the application_name portion of the # primary_conninfo entry with this property value before starting # the original primary database as a standby. If this property is # not set, Failover Manager will remove the parameter value # from primary_conninfo. application.name=
Note
Set the application.name
property on the primary and any promotable standby. In the event of a failover/switchover, the primary node can potentially become a standby node again.
Use the restore.command
property to instruct Failover Manager to update the restore_command
value when a new primary is promoted. %h
represents the address of the new primary. Failover Manager replaces %h
with the address of the new primary. %f
and %p
are placeholders used by the server. If the property is left blank, Failover Manager doesn't update the restore_command
values on the standbys after a promotion.
See the PostgreSQL documentation for more information about using a restore_command.
# If the restore_command on a standby restores directly from the # primary node, use this property to have Failover Manager change # the command when a new primary is promoted. # # Use the %h placeholder to represent the address of the new primary. # During promotion it will be replaced with the address of the new # primary. # # If not specified, failover manager will not change the # restore_command value, if any, on standby nodes. # # Example: # restore.command=scp <db service owner>@%h:/var/lib/edb/as12/data/archive/%f %p restore.command=
The database parameter synchronous_standby_names
on the primary node specifies the names and count of the synchronous standby servers that confirm receipt of data to ensure that the primary nodes can accept write transactions. When the reconfigure.num.sync
property is set to true
, Failover Manager reduces the number of synchronous standby servers and reloads the configuration of the primary node to reflect the current value.