recovery.conf 用于 stream replication
生活随笔
收集整理的这篇文章主要介绍了
recovery.conf 用于 stream replication
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
recovery.conf 是 postgresql slave 数据库的重要文件,示例文件为.
$ 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 对应 postgresql.conf 的 synchronous_standby_names 的变量值
同时 slot 不是必须的,但是建议使用,在 master 上需要首先创建 slot
postgres=# select * from pg_create_physical_replication_slot('pgsql_node2');同步时,在master上必须设置如下参数:
fsync = on synchronous_commit = on #同步复制必须设置为on synchronous_standby_names = 'node2,node3' #同步复制必须设置 或者 synchronous_standby_names = '*' full_page_writes = on wal_log_hints = on转载于:https://www.cnblogs.com/ctypyb2002/p/9792900.html
总结
以上是生活随笔为你收集整理的recovery.conf 用于 stream replication的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: redis -- 学习
- 下一篇: 冷凝器换热效果变差后果