This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
/
postgresql_worker.yml.erb
67 lines (64 loc) · 2.3 KB
/
postgresql_worker.yml.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
<%
service = "postgresql"
plan_enabled = properties.service_plans && properties.service_plans.send(service.to_sym)
plan = properties.plan || "free"
plan_conf = plan_enabled && properties.service_plans.send(service.to_sym).send(plan.to_sym).configuration
lifecycle = properties.service_lifecycle
use_warden = plan_enabled && plan_conf.warden && plan_conf.warden.enable
node = properties.postgresql_node
supported_versions = node.supported_versions
version_configs = {
'9.0' => {
'port' => 5432,
'binary_dir' => '/var/vcap/packages/postgresql/bin',
},
'9.1' => {
'port' => 5433,
'binary_dir' => '/var/vcap/packages/postgresql91/bin',
}
}
%>
<% if lifecycle and lifecycle.resque %>
<% snapshot_dir = lifecycle.mount_point || "/var/vcap/services_snapshot" %>
service_name: postgresql
snapshots_base_dir: <%= snapshot_dir %>
serialization_base_dir: <%= snapshot_dir %>
local_db: sqlite3:/var/vcap/store/postgresql_node.db
tmp_dir: <%= properties.service_lifecycle.tmp_dir || "/tmp" %>
resque:
host: <%= properties.service_lifecycle.resque.host %>
port: <%= properties.service_lifecycle.resque.port %>
password: <%= properties.service_lifecycle.resque.password %>
expire: <%= properties.service_lifecycle.resque.expire %>
logging:
level: debug
file: /var/vcap/sys/log/postgresql_node/postgresql_worker.log
<% if properties.syslog_aggregator %>
syslog: vcap.postgresql_worker
<% end %>
index: <%= spec.index %>
node_id: <%= "#{service}_node_#{plan}_#{spec.index}" %>
download_url_template: "http://<%= lifecycle.download_url %>/serialized/%{service}/%{name}/snapshots/%{snapshot_id}?token=%{token}"
snapshot_quota: <%= plan_enabled && plan_conf.lifecycle && plan_conf.lifecycle.snapshot && plan_conf.lifecycle.snapshot.quota || 0 %>
# optional download tuning
serialization:
max_download_size_mb: <%= properties.service_lifecycle.serialization_max_download_size || 10 %>
# addtional options
postgresql:
<% for version in supported_versions
config = version_configs[version]
%>
'<%= version %>':
host: 127.0.0.1
user: vcap
pass: <%= node.password %>
port: <%= config['port'] %>
database: postgres
dump_bin: <%= "#{config['binary_dir']}/pg_dump" %>
restore_bin: <%= "#{config['binary_dir']}/pg_restore" %>
<% end %>
<%if use_warden%>
use_warden: true
<%end%>
<% end %>