Table of Contents Previous Next


14 Configuring Streaming Replication

on a Linux host, modify the PEM agent configuration file (pemagent.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 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\9506bd74\str_rep_wiz_welcome.png
Figure 14.1– The Streaming Replication wizard's Welcome window.
Click Next to continue. A popup will open (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\52fdfaa0\str_rep_wiz_popup.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 on the popup 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.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\6e35f9c2\14.3.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 IP Address field to select the address of the host on which the master node will reside.
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.
Optionally, use the Replication Slot Name field to specify the name for a replication slot; the PEM server will create the replication slot on the master node during the replication setup process, 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.
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\b8eb93bc\14.4.png
Use the Host drop-down listbox to select the name of 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.
Check the box next to Hot Standby if the standby node should be used for read-only queries while acting as a standby node in the replication scenario.
Check the box next to Synchronous 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.
Click the Add/Change button to add a standby node to the list of servers, or to modify the values associated with a server in the list.
If the selected version of the server is already installed on the standby server, a pop-up window opens, notifying you that PEM will create a new data directory on the standby node that will be populated with a copy of the database that resides on the master node (see Figure 14.5). A copy of the existing data will be preserved on the standby.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\b8e9933a\14.45.png
Click Yes to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\2be9267c\14.5.png
Figure 14.6 - The wizard's upgrade and extension window.
Check the box in the Upgrade Database Server panel (see Figure 14.6) to indicate that the server should be upgraded during the configuration process. Please note that the upgrade process will only upgrade to the most recent minor version of the selected server version available (for example, from version 9.3.0 to 9.3.9).
The Extension Summary panel 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\6414bdbc\14.6.png
the installation path of the data directory; you may specify 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\296021cf\14.7.png
The Streaming Replication Setup Summary (see Figure 14.8) displays a list of the servers that will be part of 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.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\2be9265d\14.8.png
When the download completes (see Figure 14.9), 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\39e1100c\14.9.png
Figure 14.10 - Select a time to configure replication.
Use fields on the Schedule Streaming Replication dialog (see Figure 14.10) to specify the most convenient time for the server to configure the replication scenario:
Click the radio button next to Setup Streaming Replication Now to instruct PEM that it should install and configure streaming replication immediately.
Click the radio button next to Schedule it for some other time 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 in the Task Manager; to open the Task Manager dialog, highlight the name of the PEM agent for which you wish to review the job queue and select Scheduled Tasks... from the context menu.
When the installation and setup completes, you can define a server connection to the master or standby nodes in the PEM client, and monitor the new replication scenario on the Streaming Replication dashboard. 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.
To view the Streaming Replication Analysis dashboard for the master node of a replication scenario, you must enable the following probes:
To view the Streaming Replication Analysis dashboard for the slave node of a replication scenario, you must enable the following probe:

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\7026d5a9\sr3.png

14 Configuring Streaming Replication

Table of Contents Previous Next