@@ -27,7 +27,7 @@ other nodes. This is done by using 3 phase commit protocol and heartbeats for fa
27
27
brought back to cluster can be fast-forwaded to actual state automatically in case when transactions log still
28
28
exists since the time when node was excluded from cluster (this depends on checkpoint configuration in postgres).
29
29
30
- Read more about internals on [ architecture] ( /contrib/mmts/ doc/architecture.md) page.
30
+ Read more about internals on [ architecture] ( doc/architecture.md ) page.
31
31
32
32
33
33
@@ -43,32 +43,32 @@ Ensure that following prerequisites are installed:
43
43
44
44
for Debian based linux:
45
45
46
- ``` sh
46
+ ```
47
47
apt-get install -y git make gcc libreadline-dev bison flex zlib1g-dev
48
48
```
49
49
50
50
for RedHat based linux:
51
51
52
- ``` sh
52
+ ```
53
53
yum groupinstall 'Development Tools'
54
54
yum install git, automake, libtool, bison, flex readline-devel
55
55
```
56
56
57
57
After that everything is ready to install postgres along with extensions
58
58
59
- ``` sh
59
+ ```
60
60
git clone https://github.com/postgrespro/postgres_cluster.git
61
61
cd postgres_cluster
62
62
./configure && make && make -j 4 install
63
- cd ../../ contrib/mmts && make install
63
+ cd contrib/mmts && make install
64
64
```
65
65
66
66
### Docker
67
67
68
68
Directory contrib/mmts also includes docker-compose.yml that is capable of building multi-master and starting
69
69
3 node cluster.
70
70
71
- ``` sh
71
+ ```
72
72
cd contrib/mmts
73
73
docker-compose up
74
74
```
@@ -81,35 +81,35 @@ After things go more stable we will release prebuilt packages for major platform
81
81
82
82
1 . Add these required options to the ` postgresql.conf ` of each instance in the cluster.
83
83
84
- ```
85
- wal_level = logical # multimaster is build on top of
86
- # logical replication and will not work otherwise
87
- max_connections = 100
88
- max_prepared_transactions = 300 # all transactions are implicitly two-phase, so that's
89
- # a good idea to set this equal to max_connections*N_nodes.
90
- max_wal_senders = 10 # at least the number of nodes
91
- max_replication_slots = 10 # at least the number of nodes
92
- max_worker_processes = 250 # Each node has:
93
- # N_nodes-1 receiver
94
- # N_nodes-1 sender
95
- # 1 mtm-sender
96
- # 1 mtm-receiver
97
- # Also transactions executed at neighbour nodes can cause spawn of
98
- # background pool worker at our node. At max this will be equal to
99
- # sum of max_connections on neighbour nodes.
100
-
101
-
102
-
103
- shared_preload_libraries = 'multimaster'
104
- multimaster.max_nodes = 3 # cluster size
105
- multimaster.node_id = 1 # the 1-based index of the node in the cluster
106
- multimaster.conn_strings = 'dbname=mydb host=node1.mycluster, ...'
107
- # comma-separated list of connection strings to neighbour nodes.
108
- ```
84
+ ```
85
+ wal_level = logical # multimaster is build on top of
86
+ # logical replication and will not work otherwise
87
+ max_connections = 100
88
+ max_prepared_transactions = 300 # all transactions are implicitly two-phase, so that's
89
+ # a good idea to set this equal to max_connections*N_nodes.
90
+ max_wal_senders = 10 # at least the number of nodes
91
+ max_replication_slots = 10 # at least the number of nodes
92
+ max_worker_processes = 250 # Each node has:
93
+ # N_nodes-1 receiver
94
+ # N_nodes-1 sender
95
+ # 1 mtm-sender
96
+ # 1 mtm-receiver
97
+ # Also transactions executed at neighbour nodes can cause spawn of
98
+ # background pool worker at our node. At max this will be equal to
99
+ # sum of max_connections on neighbour nodes.
100
+
101
+
102
+
103
+ shared_preload_libraries = 'multimaster'
104
+ multimaster.max_nodes = 3 # cluster size
105
+ multimaster.node_id = 1 # the 1-based index of the node in the cluster
106
+ multimaster.conn_strings = 'dbname=mydb host=node1.mycluster, ...'
107
+ # comma-separated list of connection strings to neighbour nodes.
108
+ ```
109
109
110
110
2. Allow replication in `pg_hba.conf`.
111
111
112
- Read description of all configuration params at [ configuration] ( /contrib/mmts/ doc/configuration.md)
112
+ Read description of all configuration params at [configuration](doc/configuration.md)
113
113
114
114
## Management
115
115
@@ -120,7 +120,7 @@ Read description of all configuration params at [configuration](/contrib/mmts/do
120
120
* `mtm.get_cluster_info()` -- print some debug info
121
121
* `mtm.make_table_local(relation regclass)` -- stop replication for a given table
122
122
123
- Read description of all management functions at [ functions] ( /contrib/mmts/ doc/functions.md)
123
+ Read description of all management functions at [functions](doc/functions.md)
124
124
125
125
126
126
0 commit comments