Skip to content

Commit 147d32e

Browse files
committed
feat: implement repmgr
1 parent e4d7765 commit 147d32e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3180
-1243
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ examples/master-standby/standby-2/*
2727
!examples/master-standby/standby-1/.keep
2828
!examples/master-standby/standby-2/.keep
2929

30+
# Exclude PSQL data from repmgr example
31+
examples/repmgr/psql-1/*
32+
examples/repmgr/psql-2/*
33+
examples/repmgr/psql-3/*
34+
examples/repmgr/psql-4/*
35+
!examples/repmgr/psql-1/.keep
36+
!examples/repmgr/psql-2/.keep
37+
!examples/repmgr/psql-3/.keep
38+
!examples/repmgr/psql-4/.keep
39+
40+
# Global Project settings
3041
.vscode/*.log
3142
examples/.env
3243
tmp/

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"timonwong.shellcheck",
66
"yzhang.markdown-all-in-one",
77
"PKief.material-icon-theme",
8-
"ms-azuretools.vscode-docker"
8+
"ms-azuretools.vscode-docker",
9+
"bierner.markdown-mermaid"
910
]
1011
}

.vscode/settings.json

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
{
2+
"editor.wordWrap": "off",
23
"files.eol": "\n",
34
"files.defaultLanguage": "shellscript",
45
"files.associations": {
56
"untitled-*": "shellscript",
6-
"**/root/[!.]": "shellscript",
7-
"**/hooks[!.]": "shellscript",
8-
"config.env": "shellscript",
9-
"deploy.env": "shellscript"
7+
"**/rootfs[!.]": "shellscript"
108
},
119
"[shellscript]": {
1210
"files.eol": "\n",
1311
"editor.tabSize": 2,
1412
"editor.insertSpaces": true
1513
},
14+
"[markdown]": {
15+
"editor.unicodeHighlight.ambiguousCharacters": false,
16+
"editor.unicodeHighlight.invisibleCharacters": false,
17+
"diffEditor.ignoreTrimWhitespace": false,
18+
"editor.wordWrap": "off",
19+
"editor.quickSuggestions": {
20+
"comments": "off",
21+
"strings": "off",
22+
"other": "off"
23+
}
24+
},
1625
"shellcheck.enable": true,
1726
"shellcheck.run": "onSave",
1827
"shellcheck.customArgs": [
@@ -40,5 +49,18 @@
4049
"args": [],
4150
"icon": "terminal-ubuntu"
4251
}
43-
}
52+
},
53+
"markdown.extension.toc.omittedFromToc": {
54+
"README.md": [
55+
"## Table of Contents"
56+
],
57+
"docs/ENVIRONMENT.md": [
58+
"## Table of Contents"
59+
],
60+
"docs/DEVELOPMENT.md": [
61+
"## Table of Contents"
62+
]
63+
},
64+
"markdown-mermaid.lightModeTheme": "default",
65+
"markdown-mermaid.darkModeTheme": "dark"
4466
}

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ RUN apk add --update --force-overwrite --no-cache \
3131
postgresql-contrib \
3232
postgresql-jit \
3333
postgresql-pg_cron \
34-
pgtcl
34+
pgtcl \
35+
repmgr \
36+
repmgr-daemon && \
37+
rm -rf /etc/repmgr.conf
3538

3639

3740
# Runtime container
@@ -56,7 +59,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5659
EXPOSE 5432/tcp
5760

5861
WORKDIR ${HOME}
59-
VOLUME [ "${HOME}", "${HOME}/archive" ]
62+
VOLUME [ "${HOME}" ]
6063

6164
COPY rootfs/ /
6265

Dockerfile.10

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ RUN apk add --update --force-overwrite --no-cache --repository=http://dl-cdn.alp
3333
postgresql-contrib=10.12-r0 \
3434
pgtcl
3535

36+
RUN apk add --update --force-overwrite --no-cache --force-broken-world \
37+
repmgr \
38+
repmgr-daemon && \
39+
rm -rf /etc/repmgr.conf
40+
3641

