|
|
楼主 |
发表于 2022-1-13 16:26:43
|
显示全部楼层
[postgres@aqzhxxh-pg-2 ~]$ pg_basebackup -v -P -R -D /data/pgdata -U replicate -h 10.101.102.86 -p54327 c% J5 S, y. _- w/ ]; W; i( |
pg_basebackup: initiating base backup, waiting for checkpoint to complete
! F6 D! X% \7 S6 O0 N' Jpg_basebackup: checkpoint completed: ^& T, w* d$ V3 B+ |
pg_basebackup: write-ahead log start point: 29/75000028 on timeline 1
, O# V$ P" Z3 \9 Xpg_basebackup: starting background WAL receiver9 f! Q, I0 E: h% T- a+ w
pg_basebackup: created temporary replication slot "pg_basebackup_29262"9 [9 L+ M: ~* r8 h6 S
140644606/140644606 kB (100%), 1/1 tablespace ' M1 J- C- F- C' Q& i) W# _% y5 y" |
pg_basebackup: write-ahead log end point: 29/7522D570
/ e, C+ ~3 N% E4 K: s8 \pg_basebackup: waiting for background process to finish streaming ..., Q) }) C( u# Z. B
pg_basebackup: syncing data to disk ...& c3 ?9 \. ^& R8 s }' E
pg_basebackup: renaming backup_manifest.tmp to backup_manifest7 \* N! O2 o7 S. q: Y
pg_basebackup: base backup completed2 t/ l) s/ J- m5 h6 ]& Z
[postgres@aqzhxxh-pg-2 ~]$ pg_ctl -D /data/pgdata start
- J; q, i. P) c. g) s+ u' Twaiting for server to start....2022-01-13 16:24:13.290 CST [9337] LOG: redirecting log output to logging collector process
" {8 ?5 n' Y R4 a; ]. j2022-01-13 16:24:13.290 CST [9337] HINT: Future log output will appear in directory "log".+ N: K# K8 V" \" ~1 o' ^1 Q
done" V' V( [0 y5 j: q9 y
server started, i/ Z. n7 f9 I1 S$ o
[postgres@aqzhxxh-pg-2 ~]$ psql
* \" |! Y, k' d) ]9 A, [: u& |psql (13.3)/ Q/ O. E2 w/ O
Type "help" for help.5 L9 z# S: G( A: A& W0 ]
5 Z7 r" e+ o% jpostgres=# select * from pg_stat_replication ;& M7 _2 s/ o2 V
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state | sent_lsn | write_lsn | f
& w" k7 @, r" M+ t. F; Blush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_time " ~, h+ P. k2 P, f i/ G
-----+----------+---------+------------------+-------------+-----------------+-------------+---------------+--------------+-------+----------+-----------+--' J) r" B U8 `% A. q- Z$ ~8 m' x
---------+------------+-----------+-----------+------------+---------------+------------+------------
, }) w5 d6 P% T) j/ }(0 rows)
" `1 ]( \) r5 G2 X# H8 r, l6 a$ l$ ]: A Q0 b' G
6 O. R5 Z- e5 q$ j
[postgres@aqzhxxh-pg-1 ~]$ psql, k8 Y, d0 k' t
psql (13.3)
! ]# a8 Y; m$ bType "help" for help.
1 }9 ~% E9 O# m. V7 ?postgres=# select * from pg_stat_replication ;1 H% Y9 Y( @4 f2 |6 U( |+ H
pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | state
% {, ]3 T2 X2 m I% G| sent_lsn | write_lsn | flush_lsn | replay_lsn | write_lag | flush_lag | replay_lag | sync_priority | sync_state | reply_
9 j8 K5 f( t! {) `7 e9 Jtime " i- }2 d8 Y) A5 C
-------+----------+-----------+------------------+---------------+-----------------+-------------+-------------------------------+--------------+-----------) d: s8 [, K; S& x( g/ X
+-------------+-------------+-------------+-------------+-----------------+-----------------+-----------------+---------------+------------+----------------
- d S3 \* d+ K* ?! b) x---------------2 [& d* b" Y9 {2 s) M( q( R
29581 | 16384 | replicate | walreceiver | 10.101.102.87 | | 2193 | 2022-01-13 16:23:56.283942+08 | | streaming
; T% [- J/ v% {* O6 n1 [4 Z( Y| 29/7624DCE8 | 29/7624DCE8 | 29/7624DCE8 | 29/7624DCE8 | 00:00:00.000289 | 00:00:00.001832 | 00:00:00.001834 | 0 | async | 2022-01-13 16:2. E$ e, C. h3 ]
4:17.862534+08
1 h* B3 _4 t5 `# ?. t(1 row)
9 S8 O5 w5 v* l) b3 Z' u2 H9 k
0 T, J; i- X( c R1 \! |7 J3 K4 r( L% n6 s1 z/ W" b8 d% N1 G
|
|