Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d8a4d6

Browse files
Liudmila Mantrovakelvich
Liudmila Mantrova
authored andcommitted
documentation fixes
1 parent 4ed76ef commit 7d8a4d6

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

doc/administration.md

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
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.
1616

1717

18-
### Sources
18+
### Building multimaster from Source Code
1919

20-
Ensure that following prerequisites are installed:
20+
1. Depending on your operating system, ensure that the following prerequisites are installed.
2121

22-
for Debian based linux:
22+
For Debian based Linux:
2323

2424
```
2525
apt-get install -y git make gcc libreadline-dev bison flex zlib1g-dev
2626
```
2727

28-
for RedHat based linux:
28+
For Red Hat based Linux:
2929

3030
```
3131
yum groupinstall 'Development Tools'
3232
yum install git, automake, libtool, bison, flex readline-devel
3333
```
3434

35-
on mac OS it enough to have XCode command line tools installed.
35+
For macOS systems:
36+
Make sure you have XCode command-line tools installed.
3637

37-
After that everything is ready to install postgres along with multimaster extension.
38+
2. Install PostgreSQL with the multimaster extension:
3839

3940
```
4041
git clone https://github.com/postgrespro/postgres_cluster.git
@@ -43,7 +44,7 @@ cd postgres_cluster
4344
cd contrib/mmts && make install
4445
```
4546

46-
```./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:
4748

4849
```
4950
export PATH=$PATH:/path/to/install/bin
@@ -67,8 +68,7 @@ docker-compose up
6768

6869
### PgPro packages
6970

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.
7272

7373

7474
## Setting up empty cluster
@@ -90,37 +90,38 @@ After installing software on all cluster nodes we can configure our cluster. Her
9090
pg_ctl -D ./datadir -l ./pg.log stop
9191
```
9292
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:
9494
95-
```
96-
### General postgres option to let multimaster work
95+
* Set up PostgreSQL parameters related to replication.
9796
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.
113105
114-
### Multimaster-specific options
106+
* Make sure you have enough background workers allocated for each node:
115107
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
119-
multimaster.conn_strings = 'dbname=mydb user=myuser host=node1, dbname=mydb user=myuser host=node2, dbname=mydb user=myuser host=node3'
120-
# 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
118+
multimaster.conn_strings = 'dbname=mydb user=myuser host=node1, dbname=mydb user=myuser host=node2, dbname=mydb user=myuser host=node3'
119+
# 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.
122123
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).
124125
125126
1. Allow replication in `pg_hba.conf`:
126127

0 commit comments

Comments
 (0)