Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6s2X-0004gG-JE for pgsql-general@arkaria.postgresql.org; Wed, 26 Feb 2020 08:27:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6s2W-00042n-EJ for pgsql-general@arkaria.postgresql.org; Wed, 26 Feb 2020 08:27:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6s2W-00042g-1c for pgsql-general@lists.postgresql.org; Wed, 26 Feb 2020 08:27:32 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j6s2S-0005nW-2H for pgsql-general@lists.postgresql.org; Wed, 26 Feb 2020 08:27:31 +0000 Received: by mail-pl1-x643.google.com with SMTP id q4so1003141pls.4 for ; Wed, 26 Feb 2020 00:27:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tdQAkLYzLkK58kbXtczAiHh4PRokkMgsv9prb61I4Tg=; b=n6UezTBxE5HG8LTNRuhickVt2j7trcnwn/NY2p9MFDsBgUmTfMTdOHq4e5Y8hLe0DK tqPZVIPx5kjbYS/OqXy+5sANILsFk0/EV/2cjlgue9k/3OE3tLvQcS2sK41T/CQyG+Ay AtzhRELUW3ho6UkM127cmZtcMC42MisuulT3oyAa4y+lcmhXqo0f1FHS0W4MX9IrAsPj Y4gJvyHsRzS30D8X3XzpzeJr7M+yaUjKgOco4P8AxWE1rIsmkhXZNvxBeeUKXkdNEON6 9X9pfsUZm1UBNRsEhgqY3PYvaHHmXBrG3QSROEQVpvNJuZ78N1EJhlKWqJENuiMrTh8E +T8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tdQAkLYzLkK58kbXtczAiHh4PRokkMgsv9prb61I4Tg=; b=oBxtM360NyZ2jw55aNDNHajr3fbrCLE/xrFrwXW09yB27rApFTnlY2Q+ohYlGeKjNl oSC7syaJarv+HPvOcW+Kfxgyby93mdyn9bC/vq4j64gyyLD8UW8i/oi3HEc5xgmkwwkQ tNb4ZenQF/Sh23alB0Kk04lFE9kV1/jp6GXWi/Ay4Lt+NMkMwTmMyFMYSOYxBJfK1wCV cwIjgiLSkmO4F2xEPJ8MGuN4LmLRYYXNABXjWcZs754jXO0oCKNrCoNZXRjNa0EbVYLk OQHGb7LCD7gJTPUbdRWVoBds35rzknpRn4uQkhlcX64qsvALFBk/rYhamDvsGesAzd5s w+iQ== X-Gm-Message-State: APjAAAVzcHToaRjobks0s+O8T7/j/xxZPtEnhsZ3B23TBEzGeSzse2h0 OziHJzdrNcHVL0gOq9PSPHyYXOeqWO3BBOG+nmOrPULcckNr44ZQTVODtvDkye4nNtRGsSrU5Nd 8NwcWxE9vU0TEZCPOmrzQcvXtLH3Yiw2zxjsDWsaXnvIibgxqt/TYV0bSSI8560kfywRYNy5qa2 +uec8wLqpCr65eJn2WUg== X-Google-Smtp-Source: APXvYqxEO/0gtbbLWy+rx70UrZ99RPOA8fT1yYoqa4xmVOAJv3h1XLOKSj5nAsrn/LEQ3oYmQSw/Kw== X-Received: by 2002:a17:90a:191:: with SMTP id 17mr3900649pjc.88.1582705645470; Wed, 26 Feb 2020 00:27:25 -0800 (PST) Received: from osaka.octopusnet (p8608034-ipngn39201marunouchi.tokyo.ocn.ne.jp. [180.46.196.34]) by smtp.gmail.com with ESMTPSA id ci5sm1736920pjb.5.2020.02.26.00.27.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Feb 2020 00:27:24 -0800 (PST) Subject: Re: Highly academic: local etcd & Patroni Cluster for testing on a single host To: =?UTF-8?Q?Paul_F=c3=b6rster?= Cc: pgsql-general@lists.postgresql.org References: <51854B87-A964-4F64-8EC4-8ABF51A0716E@gmail.com> <4F8DF27C-E82A-4CBC-B06E-AD4FCD3E66FF@gmail.com> From: Ian Barwick Message-ID: <363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com> Date: Wed, 26 Feb 2020 17:27:22 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <4F8DF27C-E82A-4CBC-B06E-AD4FCD3E66FF@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/02/26 16:55, Paul Förster wrote: > Hi Ian, > >> On 26. Feb, 2020, at 01:38, Ian Barwick wrote: >> >> Assuming the standby/replica is created using pg_basebackup, you can use the >> -T/--tablespace-mapping option to remap the tablespace directories. > > no, with Patroni, replicas are always initiated by Patroni. Patroni copies the whole PGDATA including everything (postgresql.conf, etc.) in it to the replica site. When launching Patroni for the first time, all you need is its yaml configuration file and an empty PGDATA. It then will copy the whole master's PGDATA as is, launch the replica database cluster and start replication. > > Even if Patroni uses pg_basebackup internally (which I assume it does), there is no way to pass parameters to it. > > Then you can stop the Patroni process on the replica site which in turn takes the replica database cluster down, make some configuration changes and launch it again. You can of course only make changes to things which don't get replicated all over again or are managed by Patroni itself. This is, how I set up individual archive destinations for each replication member because the initial archive destination of course is replicated, and thus identical, when Patroni builds the replica database cluster. > > Tablespace mapping just creates the links to the directories in ${PGDATA}/pg_tblspc to a different location. And since pg_basebackup isn't used, there is no way to do that. But I can do that by hand. That is not the problem. > > The problem is that PostgreSQL keeps the tablespace location inside the database and not in some config file. It doesn't - it takes the tablespace location directly from the symlink in the "pg_tblspc" directory (since PostgreSQL 9.2), so you can manipulate those manually, provided the server isn't running of course. Not sure how that would fit in with the Patroni side of things. Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services