<para>
Monitoring replication setups is important.
</para>
+ <para>
+ Monitoring replication setups is important.
+ bdr.bdr_nodes
+ bdr.bdr_nodes can give the user information as to the status of a node
+ A row is written to the bdr.bdr_nodes table whenever the status of a node changes. The 'status' column may have
+ the following values:
+ <itemizedlist>
+ <listitem>
+ <para>
+ i - The node is doing initial slot creation or an initial dump and load (see init_replica, above)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ c - The node is catching up to the target node and is not yet ready to participate with the &bdr; group.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ k - The node has been 'killed' or removed by the user with the function bdr.bdr_part_by_node_names.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ r - The node is fully ready. Slots may be created on this node and it can participate with the &bdr group.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+<para>
+Note that the status doesn't indicate whether the node is actually up right now. A node may be shut down, isolated from the network, or crashed and still appear as r in bdr.bdr_nodes because it's still conceptually part of the BDR group.
+At this time there are no SQL-level functions for adding/removing nodes. Do not directly modify bdr.bdr_nodes.
+</para>
+<programlisting>
+select * from bdr.bdr_nodes;
+ node_sysid | node_timeline | node_dboid | node_status | node_name | node_local_dsn | node_init_from_dsn
+---------------------+---------------+------------+-------------+-----------+--------------------------+--------------------------
+ 6125823754033780536 | 1 | 16385 | r | node1 | port=5598 dbname=bdrdemo |
+ 6125823714403985168 | 1 | 16386 | k | node2 | port=5599 dbname=bdrdemo | port=5598 dbname=bdrdemo
+ 6125847382076805699 | 1 | 16386 | i | node3 | port=6000 dbname=bdrdemo | port=5598 dbname=bdrdemo
+(3 rows)
+</programlisting>
+<programlisting>
+select * from pg_stat_replication;
+ pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | backend_xmin | stat
+e | sent_location | write_location | flush_location | replay_location | sync_priority | sync_state
+-------+----------+---------+--------------------------------------------+-------------+-----------------+-------------+-------------------------------+--------------+-------
+----+---------------+----------------+----------------+-----------------+---------------+------------
+ 29045 | 16385 | admin | bdr (6127682459268878512,1,16386,):receive | | | -1 | 2015-03-18 21:03:28.717175+00 | | stream
+ing | 0/189D3B8 | 0/189D3B8 | 0/189D3B8 | 0/189D3B8 | 0 | async
+ 29082 | 16385 | admin | bdr (6127682494973391064,1,16386,):receive | | | -1 | 2015-03-18 21:03:44.665272+00 | | stream
+ing | 0/189D3B8 | 0/189D3B8 | 0/189D3B8 | 0/189D3B8 | 0 | async
+</programlisting>
+
</chapter>