Skip to content

Commit a5bb274

Browse files
authored
Merge pull request #48 from cybertec-postgresql/47-update-yaml-templates-to-the-latest-versions
[*] update `.yaml` templates to the latest versions, closes #47
2 parents fe87de1 + 7bee4db commit a5bb274

File tree

5 files changed

+60
-76
lines changed

5 files changed

+60
-76
lines changed

make.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ if exist %SEVENZIP% (
7474
)
7575
TIMEOUT 5
7676
MOVE vip-manager* %MD%\vip-manager || EXIT /B
77+
DEL %MD%\vip-manager\*.yml || EXIT /B
78+
COPY src\vip.yaml %MD%\vip-manager\ || EXIT /B
7779
DEL %TEMP%\vip.zip || EXIT /B
7880
@ECHO --- VIP-MANAGER downloaded ---
7981

@@ -145,12 +147,10 @@ CALL make-installer.bat || EXIT /B
145147

146148
@ECHO --- Prepare archive ---
147149
if exist %SEVENZIP% (
148-
%SEVENZIP% a "%MD%.zip" -y "%MD%" -sdel
150+
%SEVENZIP% a "%MD%.zip" -y "%MD%"
149151
) else (
150152
powershell -Command "Compress-Archive '%MD%' '%MD%.zip'"
151153
)
152154
@ECHO --- Archive compressed ---
153155

154-
155-
156-
@ECHO --- PACKAGING FINISHED ---
156+
@ECHO --- PACKAGING FINISHED ---

src/etcd.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
name: 'win1'
2+
data-dir: win1.etcd
13
heartbeat-interval: 100
24
election-timeout: 1000
35
listen-peer-urls: http://0.0.0.0:2380
46
listen-client-urls: http://0.0.0.0:2379
7+
initial-advertise-peer-urls: http://192.168.178.88:2380
8+
advertise-client-urls: http://192.168.178.88:2379
9+
initial-cluster: win1=http://192.168.178.88:2380,win2=http://192.168.178.89:2380,win3=http://192.168.178.90:2380
10+
initial-cluster-token: 'etcd-cluster'
11+
initial-cluster-state: 'new'
512
enable-v2: true

src/patroni.yaml

Lines changed: 26 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,51 @@
1-
scope: batman
2-
#namespace: /service/
3-
name: postgresql0
1+
scope: pgcluster
2+
namespace: /service/
3+
name: win1
44

55
restapi:
6-
listen: 127.0.0.1:8008
7-
connect_address: 127.0.0.1:8008
8-
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
9-
# keyfile: /etc/ssl/private/ssl-cert-snakeoil.key
10-
# authentication:
11-
# username: username
12-
# password: password
13-
14-
# ctl:
15-
# insecure: false # Allow connections to SSL sites without certs
16-
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
17-
# cacert: /etc/ssl/certs/ssl-cacert-snakeoil.pem
6+
listen: 0.0.0.0:8008
7+
connect_address: 192.168.178.88:8008
188

199
etcd:
20-
host: 127.0.0.1:2379
10+
hosts:
11+
- 192.168.178.88:2379
12+
- 192.168.178.89:2379
13+
- 192.168.178.90:2379
2114

