Analyze Primary PosgreSQL node failure and replace with standby.
Check the status of the PostgreSQL service.
systemctl status postgresql
Monitor the PostgreSQL log file in real-time.
tail -f /var/log/postgresql/postgresql-<VERSION>-main.log
View the PostgreSQL configuration file.
cat /etc/postgresql/<VERSION>/main/postgresql.conf
Display disk space usage.
df -h
Show real-time system processes and resource usage.
top
Stop the PostgreSQL service.
sudo systemctl stop postgresql.service
Start the PostgreSQL service.
sudo systemctl start postgresql.service
Check if the PostgreSQL service is active without producing output.
sudo systemctl is-active --quiet postgresql.service
Promote a standby PostgreSQL node to primary.
sudo -u postgres pg_ctl promote -D <STANDBY_NODE>