Statistics
| Branch: | Tag: | Revision:

root / docs / installing.sgml @ a7a19281

History | View | Annotate | Download (13.5 kB)

1
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
2
]>
3
  <article class="specification">
4
  <articleinfo>
5
    <title>Ganeti node/cluster installation tutorial</title>
6
  </articleinfo>
7
  <para>Documents Ganeti version 1.2</para>
8

    
9
  <sect1>
10
    <title>Introduction</title>
11

    
12
    <para>
13
      Ganeti is a cluster virtualization management system. This
14
      document explains how to bootstrap a Ganeti node and create a
15
      running cluster. You need to repeat most of the steps in this
16
      document for every node you want to install, but of course we
17
      recommend creating some semi-automatic procedure if you plan to
18
      deploy Ganeti on a medium/large scale.
19
    </para>
20

    
21
    <para>This document is divided into two main sections:
22

    
23
      <itemizedlist>
24
        <listitem>
25
          <simpara>Installation of the core system and base
26
          components</simpara>
27
        </listitem>
28
        <listitem>
29
          <simpara>Configuration of the environment for
30
          Ganeti</simpara>
31
        </listitem>
32
      </itemizedlist>
33

    
34
    Each of these is divided into sub-sections. While a full Ganeti
35
    system will need all of the steps specified, some are not strictly
36
    required for every environment. Which ones they are, and why, is
37
    specified in the corresponding sections.
38
    </para>
39

    
40
    <para>
41
      While Ganeti itself is distribution-agnostic most of the
42
      examples in this document will be targeted at Debian or
43
      Debian-derived distributions. You are expected to be familiar
44
      with your distribution, its package management system, and Xen
45
      before trying to use Ganeti.
46
    </para>
47

    
48
    <para>
49
      A basic Ganeti terminology glossary is provided in the
50
      introductory section of the "admin guide". Please refer to that
51
      if you are uncertain about the terms we are using.
52
    </para>
53

    
54
  </sect1>
55

    
56
  <sect1>
57
    <title>Installing the system and base components</title>
58

    
59
    <sect2>
60
      <title>Installing the base system</title>
61

    
62
      <para><emphasis role="strong">Mandatory.</emphasis></para>
63

    
64
      <para>
65
        Please install your operating system as you would normally
66
        do. The only requirement you need to be aware of at this stage
67
        is to partition leaving enough space for a big LVM volume
68
        group which will then host your instance file systems. You can
69
        even create the volume group at installation time, of course:
70
        the default volume group name Ganeti 1.2 uses is "xenvg" but
71
        you may name it differently should you wish to, as long as the
72
        name is the same for all the nodes in the cluster.
73
      </para>
74

    
75
    </sect2>
76

    
77
    <sect2>
78
      <title>Installing Xen</title>
79

    
80
      <para>
81
        <emphasis role="strong">Mandatory:</emphasis> While Ganeti is
82
        developed with the ability to modularly run on different
83
        virtualization environments in mind the only one currently
84
        useable on a live system is <ulink
85
        url="http://xen.xensource.com/">Xen</ulink>.
86
      </para>
87

    
88
      <para>
89
        Please follow your distribution's recommended way to install
90
        and set up Xen, or install Xen from the upstream source, if
91
        you wish, following their manual.
92
      </para>
93

    
94
      <para>
95
        For example under Debian 4.0 or 3.1+backports you can install
96
        the relevant xen-linux-system package, which will pull in both
97
        the hypervisor and the relevant kernel. On Ubuntu (from Gutsy
98
        on) the package is called ubuntu-xen-server.
99
      </para>
100

    
101
      <para>
102
        After installing Xen you need to reboot into your xenified
103
        dom0 system. Again on some distributions this might involve
104
        configuring GRUB appropriately.
105
      </para>
106

    
107
    </sect2>
108

    
109
    <sect2>
110
      <title>Installing DRBD</title>
111

    
112
      <para>
113
        Recommended: <ulink url="http://www.drbd.org/">DRBD</ulink>
114
        is required if you want to use the high availability (HA)
115
        features of Ganeti, but optional if you don't require HA or
116
        only run Ganeti on single-node clusters. You can upgrade a
117
        non-HA cluster to an HA one later, but you might need to
118
        export and reimport all your instances to take advantage of
119
        the new features.
120
      </para>
121

    
122
      <para>
123
        Now the bad news: unless your distribution already provides it
124
        installing DRBD might involve recompiling your kernel or
125
        anyway fiddling with it. Hopefully at least the xenified
126
        kernel source to start from will be provided.
127
      </para>
128

    
129
      <para>
130
        Under Debian you can just install the drbd0.7-module-source
131
        and drbd0.7-utils packages, and your kernel source, and then
132
        run module-assistant to compile the drbd0.7 module. The
133
        following commands should do it:
134
      </para>
135

    
136
      <screen>
137
m-a update
138
m-a a-i drbd0.7
139
      </screen>
140

    
141
      <para>