3742
# Runtime container
3843
FROM postgresql as runtime
@@ -57,7 +62,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5762
EXPOSE 5432/tcp
5863

5964
WORKDIR ${HOME}
60-
VOLUME [ "${HOME}", "${HOME}/archive" ]
65+
VOLUME [ "${HOME}" ]
6166

6267
COPY rootfs/ /
6368

Dockerfile.11

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ RUN apk add --update --force-overwrite --no-cache --repository=http://dl-cdn.alp
3333
postgresql-contrib=11.12-r0 \
3434
pgtcl
3535

36+
RUN apk add --update --force-overwrite --no-cache --force-broken-world \
37+
repmgr \
38+
repmgr-daemon && \
39+
rm -rf /etc/repmgr.conf
40+
3641

3742
# Runtime container
3843
FROM postgresql as runtime
@@ -57,7 +62,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5762
EXPOSE 5432/tcp
5863

5964
WORKDIR ${HOME}
60-
VOLUME [ "${HOME}", "${HOME}/archive" ]
65+
VOLUME [ "${HOME}" ]
6166

6267
COPY rootfs/ /
6368

Dockerfile.12

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ RUN apk add --update --force-overwrite --no-cache \
3232
postgresql12-jit \
3333
pgtcl
3434

35+
RUN apk add --update --force-overwrite --no-cache --force-broken-world \
36+
repmgr \
37+
repmgr-daemon && \
38+
rm -rf /etc/repmgr.conf
39+
3540

3641
# Runtime container
3742
FROM postgresql as runtime
@@ -56,7 +61,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5661
EXPOSE 5432/tcp
5762

5863
WORKDIR ${HOME}
59-
VOLUME [ "${HOME}", "${HOME}/archive" ]
64+
VOLUME [ "${HOME}" ]
6065

6166
COPY rootfs/ /
6267

Dockerfile.13

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ RUN apk add --update --force-overwrite --no-cache \
3232
postgresql13-jit \
3333
pgtcl
3434

35+
RUN apk add --update --force-overwrite --no-cache --force-broken-world \
36+
repmgr \
37+
repmgr-daemon && \
38+
rm -rf /etc/repmgr.conf
39+
3540

3641
# Runtime container
3742
FROM postgresql as runtime
@@ -56,7 +61,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5661
EXPOSE 5432/tcp
5762

5863
WORKDIR ${HOME}
59-
VOLUME [ "${HOME}", "${HOME}/archive" ]
64+
VOLUME [ "${HOME}" ]
6065

6166
COPY rootfs/ /
6267

Dockerfile.14

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ RUN apk add --update --force-overwrite --no-cache \
3333
postgresql-pg_cron \
3434
pgtcl
3535

36+
RUN apk add --update --force-overwrite --no-cache --force-broken-world \
37+
repmgr \
38+
repmgr-daemon && \
39+
rm -rf /etc/repmgr.conf
40+
3641

3742
# Runtime container
3843
FROM postgresql as runtime
@@ -56,7 +61,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5661
EXPOSE 5432/tcp
5762

5863
WORKDIR ${HOME}
59-
VOLUME [ "${HOME}", "${HOME}/archive" ]
64+
VOLUME [ "${HOME}" ]
6065

6166
COPY rootfs/ /
6267

Dockerfile.15

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ RUN apk add --update --force-overwrite --no-cache \
3232
postgresql15-jit \
3333
postgresql-pg_cron \
3434
pgtcl \
35-
ncurses-terminfo-base=6.4_p20230401-r0
35+
repmgr \
36+
repmgr-daemon && \
37+
rm -rf /etc/repmgr.conf
3638

3739

3840
# Runtime container
@@ -57,7 +59,7 @@ HEALTHCHECK --interval=10s --timeout=5s --start-period=60s --retries=3 CMD [ "pg
5759
EXPOSE 5432/tcp
5860

5961
WORKDIR ${HOME}
60-
VOLUME [ "${HOME}", "${HOME}/archive" ]
62+
VOLUME [ "${HOME}" ]
6163

6264
COPY rootfs/ /
6365

0 commit comments

Comments
 (0)