Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIeTj-0001CL-NB for pgsql-general@arkaria.postgresql.org; Sun, 29 Mar 2020 20:24:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jIeTC-0008Ow-Rh for pgsql-general@arkaria.postgresql.org; Sun, 29 Mar 2020 20:23:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIeTB-0008Op-NX for pgsql-general@lists.postgresql.org; Sun, 29 Mar 2020 20:23:46 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIeT3-0006e4-0p for pgsql-general@postgresql.org; Sun, 29 Mar 2020 20:23:45 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id A803A3E1; Sun, 29 Mar 2020 16:23:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 29 Mar 2020 16:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=G EApFY6oZkYnC0KKjY4P86/yLstbaRQV5+jms70VwdA=; b=aoOqw0ai4tv9MtkSo 4kc8FwQo5967nzZ8q/NXIp0Fuim+C0F5h1etlDOUPakVg7S16LcxaaphUShQrAdc EEbxCwHXX5fZEZhUIE2mQAOfkoDqY20L1ptXx9VPLKzclnvz24U/63+rDSZ6bwVU hPjB8pffAOXQak9S8JC7EPjLVdS6tl8pEUcYNOdx9KPnZlrzTZjGnkC/7Tuo0OGJ 88yj5X9NLoJkebHiplMI3VSqRDAE5SoPnZ16in2f72C9uK7ZCmq2+cVyK9acxd5I JmbBha0UHCCFz/80Js0DbRXLOiPUUiWBXQsfTSCpzfnSqEifR0KaBCb2XXEqpbQK xV5YQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=GEApFY6oZkYnC0KKjY4P86/yLstbaRQV5+jms70Vw dA=; b=kATcg9ZsxJChgVQE6Mztb5QA+x4zpYnO7jokP4ZwesRUehww4PstWKVh3 yrZ04tZPnKvW7NBQPGPyHFS3FJ01ovSe61QrtbsGq8kGd34tIs3PJ04oG99wuppj nafy+IRlVOI5umauiDRjoWVU4gDSLpo8/qrlL6TkzW/48nYYcqJpAs/l5fyT3dVa T1sidpSj1WKmTuyzCPqwHh5IacCCLqmRh8J3XliT3m4+3Rjhgc7mZeaGHRiQcLM6 5WisIphexsYfr9cx8rcnZTLQTAcLv7s/GzUsCilRiZ+FZzZBnPmyRBjyJ96+Oup8 h30dvi2WdFWuJPGGU6/C212+vTQKw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeifedgudehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefhhenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecukfhppeejhedrudejvddrledtrdelvdenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (75-172-90-92.tukw.qwest.net [75.172.90.92]) by mail.messagingengine.com (Postfix) with ESMTPA id E3E9E3280059; Sun, 29 Mar 2020 16:23:32 -0400 (EDT) Subject: Re: Hot standby from Debian to Windows To: Andrus , pgsql-general References: <97FA59FAD55C40FDB8D6882CC29222AC@dell2> <1F58997A61424440ADD69D5BD610588F@dell2> From: Adrian Klaver Message-ID: Date: Sun, 29 Mar 2020 13:23:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1F58997A61424440ADD69D5BD610588F@dell2> Content-Type: text/plain; charset=windows-1257; 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 3/29/20 12:52 PM, Andrus wrote: > Hi! > >> Since you are moving between different OSes you will need to use some >> form of logical replication as binary replication will not work. > > I can use Hyper-V or something other to run Debian with Windows. > > This hopefully will also allow to bypass Windows 20 connection limit so > that more than 20 users can connect. > >> Given  that you are Postgres 12 you could use the builtin logical >> replication: >> https://www.postgresql.org/docs/12/logical-replication.html > > I see possibilities: > > 1. Use Hyper-V to run Debian container and Postgres binary replication > 2. Use Hyper-V to run Debian container and Postgres logical replication > 3. Use Windows and Postgres logical replication. > 4. Use Hyper-V to run Debian container and backup utility  for whole > disk block level backup > >> How that needs to managed is going to need more information. As a start: >> 1) Downtime allowed? > > Yes. If main server stops, I can tell users to enter backup server > address instead of main server. > >> 2) All databases to be replicated or just some? > > I can create separate cluster so that all databases and users will be > replicated. > There are 30 databases with total size 70 GB. Size will increase slowly > every day when new data is entered. > There are some test and demo databases whose replcation is not really > required but those can also replicated if this > >> 3) Permissible lag between servers? > > Currently backups are created every night and restored in new server. > Backup of 67GB data takes 1 hour, transfer 1 hour, restore and analyze > to new server 4 hours. Total 6 hours. So current lag in 6 .. 24 hours. > > Goal is to decrease this lag. > >> 4) How are you going to deal with the down server and how do you plan >> on bringing it up again? > > VPS hosting company will bring it up again. I will then manually > synchronize two clusters when users continue to enter data, this is not > time critical. Would it not be easier to just set up another Debian server, run binary replication and put them behind something like pgpool? > > Andrus. -- Adrian Klaver adrian.klaver@aklaver.com