Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r8kPV-00BSSm-BR for pgsql-general@arkaria.postgresql.org; Thu, 30 Nov 2023 17:01:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r8kPT-001cOJ-UT for pgsql-general@arkaria.postgresql.org; Thu, 30 Nov 2023 17:01:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r8kPT-001cO9-Fk for pgsql-general@lists.postgresql.org; Thu, 30 Nov 2023 17:01:07 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r8kPQ-0088Pp-Pd for pgsql-general@postgresql.org; Thu, 30 Nov 2023 17:01:06 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 20E355C0124; Thu, 30 Nov 2023 12:01:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 30 Nov 2023 12:01:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701363664; x=1701450064; bh=WVplh8QNlwQ9f8HUW5UAcW0IwVYUvNpvnS7 4K/NT8is=; b=iS5570v05oqcjCRD4z10HASMOv3pDaNqAlmBlNFFoD7L/7FWSaC hhadyTxJXRVGRKfTcXxbWgsgdCHrupgu3aVwbwRzjpfTjidbDdAbguLXxWWckYY/ xSyEFMCo03S9UI3+du89SLzt+FzpxzKvZRy6JvRXHFNF24DMb9XHKOGA+r52SyoH zhEakwCwiQk3ed53x8RgVMSqNbXQ8hhPbCo1bbNTB/1SYyDe6h4ijE2A2Y7C+aRi +SiEusTJg90SOjzB0Snw8zgTdUiYnImGEY4bzB5h6bD+19Qi/c0eCTSFCj3Aqp4A g5QCnU/6B/LAswbUfnYTm00MK+D8xovIGKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701363664; x=1701450064; bh=WVplh8QNlwQ9f8HUW5UAcW0IwVYUvNpvnS7 4K/NT8is=; b=SQ+J9I0kt9R+hQHY/NXgljcEwNx1HyvoTYxB+VrDneePL7iReOe 715r3yA82Nz+HMfqvHi2FBVhYn2JEDXO3jvGzSgi2yPHuZtLmZoumZr2rkh9JOKE 7137/KhkLinOgUq8DaSNkHyDDJNtj5cUyCXH3nhPdfzRdjLQ/Y5pFidYEuyqoQmd ZvKfcyb74VUPm/vuoxMsaAmabSriZgJ6dvXA06JE06YldB8RwDdzdIJC0F+wRqOF +g0wOIWHbMrtxdbdi0bIgdz/a7R5uTZvhNvSzS8owuSselB2pZznjJMOyZ26y+Bg XL4R/H43ocYTSFC5uE+/05RcZMU8FfGXH0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeijedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ekredttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeefgeefie eutdfggfetgefgheekjeehteeileeigfetieekjedvieeviefgheevtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Nov 2023 12:01:03 -0500 (EST) Message-ID: <10c26017-62f2-457e-b71c-c53eada6ae5b@aklaver.com> Date: Thu, 30 Nov 2023 09:01:02 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Two started cluster on the same data directory and port Content-Language: en-US To: Loles Cc: PostgreSQL References: <477f32ab-72cc-4888-835a-0f25aa3db705@aklaver.com> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/30/23 08:46, Loles wrote: > Yes, it exists but it is obsolete. The files and directories are all > dated 2022. > > It was obsolete and no longer valid, it could be deleted. Only the main > cluster is correct. First try: vi /etc/postgresql/14/main_old/start.conf and change auto to disabled. Stop the server(s) and then: sudo pg_ctlcluster starp 14 main > > El jue, 30 nov 2023 a las 17:43, Adrian Klaver > (>) escribió: > > On 11/30/23 08:37, Loles wrote: > > Every time I stop the main_old cluster with sudo pg_ctlcluster > stop 14 > > main_old, both are stopped. And when I raise sudo pg_ctlcluster > start 14 > > main, both are raised. > > > > I don't know how I got into this situation and I don't know how to > > resolve it. > > Is there both?: > >     /etc/postgresql/14/main/ >     /etc/postgresql/14/main_old/ > > > > > > > El jue, 30 nov 2023 a las 17:34, Loles ( > > >>) escribió: > > > >     Indeed, that is the problem, they are two different clusters, > >     pointing to the same data directory and reading from the same > port. > > > >     I can't change the port because it is the same postgresql.conf > > > >     I don't know how to disassociate the main_old cluster from > the data > >     directory or how to resolve this situation. > > > >     El jue, 30 nov 2023 a las 16:32, Adrian Klaver > >     ( >>) > >     escribió: > > > >         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 > > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com