Search Postgresql Archives

Re: pg_ctlcluster is not stopping cluster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/7/23 15:51, Telium Technical Support wrote:
I tried the command you suggested, and it shows that data directory status as "DOWN".  Yet when I ask pg_ctlcluster for it's status it says the server is running.

What does this mean?

root@d11:/var/tmp/myapp# pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
13  main    5432 down   postgres /var/lib/postgresql/13/main /var/log/postgresql/postgresql-13-main.log
15  main    5433 down   postgres /var/lib/postgresql/15/main /var/log/postgresql/postgresql-15-main.log

Neither cluster is running.

To confirm do:

ps ax | grep postgres

root@d11:/var/tmp/myapp# sudo -u postgres /usr/bin/pg_ctlcluster 15 main status -- -D /var/lib/postgresql/13/main
pg_ctl: server is running (PID: 2701882)

Best guess, is that because of this:

sudo -u postgres /usr/bin/pg_ctlcluster 15 main stop -- -m fast -D /var/lib/postgresql/13/main

the Postgres pid did not get removed on shutdown.

Bottom line you should not use

pg_ctlcluster 15 main stop

to

shut down a 13 cluster located at:

-D /var/lib/postgresql/13/main

Just do:

sudo -u postgres /usr/bin/pg_ctlcluster 15 main stop -m fast

or

sudo -u postgres /usr/bin/pg_ctlcluster 13 main stop -- -m fast

depending on which cluster you want to shut down.


/usr/lib/postgresql/15/bin/postgres "-D" "/var/lib/postgresql/13/main" "-c" "config_file=/etc/postgresql/15/main/postgresql.conf"
root@d11:/var/tmp/myapp#


--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux