Postgres as a Service
Deploy a Managed Postgres Cluster in Minutes! Enterprise-ready and Oracle compatible.
This tutorial describes quickly configuring a Failover Manager cluster in a test environment. Other sections in this guide provide key information that you should read and understand before configuring Failover Manager for a production deployment.
• The example that follows creates a cluster named efm. You should start the configuration process on a master or standby node. Then, you can copy the configuration files to other nodes to save time.cd /etc/edb/efm-3.1
cp efm.properties.in efm.properties
cp efm.nodes.in efm.nodes
chown efm:efm efm.properties
chown efm:efm efm.nodesThe properties file (cluster_name.properties) contains parameters that specify connection properties and behaviors for your Failover Manager cluster. Modifications to property settings are applied when Failover Manager starts.The following properties are the minimal properties required to configure a Failover Manager cluster. If you are configuring a production system, please see Section 3.4.1 for a complete list of properties.Database connection properties; these properties are required even on the witness node so it can connect to other databases when needed:Owner of the data directory (usually postgres or enterprisedb):Only one of the following properties is needed. If you provide the service name, EFM will use a service command to control the database server when necessary. If you provide the location of the Postgres bin directory, EFM will use pg_ctl to control the database server.The data directory in which EFM will find or create recovery.conf file:db.recovery.conf.dirThe email address to which email notifications will be sent; the notification text is also included in the agent log file:user.emailUse the bind.address parameter to specify the local address of the node and the port that will be used by EFM. Other nodes will use this address to reach the agent, and the agent will use this address when connecting to the local database (as opposed to connecting to localhost). An example of the format is included below:bind.address=126.96.36.199:7800If you are running on a network without access to the Internet, set this to an address that is available on your network:When configuring a production cluster, the following properties can be either true or false depending on your system configuration and usage. Set them both to true to simplify startup if you are configuring an EFM test cluster:The cluster members file (cluster_name.nodes) is read at startup to tell an agent how to find the rest of the cluster, or, in the case of the first node started, the file is used to simplify authorization of subsequent nodes.Add the addresses and ports of each node in the cluster to this file. One node will act as a membership coordinator:Please note that the Failover Manager agent will not verify the content of the cluster members file; the agent expects that some of the addresses in the file cannot be reached (for example, if the agent hasn’t been started yet). For more information about the file, see Section 3.4.2.Copy the efm.properties and efm.nodes files to the /etc/edb/efm-3.1 directory on the other nodes in your sample cluster. After copying the files, change the file ownership so the files are owned by efm:efm.The efm.properties file can be the same on every node, except for the following properties:
• Modify the bind.address property to specify the node’s local address.
• Set is.witness to true if the node is a witness node. If the node is a witness node, the properties relating to a local database installation will be ignored.Start the Failover Manager on any node of the cluster. The agent is named efm-3.1; use your platform-specific service command to control the service. For example, on a CentOS or RHEL 7.x host, use the command:After the agent starts, invoke the following command to see the status of the single-node cluster. You should see the addresses of the other nodes in the Allowed node host list.Start the agent on the other nodes. You can invoke the efm cluster-status efm command on any node to check the cluster status.If the cluster status output shows that the master and standby(s) are in sync, you can invoke the following command to perform a switchover: