RE: pg_ctlcluster is not stopping cluster

Поиск
Список
Период
Сортировка
От Telium Technical Support
Тема RE: pg_ctlcluster is not stopping cluster
Дата
Msg-id 010001875deafb29-7de12ba6-1d4a-4770-baa2-234e971e6b99-000000@email.amazonses.com
обсуждение исходный текст
Ответ на Re: pg_ctlcluster is not stopping cluster  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: pg_ctlcluster is not stopping cluster  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
I tried the command you suggested, and it shows that data directory status as "DOWN".  Yet when I ask pg_ctlcluster for
it'sstatus 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
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)
/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#

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
Sent: Friday, April 7, 2023 6:47 PM
To: Telium Technical Support <support@telium.io>; pgsql-general@lists.postgresql.org
Subject: Re: pg_ctlcluster is not stopping cluster

On 4/7/23 15:27, Telium Technical Support wrote:
> I am string to stop my PostgreSQL (on debian 11) server using the
> following command
>
> root@d11:/# sudo -u postgres /usr/bin/pg_ctlcluster 15 main stop -- -m
> fast -D /var/lib/postgresql/13/main
>
> Notice: extra pg_ctl/postgres options given, bypassing systemctl for
> stop operation
>
> pg_ctl: PID file "/var/lib/postgresql/13/main/postmaster.pid" does not
> exist
>
> Is server running?
>
> The notice is correct, the is no such postmaster.pid file in that
> directory, but yes the service is running. I can confirm it's running with:
>
> root@d11:/# sudo -u postgres /usr/bin/pg_ctlcluster 15 main status --
> -D /var/lib/postgresql/13/main
>
> pg_ctl: server is running (PID: 2701882)
>
> /usr/lib/postgresql/15/bin/postgres "-D" "/var/lib/postgresql/13/main"
> "-c" "config_file=/etc/postgresql/15/main/postgresql.conf"
>
> So why is my stop command being ignored? (I tried without the -m fast
> option but no change, and I'd like to keep that for other reasons). I
> confirmed with 'ps ax' that postgresql 15 is running, despite the
> directory suggesting it might be 13.  Coincidentally, there is a
> postmaster.pid file in a directory OTHER than the data directory:
>
> /var/lib/postgresql/15/main/postmaster.pid
>
> (and notice the 15). Is this a clue?

Yes that this:

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

is not correct.

First do:

pg_lsclusters

to determine what is actually running.

Then do

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

for whatever version is running.

>

--
Adrian Klaver
adrian.klaver@aklaver.com





В списке pgsql-general по дате отправления:

Предыдущее
От: Thorsten Glaser
Дата:
Сообщение: RE: pg_ctlcluster is not stopping cluster
Следующее
От: "Telium Technical Support"
Дата:
Сообщение: RE: pg_ctlcluster is not stopping cluster