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 1qv6De-003AUN-Je for pgsql-general@arkaria.postgresql.org; Tue, 24 Oct 2023 01:28:30 +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 1qv6Dc-0017eO-27 for pgsql-general@arkaria.postgresql.org; Tue, 24 Oct 2023 01:28:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qv6Db-0017eG-ND for pgsql-general@lists.postgresql.org; Tue, 24 Oct 2023 01:28:28 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qv6DY-002NbA-Vb for pgsql-general@lists.postgresql.org; Tue, 24 Oct 2023 01:28:27 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-d9ad67058fcso3753519276.1 for ; Mon, 23 Oct 2023 18:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698110902; x=1698715702; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wmxCCBr9HUxrLeAvcOphvEjBfcPZqBbzULCf36PxLZU=; b=fsBvVOUSLi/W2qTcLGZCKHqR6ezoxNZrHr9TBzpDVVYsUgyWYdQAM6PExqn/BqIEEM bozGvSRcY04yHRFAYDb8i76Oi/xgWX4qZXr+syp2JF2i8CqujxhtSrOzabIFUrD4wdLq qw23Yt9Ux2agdb2C9zynt8M0mCHOsKgRxC+kXfgOkuHpSAgoP95BpdIhCUcDC+GfIzdv WHA0mc8ltslLBiFm6EkPQzlTi3Vupsz+1YhCCTaVjzsi1Fg+lzOMj0jgvTIRZ24GA6tj DCZzLndHl2FoXAfxmtylkSLRoFWZtH4Rl6q+1DHrCt81xtE7K82CfDL+SXorbPmYoNOV 01Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698110902; x=1698715702; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wmxCCBr9HUxrLeAvcOphvEjBfcPZqBbzULCf36PxLZU=; b=tFQ1Hke4LjKz0d1gmajca6ARg6i5VKQtxWuXaH8VLAvbzQtWXlB3SDJ5FpblFacefp 3oPGQvbFjIpyzzV7qeNaf/VnZWrpY7Sd6pgNGeMGVcP9FiTqLuZAM9DslP8wAy4T6mDE dCk1mjE7cYfPVP0M29BuROw/Lzcwo0BVZjI+GW2U93e0mWE3FK+LzJioK5+B5wszSwco vd/eOpX98Zw5UZYc4r6grSHc/KT1brmo+cVPsVbugivrq6olUfUlA3H9LjX+NJV1kI5H wh0VtPR3DtPmkZFyiLjousO6fVotK0tRwy4QfGVkvR3kODOY6qUkHzBhHNxbCzcmcX+o n0vg== X-Gm-Message-State: AOJu0YxocyvdAhjBXeyzw01M7H2MSkI5AnLmryhEry7L/Cb1wSiMdcPG 2ZSqOK7jXk7ZsjK7v/2hnNsf6w6+Ewo= X-Google-Smtp-Source: AGHT+IGQjsqE8Q3DLMwypsg/AHVIHxQSJqlNUs9uSNn9x9UCx4zERP2yEOQTOFdODSAn2o8jCwo2Fw== X-Received: by 2002:a05:6902:4e9:b0:d06:f99e:6345 with SMTP id w9-20020a05690204e900b00d06f99e6345mr9635925ybs.22.1698110902586; Mon, 23 Oct 2023 18:28:22 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:e077:351f:e0e7:6965? ([2600:1700:bd2c:b810:e077:351f:e0e7:6965]) by smtp.googlemail.com with ESMTPSA id p63-20020a252942000000b00d9abff76f5csm3194458ybp.9.2023.10.23.18.28.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 18:28:22 -0700 (PDT) Message-ID: <7a9570a6-07a9-4b41-b419-b4a0aa67fc53@gmail.com> Date: Mon, 23 Oct 2023 20:28:21 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: setting up streaming replication Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Ron 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 10/23/23 18:16, Brad White wrote: > I'm stumped. > > Using this command to set up the slave and replication on PG v 15: > "C:\Program Files\PostgreSQL\15\bin\pg_basebackup" -h 192.168.1.126 -U > pgrep_user -p 5433 -D "C:\Program Files\PostgreSQL\15\data" -Fp -Xs -R > > If I have PG running on the remote server and the data directory is > intact, then I get an error, Data exists and is not empty. > > If I shut down PG, delete data\*, restart PG, then it fails to start > because the conf files are missing. > > If I leave PG shut down and run pg_basebackup, it times out and asks if pg > is running and listening on the port. Of course it is not. > > I see lots of posts on how to use pg_basebackup, but apparently this isn't > interesting because no one mentions whether pg should be running on > the remote server. No, it should not. This is what works for me, in Linux on the standby system, where "buddy" and "basebackup" are references in .pg_service.conf to the primary server: PGHOST=... pg_ctl status && pg_ctl stop -mfast psql service=buddy -Xac "select pg_drop_replication_slot(slot_name)                          from pg_replication_slots                          where slot_name = 'pgstandby1';" /usr/bin/rm -r $PGDATA/* pg_basebackup --dbname=service=basebackup -D $PGDATA --progress \               --checkpoint=fast -v \               --write-recovery-conf --wal-method=stream \               --create-slot --slot=pgstandby1 --compress=server-zstd pg_ctl start -wt90 -l ${MajVer}/pgstart_standby.log Source: https://www.tecmint.com/configure-postgresql-streaming-replication-in-centos-8/ -- Born in Arizona, moved to Babylonia.