From 158dde27b2e0a289f7017df8c72217464d513bec Mon Sep 17 00:00:00 2001 From: kmalyshev Date: Thu, 26 Nov 2015 13:04:51 +0200 Subject: [PATCH] put heartbeat_interval back --- README.md | 4 +++- bin/start-postgres | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb2aa69..a69b30f 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,8 @@ To run a replicated container with wal-e support. **PG_SLAVES** - The addresses of the slaves. (default: 0.0.0.0/0) +**HEARTBEAT_INTERVAL** - The interval in seconds for the hearbeat between the master and slave. (default: 5) + **HEARTBEAT_ENABLED** - A flag to enable a heartbeat on the slave node. (default: True) ### WAL-E Environment Variables @@ -71,4 +73,4 @@ This is not meant to be in depth documentation for wal-e which is a continuous a *AWS is the only backend currently supported when using wal-e* -**PG_WAL_E_ENABLED** - A flag to enable wal-e continuous archiving to cloud storage. (default: False) \ No newline at end of file +**PG_WAL_E_ENABLED** - A flag to enable wal-e continuous archiving to cloud storage. (default: False) diff --git a/bin/start-postgres b/bin/start-postgres index 16cb323..0b5481b 100644 --- a/bin/start-postgres +++ b/bin/start-postgres @@ -87,6 +87,9 @@ def pg_get_configuration(): # Get the IP addresses for slaves. value = os.getenv('PG_SLAVES', '0.0.0.0/0').split(',') configuration.update({ 'slaves': value }) + # Get the slave heartbeat interval. + value = os.getenv('HEARTBEAT_INTERVAL', 5) + configuration.update({ 'hearbeat_interval': value }) # Get the slave heartbeat flag. value = os.getenv('HEARTBEAT_ENABLED', 'True') configuration.update({ 'heartbeat_enabled': value == 'True' }) @@ -200,4 +203,4 @@ if __name__ == "__main__": try: run('tail', '-F', '/var/log/postgresql/postgresql-9.3-main.log') except KeyboardInterrupt: - print 'Exiting...' \ No newline at end of file + print 'Exiting...'