Skip to content
This repository
Browse code

postgres job listens to all attached networks

Control the available listen_addresses via
deployment manifest - add networks to the job

For example, to attach new networks:

    jobs:
    - name: uuadb
    - template: postgres
    - networks:
      - name: apps
        static_ips:
        - 1.2.3.4
      - name: management
        static_ips:
        - 9.8.7.6

Change-Id: I53f7c450ccd3939b21f0e4aa5ab33db0d7f1c4c1
  • Loading branch information...
commit 58334e92455c69e85278cf59ac27db7875c87d4f 1 parent ceda3a7
Dr Nic Williams authored January 07, 2013 Gerrit Code Review committed February 09, 2013
2  jobs/postgres/templates/postgres_ctl.erb
@@ -14,7 +14,7 @@ LOG_DIR=/var/vcap/sys/log/postgres
14 14
 # overwriting $PIDFILE with actual DB server pid
15 15
 PIDFILE=$RUN_DIR/postgres.pid
16 16
 
17  
-HOST="<%= db.address %>"
  17
+HOST='0.0.0.0'
18 18
 PORT="<%= db.port %>"
19 19
 LD_LIBRARY_PATH=$PACKAGE_DIR/lib:$LD_LIBRARY_PATH
20 20
 
17  jobs/postgres/templates/postgresql.conf.erb
... ...
@@ -1,6 +1,21 @@
1 1
 <% db = properties.send(properties.db) %>
2 2
 
3  
-listen_addresses = '<%= db.address %>'
  3
+# Control the available listen_addresses via
  4
+# deployment manifest - add networks to the job
  5
+#
  6
+# For example, to attach new networks:
  7
+#
  8
+# jobs:
  9
+# - name: uuadb
  10
+# - template: postgres
  11
+# - networks:
  12
+#   - name: apps
  13
+#     static_ips:
  14
+#     - 1.2.3.4
  15
+#   - name: management
  16
+#     static_ips:
  17
+#     - 9.8.7.6
  18
+listen_addresses = '0.0.0.0'
4 19
 port = <%= db.port %>
5 20
 max_connections = 500
6 21
 external_pid_file = '/var/vcap/sys/run/postgres/postgres.pid'

Git Notes

review

Code-Review+2: Matthew Kocher <mkocher@pivotallabs.com>
Verified+1: Matthew Kocher <mkocher@pivotallabs.com>
Submitted-by: Matthew Kocher <mkocher@pivotallabs.com>
Submitted-at: Sat, 09 Feb 2013 00:18:52 +0000
Reviewed-on: http://reviews.cloudfoundry.org/13767
Project: cf-release
Branch: refs/heads/staging

0 notes on commit 58334e9

Please sign in to comment.
Something went wrong with that request. Please try again.