142
        The good news is that you don't need to configure DRBD at all.
143
        Ganeti will do it for you for every instance you set up.  If
144
        you have the DRBD utils installed and the module in your
145
        kernel you're fine. Please check that your system is
146
        configured to load the module at every boot.
147
      </para>
148

    
149
    </sect2>
150

    
151
    <sect2>
152
      <title>Other required software</title>
153

    
154
      <para>Besides Xen and DRBD, you will need to install the
155
      following:</para>
156

    
157
      <itemizedlist>
158
        <listitem>
159
          <simpara><ulink url="http://sourceware.org/lvm2/">LVM
160
          version 2</ulink></simpara>
161
        </listitem>
162
        <listitem>
163
          <simpara><ulink
164
          url="http://www.openssl.org/">OpenSSL</ulink></simpara>
165
        </listitem>
166
        <listitem>
167
          <simpara><ulink
168
          url="http://www.openssh.com/portable.html">OpenSSH</ulink></simpara>
169
        </listitem>
170
        <listitem>
171
          <simpara><ulink url="http://bridge.sourceforge.net/">Bridge
172
          utilities</ulink></simpara>
173
        </listitem>
174
        <listitem>
175
          <simpara><ulink
176
          url="http://fping.sourceforge.net/">fping</ulink></simpara>
177
        </listitem>
178
        <listitem>
179
          <simpara><ulink
180
          url="http://developer.osdl.org/dev/iproute2">iproute2</ulink></simpara>
181
        </listitem>
182
        <listitem>
183
          <simpara><ulink
184
          url="ftp://ftp.inr.ac.ru/ip-routing/iputils-current.tar.gz">arping</ulink>
185
          (part of iputils package)</simpara>
186
        </listitem>
187
        <listitem>
188
          <simpara><ulink
189
          url="http://www.kernel.org/pub/linux/utils/raid/mdadm/">mdadm</ulink>
190
          (Linux Software Raid tools)</simpara>
191
        </listitem>
192
        <listitem>
193
          <simpara><ulink url="http://www.python.org">Python 2.4</ulink></simpara>
194
        </listitem>
195
        <listitem>
196
          <simpara><ulink url="http://twistedmatrix.com/">Python
197
          Twisted library</ulink> - the core library is
198
          enough</simpara>
199
        </listitem>
200
        <listitem>
201
          <simpara><ulink
202
          url="http://pyopenssl.sourceforge.net/">Python OpenSSL
203
          bindings</ulink></simpara>
204
        </listitem>
205
      </itemizedlist>
206

    
207
      <para>These programs are supplied as part of most Linux
208
      distributions, so usually they can be installed via apt or
209
      similar methods. Also many of them will already be installed on
210
      a standard machine. On Debian Etch you can use this command line
211
      to install all of them:</para>
212

    
213
      <screen>
214
# apt-get install lvm2 ssh bridge-utils iproute iputils-arping \
215
> fping python2.4 python-twisted-core python-pyopenssl openssl
216
      </screen>
217
    </sect2>
218

    
219
  </sect1>
220

    
221

    
222
  <sect1>
223
    <title>Setting up the environment for Ganeti</title>
224

    
225
    <sect2>
226
      <title>Configuring the network</title>
227

    
228
      <para>Ganeti relies on Xen running in "bridge mode", which means the
229
      instances network interfaces will be attached to a software bridge
230
      running in dom0. Xen by default creates such a bridge at startup, but
231
      your distribution might have a different way to do things.
232
      </para>
233

    
234
      <para>
235
      In Debian, in order to enable the default Xen behaviour, you
236
      have to edit <filename>/etc/xen/xend-config.sxp</filename> and
237
      replace <computeroutput>(network-script
238
      network-dummy)</computeroutput> with
239
      <computeroutput>(network-script
240
      network-bridge)</computeroutput>. The recommended Debian way to
241
      configure things, though, is to edit your
242
      <filename>/etc/network/interfaces</filename> file and substitute
243
      your normal ethernet stanza with something like:</para>
244

    
245
      <screen>
246
auto br0
247
iface br0 inet static
248
        address <replaceable>YOUR_IP_ADDRESS</replaceable>
249
        netmask <replaceable>YOUR_NETMASK</replaceable>
250
        network <replaceable>YOUR_NETWORK</replaceable>
251
        broadcast <replaceable>YOUR_BROADCAST_ADDRESS</replaceable>
252
        gateway <replaceable>YOUR_GATEWAY</replaceable>
253
        bridge_ports <replaceable>eth0</replaceable>
254
        bridge_stp off
255
        bridge_fd 0
256
      </screen>
257

    
258
    <para>
259
      Beware that the default name Ganeti uses is
260
      <hardware>xen-br0</hardware> (which was used in Xen 2.0)
261
      while Xen 3.0 uses <hardware>xenbr0</hardware> by
262
      default. The default bridge your cluster will use for new
263
      instances can be specified at cluster initialization time.
