Skip to content

Commit

Permalink
Fix issue 'cannot configure postgresql slave if repmgrd is running'
Browse files Browse the repository at this point in the history
  • Loading branch information
abessifi committed Jul 10, 2014
1 parent 6aa1533 commit 4995461
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@
}
elsif $node_role in ['slave', 'witness'] {

Exec['stop_standby'] -> Exec['clone_master'] ~> Service['postgresql'] -> Exec['standby_register'] -> Exec['start_repmgrd']

Exec['stop_repmgrd'] -> Exec['stop_standby'] -> Exec['clone_master'] ~> Service['postgresql'] -> Exec['standby_register'] -> Exec['start_repmgrd']

# Stop repmgrd if running
exec {'stop_repmgrd':
path => ['/bin','/usr/bin'],
command => 'killall repmgrd',
onlyif => "[ `pidof repmgrd` ]",
}
# Stop standby node if running
exec {'stop_standby':
path => ['/usr/bin', '/usr/lib/postgresql/9.1/bin'],
Expand Down
2 changes: 1 addition & 1 deletion manifests/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
# The real Debian way is to use pg_ctlcluster like so :
# sudo -u postgres pg_ctlcluster 9.3 main start
stop => "sudo -u postgres $pg_ctl -D $pg_data stop -m fast -l $pg_logfile",
restart => "sudo -u postgres $pg_ctl -D $pg_data restart -l $pg_logfile && sleep 10",
restart => "sudo -u postgres $pg_ctl -D $pg_data restart -m fast -l $pg_logfile && sleep 10",
}

service {'postgresql-reload':
Expand Down

0 comments on commit 4995461

Please sign in to comment.