Table of Contents Previous Next


14 Configuring Streaming Replication

on a Linux host, modify the PEM agent configuration file (agent.cfg) located in /opt/PEM/agent/etc/agent.cfg setting the following parameters to true:
on a Windows host, modify the Windows registry (HKEY_LOCAL_MACHINE\Software\Wow6432Node\EnterpriseDB\PEM\agent), setting the following entries to true:
on a Linux host, open a command line, assume superuser privileges and enter the command /etc/init.d/pemagent restart (on RHEL or CentOS 6.x) or systemctl pemagent restart (on RHEL or CentOS 7.x).
on a Windows host, use the Services applet to restart the Postgres Enterprise Manager - pemAgent service.
Then, to open the Streaming Replication wizard, select Streaming Replication from the Management menu. The Streaming Replication wizard welcomes you as shown in Figure 14.1.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\8120891d\str_rep_wiz_welcome.png
Figure 14.1– The Streaming Replication wizard's Welcome window.
Click Next to continue.
The Refresh Packages dialog opens (see Figure 14.2), offering you the option to refresh the package data that is stored on the PEM server about the currently installed packages.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\cc5c15d7\str_rep_wiz_refresh_packages.png
The PEM installed_packages probe retrieves information about the currently installed packages that reside on hosts that are monitored by PEM agents. Select Yes to invoke the probe and update the information that is stored on the PEM server. If you have not added servers to the monitored hosts since the last probe execution (by default, the installed_packages probe executes once every 24 hours), click No to continue without executing the probe.
Click Next to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d6553b35\str_rep_wiz_master_select.png
Use the drop-down listbox in the Host field to select the name of the PEM agent that monitors the master node from the list of active agents. To be displayed in the listbox, the agent must be configured with allow_streaming_replication, allow_package_management, and allow_server_restart enabled (set to true) in the PEM Agent configuration file. Please note that each node of a replication scenario must have a resident agent; remote monitoring of replication nodes is not supported.
Use the drop-down listbox in the Database server field to specify the server or server version of the master node. You can select:
o
A previously installed server to act as the master node of the replication scenario; existing servers include the word (Installed) in their description. When you select an existing server, the Validate button will be enabled.
Use the drop-down listbox in the Replication host address field to select the address of the host on which the master node will reside.
Optionally, provide a name for a replication slot in the Replication slot name field; the PEM server will create the replication slot on the master node, and add entries to the recovery.conf files on standby nodes. A replication slot name can contain lower-case letters, numbers, and the underscore character. This option is valid only for database server versions 9.4 and above.
Click Next to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\45548e70\str_rep_wiz_master_auth.png
Use the Replication user name field to specify the name of an existing role that is either a database superuser or has REPLICATION privileges, or the name of a role that will be created by PEM for use during replication-related transactions. Please note that PEM will return an error if you specify the name of an existing user with insufficient privileges.
Use the Replication password field to specify the password that will be associated with the replication user.
Use the Database user name field to specify the name of a database superuser on the master node.
Use the Database password field to specify the password associated with the database superuser.
If you are using an existing server as the master node of the replication scenario, you must use the Validate button to confirm that the connection information provided. When you press the Validate button, the server will attempt to connect with the credentials supplied.
Click Next to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d65d3320\str_rep_wiz_standby_select.png
Use the table on the Standby Server Selection dialog (see Figure 14.5) to provide properties of one or more standby nodes. Click the add icon (+) to add an entry to the table.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d45d35a5\str_rep_wiz_add_standby.png
Use the Standby Server Options form (see Figure 14.6) to provide information about the standby node:
Use the Agent drop-down listbox to select the name of the agent that resides on the standby node in the replication scenario. Please note that you will not be able to edit the properties of a standby node that is already part of a replication scenario.
Use the IP address drop-down listbox to select the IP address of the standby node.
Set the Hot standby field to Yes if the standby node should be used for read-only queries while acting as a standby node in the replication scenario.
Set the Synchronous? field to Yes to enable synchronous replication; streaming replication is asynchronous by default. If a standby node is specified as Synchronous, a transaction will not be committed until it is written to the transaction log of both the master node and standby node.
Use the Priority drop-down listbox to specify the order in which the standby nodes will be listed in the postgresql.conf file of the master node. For example, select 1 to indicate that in the standby should be listed first, 2 to indicate that the node should be listed second, etc.
If you are adding the standby to an existing replication scenario, PEM will display the identity of the replication master in the Replication state field, and the name of the application (from the pg_stat_replication table) in the Application name field. These values are not user-modifiable.
Click the Add/Change button to add another standby node to the list of servers, or the Edit icon to modify the values associated with a server in the list. Use the Delete icon to remove a standby definition from the table. When you've finished defining the standby nodes, click Next.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\9bb1e6b7\str_rep_wiz_extension_summary.png
Figure 14.7 - The wizard's upgrade and extension window.
The Extension Summary panel (see Figure 14.7) lists the extensions or modules that are installed on the nodes of the replication scenario. Any extension installed on the master node must also be installed on each standby node of the replication scenario.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\8bbad64b\str_rep_wiz_install_options.png
When updating the installation properties, you should confirm that the user name and password specified match the name and password provided on the Master Server Selection dialog. You should also confirm that the specified port is not already in use on the host of the master or standby.
The data directory for the cluster may be created in a non-default location. If you move the data directory from the path specified during the installation, you must update the path specified in the /etc/postgres-reg.ini file.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\0ab155f8\str_rep_wiz_inst_summary.png
The Download Packages dialog (see Figure 14.9) displays a list of the packages that will be required to install the configured replication scenario. Click Back to return to a previous screen and modify the selections, or click Start Download to begin downloading the packages that will be used for the installation.
When the download completes, click Next to continue; the streaming replication wizard will open a dialog that allows you to schedule streaming replication setup.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\08b35b76\str_rep_wiz_schedule.png
Figure 14.10 - Select a time to configure replication.
Use fields on the Schedule Setup dialog (see Figure 14.10) to specify the most convenient time for the server to configure the replication scenario:
Set Setup now? to Yes to instruct PEM that it should install and configure streaming replication immediately.
Set Setup now? to No to enable the date and time selectors; use the selectors to specify when you would like PEM to (optionally) perform installations and configure streaming replication.
Click Finish to save your choice and exit the wizard; PEM will either begin the installation and configuration process or schedule the installation and configuration for the specified time. You can review the job schedule and job progress on the Scheduled Tasks tab; to open the Scheduled Tasks tab, highlight the name of the PEM agent for which you wish to review the job queue and select Scheduled Tasks... from the Management menu.
Please note that the Streaming Replication wizard only modifies the pg_hba.conf file on replication nodes to allow connections by the replication user; before defining a server connection in the PEM client, you may need to modify the pg_hba.conf file on each node to allow the connection from the client.

14 Configuring Streaming Replication

Table of Contents Previous Next