pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Loles <lolesft@gmail.com>
To: PostgreSQL <pgsql-general@postgresql.org>
Subject: Re: Two started cluster on the same data directory and port
Date: Thu, 30 Nov 2023 07:32:30 -0800
Message-ID: <cf37b994-64af-4c70-8e30-ef9a0e2229bf@aklaver.com> (raw)
In-Reply-To: <477f32ab-72cc-4888-835a-0f25aa3db705@aklaver.com>
References: <CA+FWGK4pWAJkxth2nyJ5ZGewfqRCCJ0YJeXe0v8FC1pURuEtbg@mail.gmail.com>
	<477f32ab-72cc-4888-835a-0f25aa3db705@aklaver.com>

On 11/30/23 07:23, Adrian Klaver wrote:
> On 11/30/23 05:37, Loles wrote:
>> Hi!
>>
>> I have this situation on a server that is giving me problems.
>>
>> postgres@hostname:~$ pg_lsclusters
>> Ver Cluster  Port Status Owner    Data directory              Log file
>> 14  main     5432 online postgres /var/lib/postgresql/14/main 
>> /var/log/postgresql/postgresql-14-main.log
>> 14  main_old 5432 online postgres /var/lib/postgresql/14/main 
>> /var/log/postgresql/postgresql-14-main_old.log
>>
>> How can I stop, even delete, the main_old cluster?
> 
> Assuming you are on  Debian/Ubuntu.
> 
> 1) sudo pg_ctlcluster stop 14 main_old
> 
>      This will stop the server for this session
> 
> 2) sudo vi  /etc/postgresql/14/main_old/start.conf
> 
>      Change auto to manual.
>      This will keep the server from restarting on reboot.
>      You can still start it using
>       sudo pg_ctlcluster start 14 main_old
>      Though if you want to do that then:
>          vi /etc/postgresql/14/main_old/postgresql.conf
>       and change port to something other then 5432.
> 
> 3) If you have determined you really don't need that server and have all 
> the data safely backed up or moved to the other server, then(THIS IS NOT 
> REVERSIBLE):
> 
>      sudo pg_dropcluster 14 main_old

Blaming it on not enough coffee, but I just noticed both clusters are 
pointing at the same data directory. I would NOT do:

     sudo pg_dropcluster 14 main_old

> 
>>
>> Thanks!
>>
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (17+ messages)  latest in thread

Message-ID: <cf37b994-64af-4c70-8e30-ef9a0e2229bf@aklaver.com>
Permalink:  ../cf37b994-64af-4c70-8e30-ef9a0e2229bf@aklaver.com/
Also on:    postgresql.org/message-id/cf37b994-64af-4c70-8e30-ef9a0e2229bf@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, lolesft@gmail.com
  Subject: Re: Two started cluster on the same data directory and port
  In-Reply-To: <cf37b994-64af-4c70-8e30-ef9a0e2229bf@aklaver.com>
  References: <CA+FWGK4pWAJkxth2nyJ5ZGewfqRCCJ0YJeXe0v8FC1pURuEtbg@mail.gmail.com> <477f32ab-72cc-4888-835a-0f25aa3db705@aklaver.com> <cf37b994-64af-4c70-8e30-ef9a0e2229bf@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox