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

Commit 8d73f11

Browse files
author
Liudmila Mantrova
committed
DOC: removing multimaster example created for PGPROEE9_6
1 parent 7f1484b commit 8d73f11

File tree

1 file changed

+0
-70
lines changed

1 file changed

+0
-70
lines changed

doc/src/sgml/multimaster.sgml

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -541,76 +541,6 @@ SELECT mtm.get_cluster_state();
541541
<para><emphasis role="strong">See Also</emphasis></para>
542542
<para><link linkend="multimaster-tuning-configuration-parameters">Tuning
543543
Configuration Parameters</link></para>
544-
<sect4>
545-
<title>Sample Cluster Configuration</title>
546-
<para>
547-
This section shows a sample configuration of a three-node cluster for the
548-
<literal>myuser</literal> user and <literal>mydb</literal> database.
549-
</para>
550-
<para>
551-
First, run the following commands on all cluster nodes:
552-
<programlisting>
553-
# Switch to the 'postgres' user
554-
sudo su - postgres
555-
556-
# Set up environment variables
557-
export PGHOME=/usr/pgproee-&majorversion;
558-
export PATH=$PGHOME/bin:$PATH
559-
export MANPATH=$PGHOME/share/man:$MANPATH
560-
export PGDATA=/var/lib/pgproee/&majorversion;/data
561-
562-
# Create a new user 'myuser' with superuser priviledges
563-
psql --dbname=postgres --username=postgres -c "CREATE USER myuser WITH SUPERUSER ENCRYPTED PASSWORD 'myuserpassword'"
564-
565-
# Create a new database 'mydb'
566-
psql --dbname=postgres --username=myuser --host=127.0.0.1 -c "CREATE DATABASE mydb"
567-
568-
# Enable replication on all cluster nodes.
569-
# The 'trust' method in this example is only provided for
570-
# illustration purposes and is not recommended on production systems.
571-
sed -i '/md5$/s|host|#host|' $PGDATA/pg_hba.conf
572-
echo "host replication myuser samenet trust" >> $PGDATA/pg_hba.conf
573-
echo "host all all 0.0.0.0/0 md5" >> $PGDATA/pg_hba.conf
574-
575-
# Configure postgresql.conf settings
576-
echo "multimaster.max_nodes = 3" >> $PGDATA/postgresql.conf
577-
echo "multimaster.node_id = 'hostname | '{ print substr($1,5,1) }''" >> $PGDATA/postgresql.conf
578-
echo "multimaster.conn_strings = 'dbname=mydb user=myuser host=node1,dbname=mydb user=myuser host=node2,dbname=mydb user=myuser host=node3'" >> $PGDATA/postgresql.conf
579-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET default_transaction_isolation TO 'read committed'"
580-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET wal_level TO logical"
581-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET max_connections TO 100"
582-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET max_prepared_transactions to 300"
583-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET max_wal_senders TO 10"
584-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET max_replication_slots TO 10"
585-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET max_worker_processes TO 250"
586-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "ALTER SYSTEM SET shared_preload_libraries TO multimaster"
587-
psql --exit
588-
589-
# Restart &productname;
590-
sudo systemctl restart postgrespro-enterprise-&majorversion;.service
591-
</programlisting>
592-
</para>
593-
<para>
594-
Now create the <filename>multimaster</filename> extension on one of the nodes.
595-
It will be replicated to all the other cluster nodes automatically.
596-
<programlisting>
597-
# Switch to the 'postgres' user
598-
sudo su - postgres
599-
600-
# Set up environment variables
601-
export PGHOME=/usr/pgproee-&majorversion;
602-
export PATH=$PGHOME/bin:$PATH
603-
export MANPATH=$PGHOME/share/man:$MANPATH
604-
export PGDATA=/var/lib/pgproee/&majorversion;/data
605-
606-
# Create multimaster extension on one of the nodes
607-
psql --dbname=mydb --username=myuser --host=127.0.0.1 -c "CREATE EXTENSION IF NOT EXISTS multimaster"
608-
</programlisting>
609-
</para>
610-
<para>
611-
The cluster is set up and ready to use.
612-
</para>
613-
</sect4>
614544
</sect3>
615545
<sect3 id="multimaster-tuning-configuration-parameters">
616546
<title>Tuning Configuration Parameters</title>

0 commit comments

Comments
 (0)