<!--  -->
<sect1 id="cluster">
<title>Defining &slony1; Clusters</title>
<indexterm>  <primary>cluster definition</primary> </indexterm>

<para>A &slony1; cluster is the basic grouping of database instances
in which replication takes place.  It consists of a set of &postgres;
database instances in which is defined a namespace specific to that
cluster.  For instance, if the cluster is called
<envar>cbcluster</envar>, then &slony1; will define, at the
initialization time for each node, a schema called
<command>_cbcluster</command>, in which it then creates numerous
tables that store &slony1; configuration and replication state
information.  See <xref linkend="schema"> for more documentation about
what is stored in that schema.  More specifically, the tables &sllog1;
and &sllog2; log changes collected on the origin node as they are
replicated to subscribers.  </para>

<para>Each database instance in which replication is to take place is
identified by a node number.</para>

<para>For a simple install, it may be reasonable for the origin to be
node #1, and for the subscriber to be node #2.</para>

<para> Note that, as recorded in the <xref linkend="faq"> under <link
linkend="cannotrenumbernodes"> How can I renumber nodes?</link>, the
node number is immutable, so it is not possible to change a node's
node number after it has been set up.</para>

<para>Some planning should be done, in more complex cases, to ensure
that the numbering system is kept sane, lest the administrators be
driven insane.  The node numbers should be chosen to somehow
correspond to the shape of the environment, as opposed to (say) the
order in which nodes were initialized.</para>

<para> The <xref linkend="stmtinclude"> and
<xref linkend="stmtdefine"> statements allow you to create a sort of
<quote>symbol table</quote> behind the scenes so that <xref
linkend="slonik"> scripts can use names for nodes rather than cryptic
numbers. </para>

</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode:sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:"slony.sgml"
sgml-exposed-tags:nil
sgml-local-catalogs:("/usr/lib/sgml/catalog")
sgml-local-ecat-files:nil
End:
-->
