0 like 0 dislike
286 views
asked in PostgreSQL Database Forum by (140 points)  

I have one master and slave1 and  i am creating one more slave through  archive log , but is showing below error after 4 hr replication.

cp: cannot stat /var/lib/pgsql/11/data/pg_log_archive/0000000100002C2F0000000A No such file or directory
2019-04-29 11:29:43.518 IST [852] LOG:  started streaming WAL from primary at 2C2F 28000000 on timeline 1
2019-04-29 11 2943.518 IST [852] FATAL   could not receive data from WAL stream: ERROR:  requested WAL segment 0000000100002C2F0000000A has already been removed

 

and when we check archive log  in directory :pg_log_archive on Master  this archive log is present  "0000000100002C2F0000000A".

can you suggest how to confirm slave to replicate through archive log.

please fine below configuration details of recovery.conf slave2 and pg_hba.conf file of slave2

Recovery.conf:

standby_mode = 'on'
primary_conninfo = 'user=postgres passfile=''/var/lib/pgsql/.pgpass'' host=XXX.XXX.X.XX port=5432 sslmode=prefer sslcompression=0 krbsrvname=postgres target_session_attrs=any'
restore_command = 'cp /var/lib/pgsql/11/data/pg_log_archive/%f "%p"'
 

pg_hba.conf :

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                trust
#host    replication     postgres        127.0.0.1/32            trust
#host    replication     postgres        ::1/128                 trust

host    replication     replication        XXX.XXX.X.XX/32      md5
host    replication     postgres           XXX.XXX.X.XX/32      trust
host    replication     replication        127.0.0.1/32          md5
host    replication     postgres           127.0.0.1/32          trust
host    all             all                0.0.0.0/0             md5

but is showing below error after 5 hr replication.

cp: cannot stat `/var/lib/pgsql/11/data/pg_log_archive/0000000100002C2F0000000A': No such file or directory
2019-04-29 11:29:43.518 IST [852] LOG:  started streaming WAL from primary at 2C2F/28000000 on timeline 1
2019-04-29 11:29:43.518 IST [852] FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment 0000000100002C2F0000000A has already been removed
 

and when we check archive log  in directory :pg_log_archive on Master  this archive log is present  "0000000100002C2F0000000A".

can you suggest  

commented by (4k points)  
and is it multimaster or cascaded replication ?
commented by (140 points)  
i have created slave 3times and it  brack after 7 -8 hrs with same error.

"started streaming WAL from primary at 2C2F/28000000 on timeline 1
 FATAL:  could not receive data from WAL stream: ERROR:  requested WAL segment 0000000100002C2F00000 has already been removed"

when replication brack i found huge archive log generated that time
and this is not cascaded replication 1slave and 2slave directoly  replicate from master (PRD).

i want to create anothe slave which is replicate through  "pg_log_archive"  not through through "pg_wal"  and Master and 1slave host in same location and 2slave host another location.
postgres version 11.

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (4k points)  

copy and paste this achive file 0000000100002C2F0000000A  to 2nd slave  and try to restart again .

 Remove salve data files again if get sequence error again or primary identify errot and take the fresh backup for salve then try to restart the salve

Note: kept it configuration ( postgresql.conf , pg_hba.conf & recovery.conf ) files while taking fresh backup 

commented by (140 points)  
i have created slave 3 time and it  brack after 7 -8 hrs when replication brack i found huge archive log generated that time.

i want to create anothe slave which is replicate through  "pg_log_archive"  not through "pg_wal"

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Feb 19, 2019 by junaith (1.5k points)  
2 like 0 dislike
1 answer
0 like 0 dislike
1 answer
...