1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
<refentry id="SQL-CREATENODE">
<indexterm zone="sql-createnode">
<primary>CREATE NODE</primary>
</indexterm>
<refmeta>
<refentrytitle>CREATE NODE</refentrytitle>
<manvolnum>7</manvolnum>
<refmiscinfo>SQL - Language Statements</refmiscinfo>
</refmeta>
<refnamediv>
<refname>CREATE NODE</refname>
<refpurpose>create a new cluster node</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
CREATE NODE <replaceable class="parameter">nodename</replaceable> WITH
(
[ TYPE = <replaceable class="parameter">nodetype</replaceable>,]
[ HOST = <replaceable class="parameter">hostname</replaceable>,]
[ PORT = <replaceable class="parameter">portnum</replaceable>,]
[ PRIMARY [ = <replaceable class="parameter">boolean</replaceable> ],]
[ PREFERRED [ = <replaceable class="parameter">boolean</replaceable> ] ]
)
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>CREATE NODE</command> is a SQL command specific
to <productname>Postgres-XL</productname> that creates
a new entry in catalog table pgxc_node with node data.
</para>
<para>
This node data is directly used by a Coordinator session and its
corresponding Datanode sessions when connecting
to build connection data to cluster nodes through <productname>Postgres-XL
</productname> pooler.
</para>
<para>
Node connection information is created on pooler only if it has not been
the case yet on Coordinator connected at the moment of connection.
</para>
<para>
<command>CREATE NODE</command> only runs on the local node where it is launched.
</para>
</refsect1>
<refsect1>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><replaceable class="parameter">nodename</replaceable></term>
<listitem>
<para>
The name of the selected cluster node.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>TYPE</literal></term>
<listitem>
<para>
The type of the cluster node. It is possible to specify
a Coordinator node or a Datanode node.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>PRIMARY</literal></term>
<listitem>
<para>
Defines if the cluster node is used as a primary node for replicated
write operations. A <replaceable class="parameter">boolean</replaceable>
value can be specified. In case no value is specified, <literal>PRIMARY</literal>
acts like <literal>false</>.
</para>
<para>
To avoid deadlocks and make update consistent, you should specify the same <literal>PRIMARY</literal>
node at all the nodes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>PREFERRED</literal></term>
<listitem>
<para>
Defines if the cluster node is used as a preferred node for replicated
read operations if no node is determined. A <replaceable class="parameter">boolean</replaceable>
value can be specified. In case no value is specified, <literal>PREFERRED</literal>
acts like <literal>false</>.
</para>
<para> You can specify different <literal>PREFERRED</literal> nodes at
different Coordinators. This parameter affects performance of your
<literal>Postgres-XL</literal> cluster. If you configure a Datanode
where you configure a Coordinator, you should specify
<literal>PREFERRED</literal> for the Coordinator to such a local
Datanode. This will save network communication and improve cluster-wide
performance.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">nodetype</replaceable></term>
<listitem>
<para>
The node type for given cluster node. Possible values are:
'coordinator' for a Coordinator node and 'datanode' for a
Datanode node.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">hostname</replaceable></term>
<listitem>
<para>
The hostname or IP used to connect to the cluster node.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">portnum</replaceable></term>
<listitem>
<para>
The port number used to connect to the cluster node.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<replaceable class="parameter">nodename</replaceable> remains constant
as long as it is in use.
</para>
<para>
When using a cluster with 1 Coordinator and 1 Datanode on each server,
defining the local Datanode as <literal>PREFERRED</literal> can greatly
improve the performance of a system by avoiding any network overhead for
replicated reads, as in this case a local socket is used for communication
between nodes. This has even more effects when the application frequently uses
replicated tables for remote join operations and that those operations can
be operated on the local <literal>PREFERRED</literal> node.
</para>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
Create a Coordinator node located on local machine using port 6543
<programlisting>
CREATE NODE node2 WITH (TYPE = 'coordinator', HOST = 'localhost', PORT = 6543);
</programlisting>
</para>
<para>
Create a Datanode which is a preferred and primary node
located on remote machine with IP '192.168.0.3' on port 8888.
<programlisting>
CREATE NODE node2 WITH (TYPE = 'datanode', HOST = '192.168.0.3', PORT = 8888, PRIMARY, PREFERRED);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Compatibility</title>
<para>
<command>CREATE NODE</command> does not conform to the <acronym>
SQL</acronym> standards, it is a Postgres-XL specific command.
</para>
</refsect1>
</refentry>
|