305
305
When the node gets synchronized up to the minimum recovery
306
306
lag, all the cluster nodes get locked for write transactions to allow the
307
307
recovery process to finish. By default, the minimum recovery
308
- lag is 10MB . You can change this value in the
308
+ lag is 10KB . You can change this value in the
309
309
<varname>multimaster.min_recovery_lag</varname> variable.
310
310
</para>
311
311
</listitem>
363
363
<application>pg_basebackup</application> on behalf of this user.
364
364
Run the following command on each node you are going to add:
365
365
<programlisting>
366
- pg_basebackup -D <replaceable>datadir</> -h node1 -U myuser mydb
366
+ pg_basebackup -D <replaceable>datadir</> -h node1 -U myuser
367
367
</programlisting>
368
368
where <replaceable>datadir</> is the directory containing the database cluster. This directory is specified at the cluster initialization stage, or set in the <envar>PGDATA</envar> environment variable.
369
369
You can also use any other DBMS user with superuser rights instead of <literal>myuser</literal> to perform this task.
@@ -465,10 +465,11 @@ max_worker_processes = 250
465
465
multimaster.max_nodes = 3 # cluster size
466
466
multimaster.node_id = 1 # the 1-based index of this node
467
467
# in the cluster
468
- multimaster.conn_strings = 'dbname=mydb user=myuser host=node1,dbname=mydb user=myuser host=node2,dbname=mydb user=myuser host=node3'
468
+ multimaster.conn_strings = 'dbname=mydb user=myuser host=node1 port=5432 arbiter_port=5433 ,dbname=mydb user=myuser host=node2 port=5432 arbiter_port=5433 ,dbname=mydb user=myuser host=node3 port=5432 arbiter_port=5433 '
469
469
# comma-separated list
470
470
# of connection strings
471
471
# to neighbor nodes
472
+ multimaster.arbiter_port = 5433
472
473
</programlisting>
473
474
<para>The <literal>multimaster.max_nodes</literal> variable defines the maximum cluster size. If you plan to add new nodes to your cluster, the <literal>multimaster.max_nodes</literal> value should exceed the initial number of nodes. In this case, you can add new nodes without restarting <productname>&productname;</productname> until the specified number of nodes is reached.
474
475
</para>
@@ -487,24 +488,27 @@ multimaster.conn_strings = 'dbname=mydb user=myuser host=node1,dbname=mydb user=
487
488
You can customize connection parameters by adding other
488
489
<link linkend="libpq-paramkeywords">libpq connection options</link>
489
490
to connection strings in the <varname>multimaster.conn_strings</varname>
490
- variable. By default, <filename>multimaster</filename> uses ports 5432
491
- and 5433 to establish connections between the nodes and for the arbiter
492
- process to listen for connections, respectively . If these ports are
493
- already in use, you must specify other ports by adding
491
+ variable. By default, <filename>multimaster</filename> uses port 5432
492
+ to establish connections between the nodes and port 5433 for the arbiter
493
+ process to listen for connections. If these ports are
494
+ already in use, you must specify other ports in
494
495
<literal>port</literal> and <literal>arbiter_port</literal> options
495
- to each connection string in the <varname>multimaster.conn_strings</varname>
496
- variable. To check whether the default ports are available, you can run with the following command:
497
- <programlisting>
498
- netstat -ln | grep -E '5432|5433'
499
- </programlisting>
500
- Make sure these ports are not blocked by firewall.
496
+ in each connection string in the <varname>multimaster.conn_strings</varname>
497
+ variable.
501
498
</para>
502
499
<para>
503
500
If you change the <literal>arbiter_port</literal>
504
501
option, you must also specify this port in the
505
502
<literal>multimaster.arbiter_port</literal> variable. For details,
506
503
see <xref linkend="multimaster-arbiter-port"> and
507
504
<xref linkend="multimaster-conn-strings">.
505
+ </para>
506
+ <para>
507
+ To check whether the default ports are available, you can run the following command:
508
+ <programlisting>
509
+ netstat -ln | grep -E '5432|5433'
510
+ </programlisting>
511
+ Make sure these ports are not blocked by firewall.
508
512
</para>
509
513
</listitem>
510
514
</itemizedlist>
@@ -565,7 +569,7 @@ SELECT mtm.get_cluster_state();
565
569
<para>
566
570
The <literal>multimaster.heartbeat_send_timeout</literal>
567
571
variable defines the time interval between the
568
- heartbeats. By default, this variable is set to 1000ms .
572
+ heartbeats. By default, this variable is set to 200ms .
569
573
</para>
570
574
</listitem>
571
575
<listitem>
@@ -574,7 +578,7 @@ SELECT mtm.get_cluster_state();
574
578
variable sets the timeout for the response. If no heartbeats are
575
579
received during this time, the node is assumed to be
576
580
disconnected and is excluded from the cluster. By default,
577
- this variable is set to 10000ms .
581
+ this variable is set to 1000ms .
578
582
</para>
579
583
</listitem>
580
584
</itemizedlist>
@@ -601,7 +605,7 @@ SELECT mtm.get_cluster_state();
601
605
<para>
602
606
<varname>multimaster.min_recovery_lag</varname> — sets the
603
607
minimal WAL lag between the node to be restored and the current cluster state.
604
- By default, <varname>multimaster.min_recovery_lag</varname> is set to 10MB .
608
+ By default, <varname>multimaster.min_recovery_lag</varname> is set to 10KB .
605
609
When the disconnected node is fast-forwarded up to the
606
610
<varname>multimaster.min_recovery_lag</varname> threshold,
607
611
<filename>multimaster</filename> stops all new commits to the
@@ -1048,20 +1052,20 @@ pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable
1048
1052
Time interval
1049
1053
between heartbeat messages, in milliseconds. An arbiter process
1050
1054
broadcasts heartbeat messages to all nodes to detect connection
1051
- problems. </para><para>Default: 1000
1055
+ problems. </para><para>Default: 200
1052
1056
</para></listitem></varlistentry>
1053
1057
<varlistentry><term><varname>multimaster.heartbeat_recv_timeout</varname><indexterm><primary><varname>multimaster.heartbeat_recv_timeout</varname></primary></indexterm></term><listitem><para>
1054
1058
Timeout, in
1055
1059
milliseconds. If no heartbeat message is received from the node
1056
1060
within this timeframe, the node is excluded from the cluster.
1057
- </para><para>Default: 10000
1061
+ </para><para>Default: 1000
1058
1062
</para></listitem></varlistentry>
1059
1063
<varlistentry><term><varname>multimaster.min_recovery_lag</varname><indexterm><primary><varname>multimaster.min_recovery_lag</varname></primary></indexterm></term><listitem><para>
1060
1064
Minimal WAL lag
1061
1065
between the node to be restored and the current cluster state, in
1062
1066
kB. When this threshold is reached during node recovery, the
1063
1067
cluster is locked for write transactions until the recovery is
1064
- complete. </para><para>Default: 10MB
1068
+ complete. </para><para>Default: 10KB
1065
1069
</para></listitem></varlistentry>
1066
1070
<varlistentry><term><varname>multimaster.max_recovery_lag</varname><indexterm><primary><varname>multimaster.max_recovery_lag</varname></primary></indexterm></term><listitem><para>
1067
1071
Maximal WAL lag
0 commit comments