The vstats service crashes when starting:service-control --start vstats "An error occurred while starting service"
The postgresql log files will have the following message:
/var/log/vmware/vpostgres/postgresql.log:yyyy-mm-dd HH:MM:ss.xxx UTC 646700f5.ad64 0 FATAL: required WAL directory "pg_wal" does not exist
Also, VAMI Backups fail when attempted.
This occurs when the pg_wal directory is not present or the link has been deleted, the directory does not have access permissions, or wal files are not synchronized with Postgres vtsdb.
Restore the vtsdb database checkpoint to start vtsdb and vstats services by performing the following:
# ls -l /storage/vtsdblog/vtsdb/total 4drwx------ 3 vtsdbuser root 4096 MM DD HH:MM pg_wal
# ls -l /storage/vtsdb/vtsdbdata/pg_wallrwxrwxrwx 1 vtsdbuser users 30 MM DD HH:MM /storage/vtsdb/vtsdbdata/pg_wal -> /storage/vtsdblog/vtsdb/pg_wal# mkdir /storage/vtsdblog/vtsdb/pg_wal# ln -s /storage/vtsdblog/vtsdb/pg_wal /storage/vtsdb/vtsdbdata/pg_wal# chown -h vtsdbuser:users /storage/vtsdb/vtsdbdata/pg_wal# ls -l /storage/vtsdb/vtsdbdata/pg_wal
lrwxrwxrwx 1 vtsdbuser users 30 MM DD HH:MM /storage/vtsdb/vtsdbdata/pg_wal -> /storage/vtsdblog/vtsdb/pg_wal
# chown -H vtsdbuser:users /storage/vtsdblog/vtsdb/pg_wal
service-control --stop vtsdb
service-control --stop vstats
# su - vtsdbuser -s /bin/bash -c "/opt/vmware/vpostgres/current/bin/pg_resetwal -f /storage/vtsdb/vtsdbdata"
# service-control --start vtsdb
# service-control --start vstatsNOTE: If it doesn't work, try stopping all services and starting them again.
Once this has been completed, try a VAMI based backup again.