配置环境
主机名 | ip地址 | 角色 | 数据库目录 |
master | 192.168.0.104 | 主库 | /pgdata/9.6/poc/data |
slave | 192.168.0.105 | standby | /pgdata/9.6/poc/data |
1.主数据库环境配置
1.1 配置 pg_hba.conf 文件
[postgres@master ~]$ cd /home/postgres
[postgres@master ~]$ cd /pgdata/9.6/poc/data
[postgres@master ~]$ vim pg_hba.conf
要使用流复制,需要允许主库接受流复制的连接,需要vim 编辑pg_hba.conf文件,做如下配置:
# TYPE DATABASE USER ADDRESS