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 1j6rXb-0003j1-U7 for pgsql-general@arkaria.postgresql.org; Wed, 26 Feb 2020 07:55:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6rXa-0008Fc-KC for pgsql-general@arkaria.postgresql.org; Wed, 26 Feb 2020 07:55:34 +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 1j6rXa-0008DN-77 for pgsql-general@lists.postgresql.org; Wed, 26 Feb 2020 07:55:34 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j6rXX-0005SR-O3 for pgsql-general@lists.postgresql.org; Wed, 26 Feb 2020 07:55:33 +0000 Received: by mail-wr1-x443.google.com with SMTP id z15so1746323wrl.1 for ; Tue, 25 Feb 2020 23:55:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZeAgR/goq0aYFhFjdIW8TU5rhRaQKZAIpB0hmiS6hKg=; b=EzIBbjxNhn/TN0EmglKXhfiVZwNBXk8hmOM/OOGuIKZ3+3EuH5XUSfZXefn1K6WehS n/YkAAvTMGG43zGe80gTq/JGLWDUaTako4xfC8/mNOddpFl9M/k2w5EagdTOqZOLRnEu oEhZFtmpFC40npwTOx+DjyjlwcolFK4yA6wONJTg2cH80mwbnK80PwNQtjlGfuh4GCnu l/ONtWgHNsxveLGWLDM+MEdLlZRDZBl5SfSXOgh2/wuqmVZI33SijbGXeOJipLWrZZzR Z0xQfaBjFYbwo0qq7AeEnwqFHGuECMFDg3wI6doC2D/vuwCCYVSFPUaiscTcVCcGXBlO oQLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZeAgR/goq0aYFhFjdIW8TU5rhRaQKZAIpB0hmiS6hKg=; b=T6SYMU3oSLr/TQkRk2dOIQjImse3k0jTZSvDpfUYvjNtYuOTORJJVa1N/06JwpYSq+ R3k63+kqtnwk4WzIue3993PPYr7vTVFxR+UVLrZtzYU54YVFHhRh4NZvddBKq7qMQDPH HnE3WQhl2dKZ3YmSUggtgS2FUS9y4zKHT/8If2QoI35psIcQhEvwrQg4oFNpzusD9SvA IfcGLH5nAzbTR2/H7TafO9cBrCuIj6KLLI5jwkTCZpINbp2/nEAkE06mVwjB0nSS4WnK gRbr8ym7COPqxs7ZZ/xVt3ofvSEVsVvsHdCtCG28YiWKBigECjJ+nwF7k4OvzF0G99Ph 9XsQ== X-Gm-Message-State: APjAAAXl0VW7EEbwNUG9yLEgD3JnK3/GR0JIQDiLh1GxB7asw2rxUiNx hWTgwa6/dPWcebKD06st8xE= X-Google-Smtp-Source: APXvYqyFh3rsCNYcxXImd1eUdXsLjeGJNcDy6S/WB+a4caBYo9SCwtSQ3QEyVQSWAQJPW6CpgJbCnA== X-Received: by 2002:adf:9d4a:: with SMTP id o10mr4119001wre.392.1582703730449; Tue, 25 Feb 2020 23:55:30 -0800 (PST) Received: from [192.168.1.8] (137-33-239-77.dyn.cable.fcom.ch. [77.239.33.137]) by smtp.gmail.com with ESMTPSA id l8sm1876353wmj.2.2020.02.25.23.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2020 23:55:30 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Highly academic: local etcd & Patroni Cluster for testing on a single host From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: Date: Wed, 26 Feb 2020 08:55:29 +0100 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <4F8DF27C-E82A-4CBC-B06E-AD4FCD3E66FF@gmail.com> References: <51854B87-A964-4F64-8EC4-8ABF51A0716E@gmail.com> To: Ian Barwick X-Mailer: Apple Mail (2.3608.60.0.2.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Ian, > On 26. Feb, 2020, at 01:38, Ian Barwick = wrote: >=20 > 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. If the latter would be the case = then I could just as well set it individually per node as I can with the = archive destination. So, the tablespace location is always /data/pg01a/ts, even on the = replica site where it should be /data/pg01b/ts. Hence, on my local = cluster, the replica site 'b' always uses the tablespace directory (and = thus the files) of the master 'a'. Cheers, Paul=