Re: setting up streaming replication

2023-10-24 Thread b55white
 
 
>  
> On Oct 23, 2023 at 8:30 PM, Ronwrote:
>  
>  
>  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/
>
>
>  It sounds like you are saying that pg_basebackup should be run on the backup 
> server, not on the primary. But a detail that important would be mentioned in 
> the documentation. Especially since it is directly compared to pg_dump, which 
> I only run on the primary. 
>
>  If you are running it from the secondary, how can you have a pg_service.conf 
> since data is empty? 
>  
>  Is all that stuff with slots necessary since the backup will automatically 
> create a temporary slot for replication? 
>  
>  
>
>  Thanks, 
>  
>  Brad. 

 
 

Re: pg_checksums?

2023-10-30 Thread b55white
  
  
  
>   
> On Oct 30, 2023 at 7:00 PM, Paul Försterwrote:
>   
>   
>  Hi Michael,
>
> >  On Oct 30, 2023, at 01:56, Michael Paquierwrote:
> >   
> >   >  - Enable checksums on the previous primary.
> >  - Start the previous primary to be a standby of the node you failed
> >  over to.
>
> That's exactly the reasoning behind my initial idea and question. Patroni 
> does the switchover job for me including catching up on the latest changes, 
> etc.
>
> Seems that opinions vary. Are there any hard facts?
>
> 
>  The best hard facts are those generated in your environment.  
>   
>   
> It turns out that enabling checksums can take quite some time to complete, 
> i.e. downtime for the application which is hard to do in a 24x7 environment.
>
> Yes. Try it first with a smaller sample.
>   
> Cheers
> Paul
>
> 
 

Re: Issue in compiling postgres on latest macOS 14.1.1

2023-11-13 Thread b55white
 
 
 
>  
> On Nov 13, 2023 at 3:45 AM, Shaik Mohammad Mujeeb
> wrote:
>  
>  
> Hi Team,
>  
>  After updating to macOS 14.1.1, I am facing below error while compiling 
> postgres. Can someone help me in solving this?
>  
>  
>
>  ld: multiple errors: archive member '/' not a mach-o file in 
> '/src/port/libpgport.a'; archive member '/' not a mach-o file in 
> '/src/common/libpgcommon.a'
>  clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
>  make[2]: *** [zic] Error 1
>  make[1]: *** [all-timezone-recurse] Error 2
>  make: *** [all-src-recurse] Error 2
>  
>  
>
>
>  
>
>  
>
>
>  
>
>Thanks  &  Regards,
> Mujeeb
>  
>
>  
>  
 
>  
 
>  You didn't specify whether those files exist at the expected locations.  
 
>  
 
>  
 
>  Brad.