You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/solutions/ha-patroni.md
+24-4Lines changed: 24 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -302,9 +302,7 @@ Now it's time to start Patroni. You need the following commands on all nodes but
302
302
$ sudo journalctl -fu percona-patroni
303
303
```
304
304
305
-
A common error is Patroni complaining about the lack of proper entries in the `pg_hba.conf` file. If you see such errors, you must manually add or fix the entries in that file and then restart the service.
306
-
307
-
Changing the `patroni.yml` file and restarting the service will not have any effect here because the bootstrap section specifies the configuration to apply when PostgreSQL is first started in the node. It will not repeat the process even if the Patroni configuration file is modified and the service is restarted.
305
+
See [Troubleshooting Patroni startup](#troubleshooting-patroni-startup) for guidelines in case of errors.
308
306
309
307
If Patroni has started properly, you should be able to locally connect to a PostgreSQL node using the following command:
310
308
@@ -344,4 +342,26 @@ Now it's time to start Patroni. You need the following commands on all nodes but
A common error is Patroni complaining about the lack of proper entries in the `pg_hba.conf` file. If you see such errors, you must manually add or fix the entries in that file and then restart the service.
350
+
351
+
An example of such an error is `No pg_hba.conf entry for replication connection from host to <IP>, user replicator, no encryption`. This means that Patroni cannot connect to the node you're adding to the cluster. To resolve this issue, add the IP addresses of the nodes to the `pg_hba:` section of the Patroni configuration file.
352
+
353
+
```
354
+
pg_hba: # Add following lines to pg_hba.conf after running 'initdb'
355
+
- host replication replicator 127.0.0.1/32 trust
356
+
- host replication replicator 0.0.0.0/0 md5
357
+
- host replication replicator 10.0.100.2/32 trust
358
+
- host replication replicator 10.0.100.3/32 trust
359
+
- host all all 0.0.0.0/0 md5
360
+
- host all all ::0/0 md5
361
+
recovery_conf:
362
+
restore_command: cp /home/postgres/archived/%f %p
363
+
```
364
+
365
+
For production use, we recommend adding nodes individually as the more secure way. However, if your network is secure and you trust it, you can add the whole network these nodes belong to as the trusted one to bypass passwords use during authentication. Then all nodes from this network can connect to Patroni cluster.
366
+
367
+
Changing the `patroni.yml` file and restarting the service will not have any effect here because the bootstrap section specifies the configuration to apply when PostgreSQL is first started in the node. It will not repeat the process even if the Patroni configuration file is modified and the service is restarted.
Copy file name to clipboardExpand all lines: docs/solutions/pgbackrest.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Do the following steps on the `backup` node.
35
35
1. Create environment variables to simplify the config file creation:
36
36
37
37
```{.bash data-prompt="$"}
38
-
export SRV_NAME="bkp-srv"
38
+
export SRV_NAME="backup"
39
39
export NODE1_NAME="node1"
40
40
export NODE2_NAME="node2"
41
41
export NODE3_NAME="node3"
@@ -56,7 +56,7 @@ Do the following steps on the `backup` node.
56
56
57
57
3. The default `pgBackRest` configuration file location is `/etc/pgbackrest/pgbackrest.conf`, but some systems continue to use the old path, `/etc/pgbackrest.conf`, which remains a valid alternative. If the former is not present in your system, create the latter.
58
58
59
-
Access the file's parent directory (either `cd /etc/` or `cd /etc/pgbackrest/`), and make a backup copy of it:
59
+
Go to the file's parent directory (either `cd /etc/` or `cd /etc/pgbackrest/`), and make a backup copy of it:
60
60
61
61
```{.bash data-prompt="$"}
62
62
$ sudo cp pgbackrest.conf pgbackrest.conf.orig
@@ -92,7 +92,7 @@ Do the following steps on the `backup` node.
92
92
repo1-retention-full=4
93
93
94
94
# Server general options
95
-
process-max=12
95
+
process-max=4 # This depends on the number of CPU resources your server has. The recommended value should equal or be less than the number of CPUs. While more processes can speed up backups, they will also consume additional system resources.
96
96
log-level-console=info
97
97
#log-level-file=debug
98
98
log-level-file=info
@@ -174,7 +174,7 @@ Do the following steps on the `backup` node.
174
174
repo1-retention-full=4
175
175
176
176
# Server general options
177
-
process-max=12
177
+
process-max=4 # This depends on the number of CPU resources your server has. The recommended value should equal or be less than the number of CPUs. While more processes can speed up backups, they will also consume additional system resources.
178
178
log-level-console=info
179
179
#log-level-file=debug
180
180
log-level-file=info
@@ -340,7 +340,7 @@ Run the following commands on `node1`, `node2`, and `node3`.
340
340
341
341
```{.bash data-prompt="$"}
342
342
$ export NODE_NAME=`hostname -f`
343
-
$ export SRV_NAME="bkp-srv"
343
+
$ export SRV_NAME="backup"
344
344
$ export CA_PATH="/etc/ssl/certs/pg_ha"
345
345
```
346
346
@@ -379,7 +379,7 @@ Run the following commands on `node1`, `node2`, and `node3`.
379
379
repo1-host-ca-file=${CA_PATH}/ca.crt
380
380
381
381
# general options
382
-
process-max=16
382
+
process-max=6
383
383
log-level-console=info
384
384
log-level-file=debug
385
385
@@ -409,7 +409,7 @@ Run the following commands on `node1`, `node2`, and `node3`.
409
409
repo1-host-ca-file=${CA_PATH}/ca.crt
410
410
411
411
# general options
412
-
process-max=16
412
+
process-max=6
413
413
log-level-console=info
414
414
log-level-file=debug
415
415
@@ -508,7 +508,7 @@ Run the following commands on `node1`, `node2`, and `node3`.
508
508
11. Reload the changed configurations. Provide the cluster name or the node name for the following command. In our example we use the `cluster_1` cluster name:
0 commit comments