DBAtlas · Veritabanı operasyon atlası

Fiziksel replika kur (pg_basebackup)

PostgreSQLReplikasyon

Komut

pg_basebackup -h primary_host -U replikator -D /var/lib/postgresql/16/main -Fp -Xs -P -R --slot=replica_slot_1 -C

Ne yapar?

Primary'den tam fiziksel yedek alır, streaming ile WAL'ı çeker (-Xs), standby.signal ve primary_conninfo'yu yazar (-R) ve replikasyon slot'unu oluşturur (-C).

Ne zaman kullanılır?

Yeni bir streaming standby (okuma replikası veya failover hedefi) kurmak için.

Dikkat

Hedef dizin (-D) boş olmalı. Primary'de pg_hba.conf'ta replikator kullanıcısına 'replication' izni ve yeterli wal_keep_size / slot bulunmalı. -R PostgreSQL 12+ ile recovery.conf yerine standby.signal üretir.

DBAtlas'ta aç →

İlgili