Statistics
| Branch: | Tag: | Revision:

root / docs / installing.sgml @ 1005b0c1

History | View | Annotate | Download (14.2 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>
307
        It's now time to install the Ganeti software itself. You can
308
        do it from source, with the usual steps (note that the
309
        <option>localstatedir</option> options must be set to
310
        <filename class="directory">/var</filename>):
311
      </para>
312

    
313
        <screen>
314
./configure --localstatedir=/var
315
make
316
make install
317
mkdir /srv/ganeti/ /srv/ganeti/os /srv/ganeti/export
318
        </screen>
319

    
320
      <para>
321
        You also need to copy from the source archive the file
322
        <filename>docs/examples/ganeti.initd</filename> to
323
        <filename>/etc/init.d/ganeti</filename> and register it into
324
        your distribution's startup scripts, for example in Debian:
325
      </para>
326
      <screen>update-rc.d ganeti defaults 20 80</screen>
327

    
328
    </sect2>
329

    
330
    <sect2>
331
      <title>Installing the Operating System support packages</title>
332

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

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

    
350
    </sect2>
351

    
352
    <sect2>
353
      <title>Initializing the cluster</title>
354

    
355
      <para><emphasis role="strong">Mandatory:</emphasis> only on one
356
      node per cluster.</para>
357

    
358

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

    
364
      <screen>
365
gnt-cluster init <replaceable>CLUSTERNAME</replaceable>
366
      </screen>
367

    
368
      <para>
369
        If the node's network interface which will be used for access
370
        from outside the cluster is not named
371
        <hardware>xen-br0</hardware>, you need to use the
372
        <option>--master-netdev=<replaceable>IFNAME</replaceable></option>
373
        option, replacing <replaceable>IFNAME</replaceable> with the
374
        correct one for your case (e.g. <hardware>xenbr0</hardware>,
375
        <hardware>eth0</hardware>, etc.). Usually this will be the
376
        same as the default bridge name (see below).
377
      </para>
378

    
379
      <para>
380
        Other options you can pass to <command>gnt-cluster
381
        init</command> include the default bridge name
382
        (<option>-b</option>), the cluster-wide name for the volume
383
        group (<option>-g</option>) and the secondary ip address for
384
        the initial node should you wish to keep the data replication
385
        network separate. Invoke it with <option>--help</option> to
386
        see all the possibilities.
387
      </para>
388

    
389
      <para>
390
        Note that the cluster name must exist in DNS. You must choose
391
        a name different from any of the nodes names for a multi-node
392
        cluster. In general the best choice is to have a unique name
393
        for a cluster, even if it consists of only one machine, as you
394
        will be able to expand it later without any problem.
395
      </para>
396
    </sect2>
397

    
398
    <sect2>
399
      <title>Joining the nodes to the cluster.</title>
400

    
401
      <para>
402
        <emphasis role="strong">Mandatory:</emphasis> for all the
403
        other nodes.
404
      </para>
405

    
406
      <para>
407
        If you have already initialized your cluster you need to join the other
408
        nodes to it. You can do so by executing the following command on the
409
        master node:
410
        <screen>
411
gnt-node add <replaceable>NODENAME</replaceable>
412
        </screen>
413

    
414
        The only option is <option>-s</option>, which sets the node's
415
        secondary ip address for replication purposes, if you are
416
        using a separate replication network.
417
      </para>
418
    </sect2>
419

    
420
  </sect1>
421

    
422
  <sect1>
423
    <title>This is it!</title>
424

    
425
    <para>
426
      Now you can follow the admin guide to use your new Ganeti
427
      cluster.
428
    </para>
429

    
430
  </sect1>
431

    
432

    
433
  </article>