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 1tAVh2-00G92o-ET for pgsql-general@arkaria.postgresql.org; Mon, 11 Nov 2024 14:47:03 +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 1tAVgy-00F5yd-QE for pgsql-general@arkaria.postgresql.org; Mon, 11 Nov 2024 14:47:01 +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 1tAVgy-00F5yV-FX for pgsql-general@lists.postgresql.org; Mon, 11 Nov 2024 14:47:01 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tAVgw-001KAn-6s for pgsql-general@postgresql.org; Mon, 11 Nov 2024 14:46:59 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-7240fa50694so3250971b3a.1 for ; Mon, 11 Nov 2024 06:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731336417; x=1731941217; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xsCdick+88dw+4vIWF2EMMYoTvY7rzy5T1sSsTkNS/0=; b=OOFSZslbzy2rFZDbZcTcQ1/dS035nZdUy/zSfGFWPQn2agULi/b7rgFP/yx8IdBPWh Avaw+k1AOnXKHjvKzP0Ysa1e9yRnhNsvB7FKOg4CiB4u4vBVbhzr2SlqL3bHAi39cn11 6XRkZigSN5ZfGcf/Aci4RrW507Y5mm7RZfkIUexzpqtlFEJiRS8x9jGsNA3Ja/2qbj8v TFKBjG/IaZe/Ngxc4brwyM0Jl6Tg4wdtrP3IUV9D7ZAP8Rz6kCv1RdTPr8qeJH63JQ2H R5Lv6ZDpgP9qMptgdObkTsnXHF5RfRpVg/uRO/exnXJmzn/z0iwqvyiN/qwhIQwC0rmf qP+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731336417; x=1731941217; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xsCdick+88dw+4vIWF2EMMYoTvY7rzy5T1sSsTkNS/0=; b=Orn7XkBl+cc47Q5piXo9uXI63XZqrtZmgJjuUCR3tagr+PX/XHPjjbJRBhGssjR096 zm3P6g4LjQBVeW58WsJjq55ktpkwbNwXsAZjdQ4pZkEY+iKR1BfytXevG4sYQPaF71TJ pEVL2FBFkxT2MUuSJiLReoFBhMl2diEVvMT3GcAHDBAwX7ZmDfvdWCpq9a0YwThmM/dk 3yBVtCO3KipSbLkxVwnnd3xxNYj/ypPALehDxGBVkQP08XhTOHLXno3J5OlVREInF2mL WgbuGjA/BstrjjR5FbQLkTxTw7Eg2A+t1D7akX9JKMVYSIvTHmbBqN0tv7DFu6wBo0y6 ANKA== X-Forwarded-Encrypted: i=1; AJvYcCUB4ZV6ETJ3J1U+Oo3Bon8cwTLh3eqncvWoa90nw4wnZeFBJpIn4C/bwoosGhOQCOl4ivFynS+w/jtFM8UH@postgresql.org X-Gm-Message-State: AOJu0YyiPBng9hQ9KX4DIK0NTRY711Ttu4jX5LBzLBqknpexS9MDsttf YSx9AlBFmhkLTHhWGelkYjgZTDWBEZBpRNsHZHpdKKJBUhQGooLNm+X5gBjVw3CjijemlXuS+0Y MbGOJEDS5VlVkQE/evJCHrE8pLXs= X-Google-Smtp-Source: AGHT+IHycjr0rJBC6sltrAI8mfkXax+XL01hEsu07SybOn3f338QUS2GKPiWKYn6c+FlEeowHEILIrCjkmzQVpQ0oUM= X-Received: by 2002:a05:6a20:7490:b0:1db:df34:a1d6 with SMTP id adf61e73a8af0-1dc22b912d7mr16735867637.42.1731336416524; Mon, 11 Nov 2024 06:46:56 -0800 (PST) MIME-Version: 1.0 References: <897B047D-B99D-4637-ACBD-E98EC3D38DD5@leisi.net> In-Reply-To: From: "sunyucong@gmail.com" Date: Mon, 11 Nov 2024 09:46:45 -0500 Message-ID: Subject: Re: Advice on cluster architecture for two related, but distinct, use cases To: Greg Sabino Mullane Cc: Matthias Leisi , pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="0000000000001803550626a42c33" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001803550626a42c33 Content-Type: text/plain; charset="UTF-8" CC On Mon, Nov 11, 2024 at 09:28 Greg Sabino Mullane wrote: > Some of those requirements are vague, but yes, Patroni should probably be > the first approach you look at. If the second datacenter is just for > redundancy, then a simple setup would be: > > DCA (data center A): > Postgres server 1 > Postgres server 2 > > DCB: > Postgres server 3 (set no_failover: true) > > You will also need a DCS system of some sort (e.g. etcd on all three > nodes), as well as a backup system (e.g. pgBackRest). Will also need to > decide how automated you want things to be (for example, cross datacenter > failover in the above would be manually done). It should definitely be able > to handle your RPO/RTO requirements easily enough. > > [Patroni] However it seems relatively complex to set up and operate > > > Setting things up can be a little complex, yes, but once done it just > works, so very little operation resources are needed. > > We can not assume eg a load balancer. > > > Possible via the application: see > https://www.postgresql.org/docs/current/libpq-connect.html (esp. > target_session_attrs) > > Cheers, > Greg > > --0000000000001803550626a42c33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
CC

On Mon, Nov 11, 2024 at 09:28 Greg Sabino Mullane <htamfids@gmail.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
Some o= f those requirements are vague, but yes, Patroni should probably be the fir= st approach you look at. If the second datacenter is just for redundancy, t= hen a simple setup would be:

DCA (data center A):<= /div>
Postgres server 1
Postgres server 2

DCB:
Postgres server 3 (set no_failover: true)
You will also need a DCS system of some sort (e.g. etcd on all= three nodes), as well as a backup system (e.g. pgBackRest). Will also need= to decide how automated you want things to be (for example, cross datacent= er failover in the above would be manually done). It should definitely be a= ble to handle your RPO/RTO requirements easily enough.

=
[Patroni] However it seem= s relatively complex to set up and operate

= Setting things up can be a little complex, yes, but once done it just works= , so very little operation resources are needed.=C2=A0

=
We can not assume eg a lo= ad balancer.

Possible via the application: = see=C2=A0https://www.postgresql.org/docs/current/libpq-connec= t.html (esp. target_session_attrs)

Cheers,
Greg

--0000000000001803550626a42c33--