hw-cookbooks / repmgr

6 stars 14 forks source link

Repmgr

Installs and configures repmgr to enable and monitor PostgreSQL replication.

Usage

Nodes should be labeled as master or slave. Generally done within a role:

name 'master_role'
run_list('role[pg]', 'recipe[repmgr]')
override_attributes(
  :repmgr => {
    :replication => {
      :role => 'master'
    }
  }
)
name 'slave_role'
run_list('role[pg]', 'recipe[repmgr]')
override_attributes(
  :repmgr => {
    :replication => {
      :role => 'slave'
    }
  }
)

Slaves will search for master node within their current environment and sync to that master. By default slave nodes will allow read-only access.

Infos