PostgreSQL Source Management
General
A source host is a server that hosts the source databases. A test data environment(TDE) includes definition of Golden Image (GI) to one source database. This section describes how to create and manage a Test Data Environment.
A Golden Image (GI) refers to a pre-configured dataset of a database environment. This dataset encapsulates a snapshot of the database including its schema and data. It serves as a master copy from which multiple instances of the database (VDB) can be rapidly deployed, ensuring consistency, reliability, and quick scalability across different environments.
Supported types of Golden Images for Postgres database
Each type of Golden Image for Postgres databases serves a specific set of needs, from real-time replication to disaster recovery and cloud-based management. The choice of GI should align with the operational objectives and the specific environment.
Live Golden Image (Live GI)
A Live GI is a real-time replica of a database, mirroring its current state including data and configurations. It requires that the live database is running on a virtual volume provided by Accelario Virtualization.
Pay attention that the updates/refresh of this replica should be done by the user. Accelario Virtualization is not responsible for that. There are some external solutions, though.
Sources(TDE) management
On the navigation bar, click Sources.
The Source Hosts view is displayed, listing all source hosts that have been added to the system
You can quickly locate a source host by typing its letters on the Search bar. The list updates promptly.
Add a source host
To add a source host, see Install source agent
The source host maybe Linux only.
Modify, see details or delete a source host
To modify, see details or delete a source host, see Manage source agent
Create a test data environment(TDE)
On the navigation bar, click Sources.
The Source Management window appears.
Select the required agent
Click the (+) sign in the right panel
Select DB type.
Enter a Name and an optional description.
Only 1 GI type is available - Live GI
Live GI
Create a Live GI
Enter the TDE details
Golden Image Type - always Live GI
Source Host - choose the source host that was installed earlier
Activate snapshots - select if you want automatic snapshots of the GI to be created
Repeat every - choose snapshot frequency
Start from - when to start creating snapshots
Snapshot retention period - how many days to keep the snapshots, they will be deleted automatically afterwards (if no dependent objects exist)
Enter the details of the source database:
User - a Postgres user
Password - password for the above user
VDB password - a new password that will be applied to the above user on each VDB
Port - port of the Postgres database
Cluster Name - name of the postgres cluster that will be created on the source
OS user - OS user that runs the database instance
PostgreSQL Home Dir - location of Postgres installation on the source server. Specify the Postgres base directory, not thebin
directory
Pay attention: For this type (Live GI) the Postgres cluster does not exist yet, so you need to enter details of a cluster that you will create laterOpen the VDB Management window.
Select the TDE. Click Create GI.
Enter a Description.
Click Create.
The creation process is very fast, since only empty Postgres cluster with an empty database are created.The VDB Management window displays the Live GI that was created.
Check the directory that was created on the source server. Click Info on the GI
Write down the Storage Path value - this is the “GI base directory”
Under this location:
create the following structure folders:
PG_MAIN_VERSION/CLUSTER_NAME
apply permission 750
change ownership to the OS user that is used to run Postgres, usually
postgres
Example - given the GI base directory
/main_pool/00000010
, postgres version 13 and cluster namemycluster
:mkdir -p /main_pool/00000010/13/mycluster
chown -R postgres:postgres /main_pool/00000010/13/mycluster
chmod -R 750 main_pool/00000010/13/mycluster
Create an empty Postgres cluster
/usr/lib/postgresql/13/bin/pg_ctl -D /main_pool/00000031/13/mycluster initdb
After initializing of the Postgres cluster set following parameters in
postgresql.conf
under the cluster directory:cluster_name = 'mycluster'
listen_addresses = 'IP or HOSTNAME'
port = 5432
wal_keep_size='300'
– This is for deletion WALs automatically and keeping maximum 300MB of WAL files.Configure archiving of thee Postgres cluster.
Create a dedicated directory under the cluster directory
mkdir /main_pool/00000010/13/mycluster/archives
Set following parameters in
postgresql.conf
under the cluster directoryarchive_mode = on
archive_command = 'test ! -f /main_pool/00000010/13/mycluster/archives/%f && cp %p /main_pool/00000010/13/archives/archives/%f'
Once the cluster is up and running , proceed to activate the GI. Click the Activate icon next to the GI. The Activation verifies that the new database is located fully in the required directory.
Once the activation is completed, a first snapshot is created and you can proceed with VDB creation.
Modify a Live GI
From the Sources screen, click the change (pencil) icon of TDE
If needed - update Snapshot Policy
If needed - update source database parameters
To save your changes, click Modify.
Test Data Environment (TDE)
See information about a test data environment
Select the test data environment.
Click Test Data Environment Info.
The Info window appears:
The info window shows the next details:
IP-address - IP address of the source host
Name - name of the TDE
Description - description of the TDE
Port - port of the source database
User - user in the source Postgres database
Version - version of the source Postgres database
Type - type of the GI (as explained earlier)
GI Name - name of the GI (may be different from the TDE name)
OS User - OS user that runs the source database
DbSID - Postgres cluster name on the source server
DbHomeDir - location of Postgres installation on the source server
DB size - size of the source database
3. To return to the main Source Management work area, click Close.
Remove a test data environment
Select the test data environment.
Click Remove Test Data Environment.
Click Remove to confirm the deletion or Cancel to exit with deleting the test data environment.
After the database is removed, the following message appears: Test Data Environment database has been removed.