We have been trying hard to restart the DB cluster server which was shutdown after power failure. We have tried systemctl , pg_ctl and pg_ctlcluster commands but all the time we are getting same error.
directory "/var/lib/postgresql/11/main" is not a database cluster directory
While in our configuration file (postgresql.conf) same path has been mentioned:
data_directory = '/var/lib/postgresql/11/main'
I was not able to understand why we are getting this error even the server was running with same configuration before power shutdown.
This is our production server.
The command line I am feeding to those commands is:
- pg_ctl : /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main
- pg_ctlcluster : /usr/bin/pg_ctlcluster --skip-systemctl-redirect 11-main start (this is the same command mentioned under the ExecStart parameter of postgresql@.service)
- systemctl : systemctl status postgresql@11-main.service