/var/log/vmware/vpostgres/ might grow to large size, potentially causing the file system in the /storage/log partition to fill up.Engineering is still working on it.
Workaround:
Before making any changes, take a snapshot of the vCenter Server Appliance. If the affected vCenter is a member of an Enhanced Linked Mode (ELM) replication setup, please be aware that offline snapshots (in powered off state) need to be created for all of the ELM nodes.
Additionally, before implementing the workaround, please empty the postgres file (with the issue):
# cd /var/log/vmware/vpostgres
# touch postgres.log
# df -h /storage/log
# cd /var/log/vmware/vpostgres
# find . -name "p*\.log*" -mtime +14 -type f -exec du -sh {} \; | sort -n
# cd /var/log/vmware/vpostgres
# find . -name "p*log*" -mtime +14 -type f -exec rm -f {} \;
# df -h /storage/log
There are two options to reduce auto_explain output. Neither of them requires a restart of the vpostgres service:
auto_explain.log_min_duration parameter to a value higher than 10s# cp /storage/db/vpostgres/postgresql.conf /storage/db/vpostgres/postgresql.orig
auto_explain.log_min_duration parameter to a value higher than 10s:
# vi /storage/db/vpostgres/postgresql.conf
auto_explain.log_min_duration = 10s
auto_explain.log_min_duration = 30s
:wq
# grep auto_explain /storage/db/vpostgres/postgresql.conf
Sample Output:
root@<vc_name> [ ~ ]# grep auto_explain /storage/db/vpostgres/postgresql.confsession_preload_libraries = 'auto_explain'auto_explain.log_min_duration = 30sauto_explain.log_analyze = trueauto_explain.log_timing = falseauto_explain.log_buffers = trueauto_explain.log_wal = trueauto_explain.log_triggers = trueauto_explain.log_nested_statements = true
# /opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "select pg_reload_conf();"
# cp /storage/db/vpostgres/postgresql.conf /storage/db/vpostgres/postgresql.orig
# grep auto_explain /storage/db/vpostgres/postgresql.conf
Sample output:
root@<vc_name> [ ~ ]# grep auto_explain /storage/db/vpostgres/postgresql.confsession_preload_libraries = 'auto_explain'auto_explain.log_min_duration = 30sauto_explain.log_analyze = trueauto_explain.log_timing = falseauto_explain.log_buffers = trueauto_explain.log_wal = trueauto_explain.log_triggers = trueauto_explain.log_nested_statements = true
# sed -i 's/^session_preload_libraries/#session_preload_libraries/' /storage/db/vpostgres/postgresql.conf
# sed -i 's/^auto_explain\./#auto_explain\./' /storage/db/vpostgres/postgresql.conf
# grep auto_explain /storage/db/vpostgres/postgresql.conf
Sample output:
root@<vc_name> [ ~ ]# grep auto_explain /storage/db/vpostgres/postgresql.conf#session_preload_libraries = 'auto_explain'#auto_explain.log_min_duration = 30s#auto_explain.log_analyze = true#auto_explain.log_timing = false#auto_explain.log_buffers = true#auto_explain.log_wal = true#auto_explain.log_triggers = true#auto_explain.log_nested_statements = true
# /opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "select pg_reload_conf();"