2215
bootstrap:
23-
# this section will be written into Etcd:/<namespace>/<scope>/config after initializing new cluster
24-
# and all other cluster members will use it as a `global configuration`
2516
dcs:
2617
ttl: 30
2718
loop_wait: 10
2819
retry_timeout: 10
29-
maximum_lag_on_failover: 1048576
30-
# master_start_timeout: 300
31-
# synchronous_mode: false
32-
#standby_cluster:
33-
#host: 127.0.0.1
34-
#port: 1111
35-
#primary_slot_name: patroni
20+
maximum_lag_on_failover: 1048906
3621
postgresql:
3722
use_pg_rewind: true
38-
# use_slots: true
23+
use_slots: true
3924
parameters:
40-
# wal_level: hot_standby
41-
# hot_standby: "on"
42-
# wal_keep_segments: 8
43-
# max_wal_senders: 10
44-
# max_replication_slots: 10
45-
# wal_log_hints: "on"
46-
# archive_mode: "on"
47-
# archive_timeout: 1800s
48-
# archive_command: mkdir -p ../wal_archive && test ! -f ../wal_archive/%f && cp %p ../wal_archive/%f
49-
# recovery_conf:
50-
# restore_command: cp ../wal_archive/%f %p
51-
52-
# some desired options for 'initdb'
53-
initdb: # Note: It needs to be a list (some options need values, others are switches)
25+
logging_collector: true
26+
log_directory: log
27+
log_filename: postgresql.log
28+
wal_keep_segments: 50
29+
pg_hba:
30+
- host replication replicator 0.0.0.0/0 md5
31+
- host all all 0.0.0.0/0 md5
32+
33+
initdb:
5434
- encoding: UTF8
5535
- data-checksums
5636

57-
pg_hba: # Add following lines to pg_hba.conf after running 'initdb'
58-
- host replication replicator 127.0.0.1/32 md5
59-
- host all all 0.0.0.0/0 md5
60-
# - hostssl all all 0.0.0.0/0 md5
61-
62-
# Additional script to be launched after initial cluster creation (will be passed the connection URL as parameter)
63-
# post_init: /usr/local/bin/setup_cluster.sh
64-
65-
# Some additional users users which needs to be created after initializing new cluster
66-
users:
67-
admin:
68-
password: admin
69-
options:
70-
- createrole
71-
- createdb
72-
7337
postgresql:
74-
listen: 127.0.0.1:5432
75-
connect_address: 127.0.0.1:5432
76-
data_dir: data/postgresql0
77-
# bin_dir: C:/bigsql/pg11/bin
78-
# config_dir:
79-
pgpass: data/pgpass0
38+
listen: 0.0.0.0:5432
39+
connect_address: 192.168.178.88:5432
40+
data_dir: ../pgsql/data
41+
bin_dir: ../pgsql/bin
8042
authentication:
8143
replication:
8244
username: replicator
83-
password: rep-pass
45+
password: reptilefluid
8446
superuser:
8547
username: postgres
86-
password: zalando
87-
parameters:
88-
unix_socket_directories: '.'
89-
90-
#watchdog:
91-
# mode: automatic # Allowed values: off, automatic, required
92-
# device: /dev/watchdog
93-
# safety_margin: 5
48+
password: snakeoil
9449

9550
tags:
9651
nofailover: false

src/vip.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# time (in milliseconds) after which vip-manager wakes up and checks if it needs to register or release ip addresses.
2+
interval: 1000
3+
4+
# the etcd or consul key which vip-manager will regularly poll.
5+
key: "/service/pgcluster/leader"
6+
# if the value of the above key matches the trigger-value (often the hostname of this host), vip-manager will try to add the virtual ip address to the interface specified in Iface
7+
nodename: "win2"
8+
9+
ip: 192.168.178.123 # the virtual ip address to manage
10+
mask: 24 # netmask for the virtual ip
11+
iface: "Ethernet 2" #interface to which the virtual ip will be added
12+
13+
endpoint_type: etcd # etcd or consul
14+
# a list that contains all DCS endpoints to which vip-manager could talk.
15+
endpoints:
16+
- http://192.168.178.96:2379
17+
- http://192.168.178.97:2379
18+
- http://192.168.178.98:2379
19+
20+
# how often things should be retried and how long to wait between retries. (currently only affects arpClient)
21+
retry_num: 2
22+
retry_after: 250 #in milliseconds

src/vip_service.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<name>vip-manager</name>
44
<description>Manager for a virtual IP based on state kept in etcd or Consul </description>
55
<executable>%BASE%\vip-manager.exe</executable>
6-
<arguments>--config %BASE%\vip-manager.yaml</arguments>
6+
<arguments>--config %BASE%\vip.yaml</arguments>
77
<logpath>%BASE%\log</logpath>
88
</service>

0 commit comments

Comments
 (0)