vmware-vpostgres service failed to start
search cancel

vmware-vpostgres service failed to start

book

Article ID: 345090

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Failed to start vmware-vpostgres service, even after using su - vpostgres -c "/opt/vmware/vpostgres/current/bin/pg_ctl start -D /storage/db/vpostgres". Found the below logs in postgres log file.

WARNING: Failed to open file "/sys/fs/cgroup/memory/system.slice/vmware-vpostgres.service/memory.stat": No such file or directory

YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2219 0  LOG: Writing instance status...
YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2219 0  LOG: Wrote instance status successfully.
YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2219 0  LOG: Updated instance status successfully.
YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2218 0  LOG: could not open temporary statistics file "/dev/shm/postgres_stats/global.tmp": No such file or directory
YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2218 0  LOG: could not open temporary statistics file "/dev/shm/postgres_stats/global.tmp": No such file or directory
YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2217 0  LOG: using stale statistics instead of current ones because stats collector is not responding
YYYY-MM-DD HH:MM:SS UTC 6049eaa6.2218 0  LOG: could not open temporary statistics file "/dev/shm/postgres_stats/global.tmp": No such file or directory

Environment

VMware vCenter Server 6.x
VMware vCenter Server 7.x

Cause

The main files/directories from the OS level related to vpostgres have been missed, could be corruption, failover issue.

Resolution

Workaround:

 

*Create the parent directory and the temp file with the needed permissions in /dev/shm:

  1. cd /dev/shm/
  2. mkdir postgres_stats
  3. chmod 700 postgres_stats/
  4. chown vpostgres:users postgres_stats/ -R
  5. cd postgres_stats
  6. touch global.tmp
  7. chmod 777 global.tmp

 

*Create the parent directory in /sys/fs/cgroup/memory/system.slice:

  1. cd /sys/fs/cgroup/memory/system.slice
  2. mkdir vmware-vpostgres.service

start vmware-vpostgres service

 The parent files/directories we created will not persist/initialized after reboot. You can take vCenter server File-Based Backup and Restore.

Additional Information

This is a temp solution as the parent files/directories we created will not persist/initialized after reboot. You can take vCenter server File-Based Backup and Restore.