Skip to content

Commit 89f011c

Browse files
committed
- patronictl added
- two different .yml added for local tests - patroni_start.bat should be called with .yml argument from now
1 parent 2e3e543 commit 89f011c

File tree

4 files changed

+111
-2
lines changed

4 files changed

+111
-2
lines changed

src/patroni_start.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ SET PYTHONPATH=venv\Scripts
44

55
START etcd\etcd.exe --data-dir=data\etcd
66

7-
%PYTHONPATH%\python.exe patroni\patroni.py postgres-win.yml
7+
%PYTHONPATH%\python.exe patroni\patroni.py %*

src/patronictl.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@ECHO OFF
2+
3+
SETLOCAL
4+
5+
SET PYTHONPATH=venv\Scripts
6+
7+
REM Set here yuour favourite editor
8+
SET EDITOR=notepad.exe
9+
10+
%PYTHONPATH%\python.exe patroni\patronictl.py -c postgres-win0.yml %*

src/postgres-win.yml renamed to src/postgres-win0.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ postgresql:
7676
data_dir: data/postgresql0
7777
# bin_dir: C:/bigsql/pg11/bin
7878
# config_dir:
79-
pgpass: tmp/pgpass0
79+
pgpass: data/pgpass0
8080
authentication:
8181
replication:
8282
username: replicator

src/postgres-win1.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
scope: batman
2+
#namespace: /service/
3+
name: postgresql1
4+
5+
restapi:
6+
listen: 127.0.0.1:8009
7+
connect_address: 127.0.0.1:8009
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
18+
19+
etcd:
20+
host: 127.0.0.1:2379
21+
22+
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`
25+
dcs:
26+
ttl: 30
27+
loop_wait: 10
28+
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
36+
postgresql:
37+
use_pg_rewind: true
38+
# use_slots: true
39+
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)
54+
- encoding: UTF8
55+
- data-checksums
56+
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+
73+
postgresql:
74+
listen: 127.0.0.1:5433
75+
connect_address: 127.0.0.1:5433
76+
data_dir: data/postgresql1
77+
# bin_dir: C:/bigsql/pg11/bin
78+
# config_dir:
79+
pgpass: data/pgpass1
80+
authentication:
81+
replication:
82+
username: replicator
83+
password: rep-pass
84+
superuser:
85+
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
94+
95+
tags:
96+
nofailover: false
97+
noloadbalance: false
98+
clonefrom: false
99+
nosync: false

0 commit comments

Comments
 (0)