In order to begin using PostgreSQL environments with Delphix, you will need to configure the source and target hosts with the requirements described on this page.
PostgreSQL Hosts and Databases
On each host with Postgres, there must be an operating system user configured to the required specifications for Delphix, as explained in the table below. These requirements apply to both source and target environments. However, target environments have additional requirements which are detailed in the ‘Target Host Requirements’ section below.
The PostgreSQL plugin requires the use of the default user which gets created during the Postgres DB installation process. Usually, 'postgres'. Please add the environment using this user and create all the datasets with the same.
Source Database Requirements
|The source database can be in READ-WRITE or READ only mode. It can be a standby database(streaming site) as well.|
The Staging host must have access to a PostgreSQL role on the source side that has replication, and login privileges. This can be the built-in PostgreSQL role or a newly-created role (for example, delphix).
Creating a Role for Use with the Delphix Engine
To create a new role for use with the Delphix Engine, use the following command:
SQL> CREATE USER delphix WITH REPLICATION ENCRYPTED [ PASSWORD 'password'];
You must make the following changes to postgresql.conf:modifying the parameterlisten_addresses, which specifies the TCP/IP addresses on which the DBMS is to listen for connections from client applications.
Note: TCP/IP connectivity must be configured to allow the role mentioned above to connect to the source database from the Delphix Engine and from the standby DBMS instance set up by the Delphix Engine on the staging environment.
The simplest way to configure PostgresSQL is so that it listens on all available IP interfaces:
listen_addresses = '*' # Default is 'localhost'(for more information, see the Server Configuration chapter in the PostgreSQL documentation)
|The value of max_wal_senders, which specifies the maximum number of concurrent connections from standby servers or streaming base backup clients, must be increased from its desired value by two. That is, in addition to the allowance of connections for consumers other than the Delphix Engine, there must be an allowance for two additional connections from consumers set up by the Delphix Engine.|
The default value max_wal_senders is zero, meaning replication is disabled. In this configuration, the value of max_wal_senders must be increased to two for the Delphix Engine:
max_wal_senders = 2 # Default is 0
The value of,
In releases prior to PostgreSQL 9.6.x, parameter 'wal_level' allowed the values 'archive' and 'hot_standby'. These values are still accepted but mapped to 'replica'.
The default value of wal_level is minimal, which writes only the information needed to recover from a crash or immediate shutdown to the WAL archives. In this configuration, you must add the logging required for WAL archiving as follows:
wal_level = archive # Default is minimal
|You must configure PostgreSQL to allow PostgreSQL client connections and replication client connections from the staging target environment.|
To configure appropriately, add the following entries to pg_hba.conf:
|<auth-method> can be set to trust, scram-sha-256, or md5 on source. Delphix inherits the same authentication method from the source while dSource creation and VDB provisioning. For more information on how to configure, pg_hba.conf see the Client Authentication section in the PostgreSQL documentation|
|wal_keep_segments parameter in postgresql.conf file on Source environment should be large enough to support the WAL sync process once the dSource is building up|
|It is mandatory to have "port" (can be commented or not commented) in postgresql.conf file.|
Target Host Requirements
|The operating system and architecture of the target environment must match those of the source environment.||It is recommended that the source and the target environments should be identical and hardware configurations should match.|
|Compatible Operating System supported by the Plugin is CentOS 7.3/7.4/7.5/7.6 and RHEL 7.3/7.4/7.5/7.6.||The underlying Operating System for both the Source and Staging environment should be amongst these two versions.|
|There must be an installation of PostgreSQL on the target environment that is compatible with the installation of PostgreSQL on the source environment.|
Two installations of PostgreSQL are compatible if and only if:
There must be an operating system user (e.g postgres) with the following privileges:
|See Sudo Privilege Requirements for PostgreSQL Environments for further explanation of the commands, and Sudo File Configuration Examples for PostgreSQL Environments for examples of the /etc/sudoers file on different operating systems.|
There must be a directory on the target environment where the Delphix Engine Plugin can be installed (for example, /var/tmp ) with the following properties:
There must be a mount point directory (for example, /mnt) that will be used as the base for mount points that are created when provisioning a VDB with the following properties:
|TCP/IP connectivity to and from the source environment must be configured as described in General Network and Connectivity Requirements.|
Hostname and IP must be correctly set in /etc/hosts file, for example [postgres@source ~]$ hostname -i
The output of “hostname -i” command should produce the correct result as the IP address of the server.
[postgres@source postgres]$ hostname -i
|When using the External Backup method for ingestion the directories being used for keeping Backup file and WAL file should be accessible by OS User.|
|Zip must be installed on the Staging/Target Host for External Backup Support.|
The backup command and File should be in the below format:
PostgreSQL_T<YYYYMMDD>.zip where YYYY
denotes Year, MM denotes month, DD denotes date. For Example PostgreSQL_T20190314.zip.
The above zip file should contain a Database Full Backup from the Source created in tar format.
The below flags can be used with pg_basebackup for taking Source Database backup:
For PostgreSQL versions 9.4.x,9.5.x,9.6.x
<PATH_TO_PG_BIN>/pg_basebackup -p <PORT> -D <EMPTY_BACKUP_DIR> -F t -v -w -P -x
For PostgreSQL versions 10.x and 11.x
<PATH_TO_PG_BIN>/pg_basebackup -p <PORT> -D <EMPTY_BACKUP_DIR> -F t -v -w -P -Xs
If there's no PostgreSQL instance running on the Staging/Target host, however, we have a PostgreSQL installation, even then the plugin relies on the "DELPHIX_PG_PATH" variable to discover the environment.
In the absence of "DELPHIX_PG_PATH" variable or if the value of "DELPHIX_PG_PATH" variable is NULL then Linux "find" command will be used for the Environment discovery which may impact the overall performance. Hence, it is preferred to create this Environment Variable with correct entries.
In order to optimize the performance, it is preferred to create an Environment Variable "DELPHIX_PG_PATH" which should be accessible by OS users.
Below should be the syntax for "DELPHIX_PG_PATH" variable:
ssh <your_username>@<target_host> "env | grep DELPHIX_PG_PATH".