|
344 | 344 | <para>Suppose
|
345 | 345 | you are setting up a cluster of three nodes, with
|
346 | 346 | <literal>node1</literal>, <literal>node2</literal>, and
|
347 |
| - <literal>node3</literal> domain names. First, set up the database to be replicated, and make sure you have a user with superuser rights to perform replication: |
| 347 | + <literal>node3</literal> domain names. First, set up the database to be replicated, and make sure you have a DBMS user with superuser rights to perform replication: |
348 | 348 | </para>
|
349 | 349 | <itemizedlist>
|
350 | 350 | <listitem>
|
351 | 351 | <para>
|
352 | 352 | If you are starting from scratch, initialize a cluster,
|
353 |
| - create an empty database <literal>mydb</literal> and a new |
354 |
| - user <literal>myuser</literal>, on each node of the cluster. For details, see <xref linkend="creating-cluster">. |
| 353 | + create an empty database <literal>mydb</literal> and a new DBMS |
| 354 | + user <literal>myuser</literal> with superuser rights, on each node of the cluster. For details, see <xref linkend="creating-cluster">. |
355 | 355 | </para>
|
356 | 356 | </listitem>
|
357 | 357 | <listitem>
|
358 | 358 | <para>
|
359 | 359 | If you already have a database <literal>mydb</literal>
|
360 |
| - running on <literal>node1</literal>, initialize |
| 360 | + running on <literal>node1</literal>, create a new DBMS user |
| 361 | + <literal>myuser</literal> with superuser rights and initialize |
361 | 362 | new nodes from the working node using
|
362 |
| - <application>pg_basebackup</application>. On behalf of <literal>myuser</literal>, run the following command on each node you are going to add: |
| 363 | + <application>pg_basebackup</application> on behalf of this user. |
| 364 | + Run the following command on each node you are going to add: |
363 | 365 | <programlisting>
|
364 |
| -pg_basebackup -D <replaceable>datadir</> -h node1 mydb |
| 366 | +pg_basebackup -D <replaceable>datadir</> -h node1 -U myuser mydb |
365 | 367 | </programlisting>
|
366 | 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 | +You can also use any other DBMS user with superuser rights instead of <literal>myuser</literal> to perform this task. |
367 | 370 | </para>
|
368 | 371 | <para>
|
369 | 372 | For details on using <application>pg_basebackup</application>, see
|
370 | 373 | <xref linkend="app-pgbasebackup">.
|
371 | 374 | </para>
|
372 | 375 | </listitem>
|
373 | 376 | </itemizedlist>
|
374 |
| - <para>Once the database is set up, complete the following steps on each |
| 377 | + <para>Once the database is set up, complete the following steps on behalf |
| 378 | + of the <literal>postgres</literal> OS user, on each |
375 | 379 | cluster node:
|
376 | 380 | </para>
|
377 | 381 | <orderedlist>
|
@@ -513,16 +517,16 @@ netstat -ln | grep -E '5432|5433'
|
513 | 517 | </listitem>
|
514 | 518 | <listitem>
|
515 | 519 | <para>
|
516 |
| - Restart <productname>PostgreSQL</productname>: |
| 520 | + On behalf of an OS superuser, restart <productname>&productname;</productname>: |
517 | 521 | </para>
|
518 | 522 | <programlisting>
|
519 |
| -pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable> start |
| 523 | +pg_ctl -D <replaceable>datadir</replaceable> -l <replaceable>pg.log</replaceable> restart |
520 | 524 | </programlisting>
|
521 | 525 | </listitem>
|
522 | 526 | </orderedlist>
|
523 | 527 | <para>
|
524 | 528 | When <productname>&productname;</productname> is started on all nodes, connect to any node
|
525 |
| - and create the <filename>multimaster</filename> extension: |
| 529 | + on behalf of the <literal>postgres</literal> OS user and create the <filename>multimaster</filename> extension: |
526 | 530 | <programlisting>
|
527 | 531 | psql -h node1
|
528 | 532 | CREATE EXTENSION multimaster;</programlisting></para>
|
|
0 commit comments