recovery.conf 用于 stream replication
生活随笔
收集整理的這篇文章主要介紹了
recovery.conf 用于 stream replication
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
recovery.conf 是 postgresql slave 數(shù)據(jù)庫的重要文件,示例文件為.
$ ls -l $PGHOME/share/recovery.conf.sample可以編輯 $PGDATA/recovery.conf
異步stream
recovery_target_timeline = 'latest' standby_mode = 'on' primary_conninfo = 'host=192.168.56.201 port=5432 user=replicator password=passw0rd' primary_slot_name = 'pgsql_node02' trigger_file = '/tmp/postgresql.trigger.5432'##同步stream
recovery_target_timeline = 'latest' standby_mode = 'on primary_conninfo = 'host=192.168.56.201 port=5432 user=replicator password=passw0rd application_name=node02' primary_slot_name = 'pgsql_node02' trigger_file = '/tmp/postgresql.trigger.5432'相比異步多了 application_name=node02
備注一下:
application_name 對應(yīng) postgresql.conf 的 synchronous_standby_names 的變量值
同時 slot 不是必須的,但是建議使用,在 master 上需要首先創(chuàng)建 slot
postgres=# select * from pg_create_physical_replication_slot('pgsql_node2');同步時,在master上必須設(shè)置如下參數(shù):
fsync = on synchronous_commit = on #同步復(fù)制必須設(shè)置為on synchronous_standby_names = 'node2,node3' #同步復(fù)制必須設(shè)置 或者 synchronous_standby_names = '*' full_page_writes = on wal_log_hints = on轉(zhuǎn)載于:https://www.cnblogs.com/ctypyb2002/p/9792900.html
總結(jié)
以上是生活随笔為你收集整理的recovery.conf 用于 stream replication的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: redis -- 学习
- 下一篇: 冷凝器换热效果变差后果