Pgbackrest ile Aynı Sunucuya Farklı Dizine Full Backup’dan Dönmek
Pgbackrest ile aynı sunucuya farklı dizine full backup’dan dönmek için aşağıdaki adımları izleyebiliriz.
Pgbackrestin konfigurasyon file’ından aşağıdaki parametre değiştirilir
vi /etc/pgbackrest.conf
pg1-path=/var/lib/pgsql/12/data3
Aşağıdaki dizin yaratılır.
mkdir -p /var/lib/pgsql/12/data3
Aşağıdaki komut ile restore işlemi başlatılır.
pgbackrest –stanza=12_main restore
Sonrasında aşağıdaki postgata port bilgisi değiştirilir
[postgres@bckdnm ~]$ cd 12/data3/
[postgres@bckdnm data3]$ pwd
/var/lib/pgsql/12/data3
[postgres@bckdnm data3]$ vi postgresql.conf
Bu dosyada port bilgisi değiştirilir.
Enson artık database aşağıdaki komut ile başlatılır.
/usr/pgsql-12/bin/pg_ctl -D /var/lib/pgsql/12/data3 start
Aşağıdaki komutlar ile database’in çalıştığını görmüş olursunuz.
Komut-1:
[postgres@bckdnm data3]$ /usr/pgsql-12/bin/pg_ctl -D /var/lib/pgsql/12/data3 status
pg_ctl: server is running (PID: 4109)
/usr/pgsql-12/bin/postgres “-D” “/var/lib/pgsql/12/data3”
Komut-2:
[postgres@bckdnm data3]$ ps -ef | grep postgres
postgres 839 1 0 06:32 ? 00:00:00 /usr/pgsql-12/bin/postmaster -D /var/lib/pgsql/12/data/
postgres 853 839 0 06:32 ? 00:00:00 postgres: logger
postgres 863 839 0 06:32 ? 00:00:00 postgres: checkpointer
postgres 864 839 0 06:32 ? 00:00:00 postgres: background writer
postgres 865 839 0 06:32 ? 00:00:00 postgres: walwriter
postgres 866 839 0 06:32 ? 00:00:00 postgres: autovacuum launcher
postgres 867 839 0 06:32 ? 00:00:00 postgres: archiver failed on 000000010000000000000009
postgres 868 839 0 06:32 ? 00:00:00 postgres: stats collector
postgres 869 839 0 06:32 ? 00:00:00 postgres: logical replication launcher
postgres 4109 1 0 07:58 ? 00:00:00 /usr/pgsql-12/bin/postgres -D /var/lib/pgsql/12/data3
postgres 4110 4109 0 07:58 ? 00:00:00 postgres: logger
postgres 4118 4109 0 07:58 ? 00:00:00 postgres: checkpointer
postgres 4119 4109 0 07:58 ? 00:00:00 postgres: background writer
postgres 4121 4109 0 07:58 ? 00:00:00 postgres: stats collector
postgres 4129 4109 0 07:58 ? 00:00:00 postgres: walwriter
postgres 4130 4109 0 07:58 ? 00:00:00 postgres: autovacuum launcher
postgres 4131 4109 0 07:58 ? 00:00:00 postgres: archiver last was 00000003.history
postgres 4132 4109 0 07:58 ? 00:00:00 postgres: logical replication launcher
root 4384 3631 0 08:03 pts/0 00:00:00 su – postgres
postgres 4385 4384 0 08:03 pts/0 00:00:00 -bash
postgres 4553 4385 0 08:05 pts/0 00:00:00 ps -ef
postgres 4554 4385 0 08:05 pts/0 00:00:00 grep –color=auto postgres