Configuring log rotation for PostgreSQL log files in VMware vCenter Server Appliance
book
Article ID: 338104
calendar_today
Updated On:
Products
VMware vCenter Server
Issue/Introduction
This article provides steps to configure log rotation for the embedded PostgreSQL database in vCenter Server Appliance
Environment
VMware vCenter Server Appliance 5.5.x
VMware vCenter Server Appliance 6.x
VMware vCenter Server Appliance 7.x
VMware vCenter Server Appliance 8.x
Resolution
Perform these steps to configure log rotation for the embedded PostgreSQL database:
- Connect to the VCSA through SSH
- Run this command to stop the vCenter service:
/etc/init.d/vmware-vpxd stop
- Run this command to stop the PostgreSQL service:
/etc/init.d/vmware-vpostgres stop
- Run this command to change the directory to /storage/db/vpostgres/:
cd /storage/db/vpostgres/
- Open the postgresql.conf file with vi:
vi postgresql.conf
- Find the ERROR REPORTING AND LOGGING section and change these lines:
#log_directory = 'pg_log'
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
#log_truncate_on_rotation = off
#log_rotation_age = 1d
to
log_directory = 'pg_log'
log_filename = 'postgresql-%d.log'
log_truncate_on_rotation = on
log_rotation_age = 1440
- Run this command to start the PostgreSQL service:
/etc/init.d/vmware-vpostgres start
- Run this command to start the vCenter service:
/etc/init.d/vmware-vpxd start
Feedback
thumb_up
Yes
thumb_down
No