Increase the archive_timeout
to 3600
(seconds) so that
accumulated wal files do not cause a disk-space issue during a network
outage.
About this task
PostgreSQL sends its wal archives to the backup location (S3 or local PVC)
whenever the configured archive_timeout
period elapses. By default, the
archive_timeout
is set to 60 seconds. During a network outage, the files cannot be
transferred and instead accumulate on the current server, and could cause a disk-space issue.
Increasing the archive_timeout
value helps to mitigate this issue by creating
archive files less frequently.
For information on tracking the Postgres disk space, see Monitoring Postgres disk usage on VMware.
Complete the following steps to increase the PostgreSQL archive_timeout
value.
Procedure
- SSH into the server by completing the following steps:
- Run the following command to connect as the API Connect administrator, replacing
ip_address
with the appropriate IP address: ssh ip_address -l
apicadm
- When prompted, select Yes to continue
connecting.
- When you are connected, run the following command to receive the necessary permissions
for working directly on the appliance:
sudo -i
-
Get the name of the
pgha
config map by running the following command:
kubectl -n <namespace> get cm -l pgha-config='true'
The response looks like the following example:
NAME DATA AGE
apis-produ-d18f3f0-0d18f3f0-postgres-pgha-config 5 22d
-
Edit the config map by running the following command:
kubectl -n <namespace> edit configmap <config-map-name>
In the command, replace <config-map-name>
with the
NAME
returned in step 1.
-
Change the
archive_timeout
value to 3600
.
The value must be an integer, and represents the number of seconds that must elapse before the
archive file is generated.
- Save the file and exit the editor.
The configuration is updated automatically; archives will be generated and pushed every
3600
seconds.