Statistics
| Branch: | Tag: | Revision:

root / docs / installing.sgml @ 5d6dd340

History | View | Annotate | Download (10.7 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 Xen.
85
      </para>
86

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

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

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

    
106
    </sect2>
107

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

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

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

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

    
134
      <screen>
135
m-a update
136
m-a a-i drbd0.7
137
      </screen>
138

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

    
147
    </sect2>
148

    
149
  </sect1>
150

    
151

    
152
  <sect1>
153
    <title>Setting up the environment for Ganeti</title>
154

    
155
    <sect2>
156
      <title>Configuring the network</title>
157

    
158
      <para>Ganeti relies on Xen running in "bridge mode", which means the
159
      instances network interfaces will be attached to a software bridge
160
      running in dom0. Xen by default creates such a bridge at startup, but
161
      your distribution might have a different way to do things.
162
      </para>
163

    
164
      <para>
165
      In Debian, in order to enable the default Xen behaviour, you
166
      have to edit <filename>/etc/xen/xend-config.sxp</filename> and
167
      replace <computeroutput>(network-script
168
      network-dummy)</computeroutput> with
169
      <computeroutput>(network-script
170
      network-bridge)</computeroutput>. The recommended Debian way to
171
      configure things, though, is to edit your
172
      <filename>/etc/network/interfaces</filename> file and substitute
173
      your normal ethernet stanza with something like:</para>
174

    
175
      <screen>
176
auto br0
177
iface br0 inet static
178
        address <replaceable>YOUR_IP_ADDRESS</replaceable>
179
        netmask <replaceable>YOUR_NETMASK</replaceable>
180
        network <replaceable>YOUR_NETWORK</replaceable>
181
        broadcast <replaceable>YOUR_BROADCAST_ADDRESS</replaceable>
182
        gateway <replaceable>YOUR_GATEWAY</replaceable>
183
        bridge_ports <replaceable>eth0</replaceable>
184
        bridge_stp off
185
        bridge_fd 0
186
      </screen>
187

    
188
    <para>
189
      Beware that the default name Ganeti uses is
190
      <hardware>xen-br0</hardware> (which was used in Xen 2.0)
191
      while Xen 3.0 uses <hardware>xenbr0</hardware> by
192
      default. The default bridge your cluster will use for new
193
      instances can be specified at cluster initialization time.
194
    </para>
195

    
196
    </sect2>
197

    
198
    <sect2>
199
      <title>Configuring LVM</title>
200

    
201
      <para>
202
        If you haven't configured your LVM volume group at install
203
        time you need to do it before trying to initialize the Ganeti
204
        cluster. This is done by formatting the devices/partitions you
205
        want to use for it and then adding them to the relevant volume
206
        group:
207
       </para>
208

    
209
       <screen>
210
pvcreate /dev/sda4
211
pvcreate /dev/sdb
212
pvcreate /dev/sdc1
213
vgcreate xenvg /dev/sda4 /dev/sdb /dev/sdc1
214
       </screen>
215

    
216
      <para>
217
	If you want to add a device later you can do so with the
218
	<citerefentry><refentrytitle>vgextend</refentrytitle>
219
	<manvolnum>8</manvolnum></citerefentry> command:
220
      </para>
221

    
222
      <screen>
223
pvcreate /dev/sdd
224
vgextend xenvg /dev/sdd
225
      </screen>
226

    
227
      <para>
228
        As said before you may choose a different name for the volume group,
229
        as long as you stick to the same name on all the nodes of a cluster.
230
      </para>
231
    </sect2>
232

    
233
    <sect2>
234
      <title>Installing Ganeti</title>
235

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

    
241
        <screen>
242
./configure --localstatedir=/var
243
make
244
make install
245
        </screen>
246

    
247
        or you can install the package relevant to your distribution, for
248
        example in Debian/Ubuntu:
249

    
250
        <screen>
251
dpkg -i ganeti_VERSION_all.deb
252
        </screen>
253

    
254
        or, if you have a source repository that holds the Ganeti software:
255

    
256
        <screen>
257
apt-get install ganeti
258
        </screen>
259
      </para>
260

    
261
    </sect2>
262

    
263
    <sect2>
264
      <title>Installing the Operating System support packages</title>
265

    
266
      <para>Another important component for Ganeti is the OS support packages,
267
        which let different operating systems be used as instances. You can
268
        install them by installing the relevant ganeti-instance-OS package.
269
      </para>
270

    
271
    </sect2>
272

    
273
    <sect2>
274
      <title>Initializing the cluster</title>
275

    
276
      <para><emphasis role="strong">Mandatory:</emphasis> only on one
277
      node per cluster.</para>
278

    
279

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

    
285
      <screen>
286
gnt-cluster init <replaceable>CLUSTERNAME</replaceable>
287
      </screen>
288

    
289
      <para>
290
        Options you can pass to <command>gnt-cluster init</command>
291
        include the default bridge name (<option>-b</option>), the
292
        cluster-wide name for the volume group (<option>-g</option>)
293
        and the secondary ip address for the initial node should you
294
        wish to keep the data replication network separate. Invoke it
295
        with <option>--help</option> to see all the possibilities.
296
      </para>
297

    
298
      <para>
299
        Note that the cluster name must exist in DNS. You must choose
300
        a name different from any of the nodes names for a multi-node
301
        cluster. In general the best choice is to have a unique name
302
        for a cluster, even if it consists of only one machine.
303
      </para>
304
    </sect2>
305

    
306
    <sect2>
307
      <title>Joining the nodes to the cluster.</title>
308

    
309
      <para>
310
        <emphasis role="strong">Mandatory:</emphasis> for all the
311
        other nodes.
312
      </para>
313

    
314
      <para>
315
        If you have already initialized your cluster you need to join the other
316
        nodes to it. You can do so by executing the following command on the
317
        master node:
318
        <screen>
319
gnt-node add <replaceable>NODENAME</replaceable>
320
        </screen>
321

    
322
        The only option is <option>-s</option>, which sets the node's
323
        secondary ip address for replication purposes, if you are
324
        using a separate replication network.
325
      </para>
326
    </sect2>
327

    
328
  </sect1>
329

    
330
  <sect1>
331
    <title>This is it!</title>
332

    
333
    <para>
334
      Now you can follow the admin guide to use your new Ganeti
335
      cluster.
336
    </para>
337

    
338
  </sect1>
339

    
340

    
341
  </article>