264
    </para>
265

    
266
    </sect2>
267

    
268
    <sect2>
269
      <title>Configuring LVM</title>
270

    
271
      <para>
272
        If you haven't configured your LVM volume group at install
273
        time you need to do it before trying to initialize the Ganeti
274
        cluster. This is done by formatting the devices/partitions you
275
        want to use for it and then adding them to the relevant volume
276
        group:
277
       </para>
278

    
279
       <screen>
280
pvcreate /dev/sda4
281
pvcreate /dev/sdb
282
pvcreate /dev/sdc1
283
vgcreate xenvg /dev/sda4 /dev/sdb /dev/sdc1
284
       </screen>
285

    
286
      <para>
287
	If you want to add a device later you can do so with the
288
	<citerefentry><refentrytitle>vgextend</refentrytitle>
289
	<manvolnum>8</manvolnum></citerefentry> command:
290
      </para>
291

    
292
      <screen>
293
pvcreate /dev/sdd
294
vgextend xenvg /dev/sdd
295
      </screen>
296

    
297
      <para>
298
        As said before you may choose a different name for the volume group,
299
        as long as you stick to the same name on all the nodes of a cluster.
300
      </para>
301
    </sect2>
302

    
303
    <sect2>
304
      <title>Installing Ganeti</title>
305

    
306
      <para>It's now time to install the Ganeti software itself if you
307
      haven't done it yet. You can do it from source, with the usual
308
      steps (note that the <option>localstatedir</option> options must
309
      be set to <filename class="directory">/var</filename>):
310

    
311
        <screen>
312
./configure --localstatedir=/var
313
make
314
make install
315
        </screen>
316

    
317
        or you can install the package relevant to your distribution, for
318
        example in Debian/Ubuntu:
319

    
320
        <screen>
321
dpkg -i ganeti_VERSION_all.deb
322
        </screen>
323

    
324
        or, if you have a source repository that holds the Ganeti software:
325

    
326
        <screen>
327
apt-get install ganeti
328
        </screen>
329
      </para>
330

    
331
    </sect2>
332

    
333
    <sect2>
334
      <title>Installing the Operating System support packages</title>
335

    
336
      <para>
337
        Another important component for Ganeti are the OS support
338
        packages, which let different operating systems be used as
339
        instances. You can grab a simple package that allows
340
        installing Debian Etch instances on the project web site
341
        (after download, untar it and follow the instructions in the
342
        <filename>README</filename> file).
343
      </para>
344

    
345
      <para>
346
        Alternatively, you can create your own OS definitions, see
347
        <citerefentry>
348
        <refentrytitle>ganeti-os-interface</refentrytitle>
349
        <manvolnum>8</manvolnum>
350
        </citerefentry>.
351
      </para>
352

    
353
    </sect2>
354

    
355
    <sect2>
356
      <title>Initializing the cluster</title>
357

    
358
      <para><emphasis role="strong">Mandatory:</emphasis> only on one
359
      node per cluster.</para>
360

    
361

    
362
      <para>The last step is to initialize the cluster. After you've repeated
363
        the above process or some semi-automatic form of it on all of your
364
        nodes choose one as the master, and execute:
365
      </para>
366

    
367
      <screen>
368
gnt-cluster init <replaceable>CLUSTERNAME</replaceable>
369
      </screen>
370

    
371
      <para>
372
        Options you can pass to <command>gnt-cluster init</command>
373
        include the default bridge name (<option>-b</option>), the
374
        cluster-wide name for the volume group (<option>-g</option>)
375
        and the secondary ip address for the initial node should you
376
        wish to keep the data replication network separate. Invoke it
377
        with <option>--help</option> to see all the possibilities.
378
      </para>
379

    
380
      <para>
381
        Note that the cluster name must exist in DNS. You must choose
382
        a name different from any of the nodes names for a multi-node
383
        cluster. In general the best choice is to have a unique name
384
        for a cluster, even if it consists of only one machine.
385
      </para>
386
    </sect2>
387

    
388
    <sect2>
389
      <title>Joining the nodes to the cluster.</title>
390

    
391
      <para>
392
        <emphasis role="strong">Mandatory:</emphasis> for all the
393
        other nodes.
394
      </para>
395

    
396
      <para>
397
        If you have already initialized your cluster you need to join the other
398
        nodes to it. You can do so by executing the following command on the
399
        master node:
400
        <screen>
401
gnt-node add <replaceable>NODENAME</replaceable>
402
        </screen>
403

    
404
        The only option is <option>-s</option>, which sets the node's
405
        secondary ip address for replication purposes, if you are
406
        using a separate replication network.
407
      </para>
408
    </sect2>
409

    
410
  </sect1>
411

    
412
  <sect1>
413
    <title>This is it!</title>
414

    
415
    <para>
416
      Now you can follow the admin guide to use your new Ganeti
417
      cluster.
418
    </para>
419

    
420
  </sect1>
421

    
422

    
423
  </article>