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: doc/administration.md
+36-35Lines changed: 36 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -15,26 +15,27 @@
15
15
Multi-master consist of patched version of postgres and extension mmts, that provides most of the functionality, but depends on several modifications to postgres core.
16
16
17
17
18
-
### Sources
18
+
### Building multimaster from Source Code
19
19
20
-
Ensure that following prerequisites are installed:
20
+
1. Depending on your operating system, ensure that the following prerequisites are installed.
21
21
22
-
for Debian based linux:
22
+
For Debian based Linux:
23
23
24
24
```
25
25
apt-get install -y git make gcc libreadline-dev bison flex zlib1g-dev
```./configure```here is standard postgres autotools script, so it possible to specify [any options](https://www.postgresql.org/docs/9.6/static/install-procedure.html) available in postgres. Also please ensure that /path/to/install/bin is enlisted in ```PATH``` environment variable for current user:
47
+
In this command, ```./configure``` is a standard PostgreSQL autotools script, so you can specify [any options](https://www.postgresql.org/docs/9.6/static/install-procedure.html) available in PostgreSQL. Make sure that /path/to/install/bin is specified in the ```PATH``` environment variable for the current user:
47
48
48
49
```
49
50
export PATH=$PATH:/path/to/install/bin
@@ -67,8 +68,7 @@ docker-compose up
67
68
68
69
### PgPro packages
69
70
70
-
When things go more stable we will release prebuilt packages for major platforms.
71
-
71
+
PostgresPro Enterprise have all necessary dependencies and extensions included, so it is enough just install packages.
72
72
73
73
74
74
## Setting up empty cluster
@@ -90,37 +90,38 @@ After installing software on all cluster nodes we can configure our cluster. Her
90
90
pg_ctl -D ./datadir -l ./pg.log stop
91
91
```
92
92
93
-
1. To be able to run multimaster we need following changes to ```postgresql.conf```:
93
+
1. Modify the ```postgresql.conf``` configuration file, as follows:
94
94
95
-
```
96
-
### General postgres option to let multimaster work
95
+
* Set up PostgreSQL parameters related to replication.
97
96
98
-
wal_level = logical # multimaster is build on top of
99
-
# logical replication and will not work otherwise
100
-
max_connections = 100
101
-
max_prepared_transactions = 300 # all transactions are implicitly two-phase, so that's
102
-
# a good idea to set this equal to max_connections*N_nodes.
103
-
max_wal_senders = 10 # at least the number of nodes
104
-
max_replication_slots = 10 # at least the number of nodes
105
-
max_worker_processes = 250 # Each node has:
106
-
# N_nodes-1 receiver
107
-
# N_nodes-1 sender
108
-
# 1 mtm-sender
109
-
# 1 mtm-receiver
110
-
# Also transactions executed at neighbour nodes can cause spawn of
111
-
# background pool worker at our node. At max this will be equal to
112
-
# sum of max_connections on neighbour nodes.
97
+
```
98
+
wal_level = logical
99
+
max_connections = 100
100
+
max_prepared_transactions = 300
101
+
max_wal_senders = 10 # at least the number of nodes
102
+
max_replication_slots = 10 # at least the number of nodes
103
+
```
104
+
You must change the replication level to `logical` as multimaster relies on logical replication. For a cluster of N nodes,and enable at least N WAL sender processes and replication slots. Since multimaster implicitly adds a PREPARE phase to each COMMIT transaction, make sure to set the number of prepared transactions to N*max_connections. Otherwise, prepared transactions may be queued.
113
105
114
-
### Multimaster-specific options
106
+
* Make sure you have enough background workers allocated for each node:
115
107
116
-
shared_preload_libraries = 'multimaster'
117
-
multimaster.max_nodes = 3 # cluster size
118
-
multimaster.node_id = 1 # the 1-based index of the node in the cluster
# comma-separated list of connection strings to neighbour nodes.
121
-
```
108
+
```
109
+
max_worker_processes = 250
110
+
```
111
+
For example, for a three-node cluster with max_connections = 100, multimaster may need up to 206 background workers at peak times: 200 workers for connections from the neighbour nodes, two workers for walsender processes, two workers for walreceiver processes, and two workers for the arbiter wender and receiver processes. When setting this parameter, remember that other modules may also use backround workers at the same time.
112
+
113
+
* Add multimaster-specific options:
114
+
115
+
```
116
+
multimaster.max_nodes = 3 # cluster size
117
+
multimaster.node_id = 1 # the 1-based index of the node in the cluster
# comma-separated list of connection strings to neighbour nodes
120
+
```
121
+
122
+
> **Important:** The `node_id` variable takes natural numbers starting from 1, without any gaps in numbering. For example, for a cluster of five nodes, set node IDs to 1, 2, 3, 4, and 5. In the `conn_strings` variable, make sure to list the nodes in the order of their IDs. Thus, the `conn_strings` variable must be the same on all nodes.
122
123
123
-
Full description of all configuration parameters available in section [configuration](doc/configuration.md). Depending on network environment and expected usage patterns one can want to tweak parameters.
124
+
Depending on your network environment and usage patterns, you may want to tune other multimaster parameters. For details on all configuration parameters available, see [Tuning configuration params](#tuning-configuration-params).
0 commit comments