Starting vPostgres fails after vCenter Server Appliance failure
search cancel

Starting vPostgres fails after vCenter Server Appliance failure

book

Article ID: 320151

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:

After vCenter Server Appliance(VCSA) fails, you experience these symptoms:
  • vPostgres database fails to start
  • There are no log entries in the /storage/db/vpostgres/pg_log file
  • Unable to start the database using this command:
/etc/init.d/vmware-vpostgres


Environment

VMware vCenter Server Appliance 5.5.x

Resolution

To resolve the issue, modify the postgres user shell.

To modify the postgres user shell:
 
  1. Log in to the VCSA as the root user.

    Note: This procedure modifies the database and the password file. Take a backup of each before proceeding to enable your ability to roll back the state of these files.
     
  2. Open the /etc/passwd file using vi.
     
  3. Locate the postgres user shell with /bin/false entry using this command:

    /^postgres:

    You see this postgres user entry:

    postgres:x:1000:100::/opt/vmware/vpostgres/9.0:/bin/false
     
  4. Run these commands to modify the postgres user shell from /bin/false to /bin/bash:

    /false
    cwbash[ESC}


    You see the modified postgres user entry:

    postgres:x:1000:100::/opt/vmware/vpostgres/9.0:/bin/bash
     
  5. Write the modified file out and exit the editor.
     
  6. Run this command to change the log in to postgres user:

    su postgres
     
  7. Run this command to start the database:
/opt/vmware/vpostgres/9.0/bin/pg_ctl start -D /storage/db/vpostgres
 
If the database does not start, you may see an error similar to:
 
<YYYY-MM-DD><time>db: pid:6334 FATAL: bogus data in lock file "/tmp/.s.PGSQL.xxxx.lock": "ÊþÀÀ"</time>
 

To resolve this error, move the lock file to /tmp file and then start the database.


To move the lock file to /tmp file:
  1. Run this command to create new a folder:

    mkdir /tmp/old
     
  2. Run this command to move /tmp/.sPGSQL.xxxx.lock to /tmp/old:

    mv /tmp/.sPGSQL.xxxx.lock /tmp/old
     
  3. Run this command to start the database:
/opt/vmware/vpostgres/9.0/bin/pg_ctl start -D /storage/db/vpostgres