root / docs / installing.sgml @ 53b78ba4
History | View | Annotate | Download (10 kB)
1 | f1a808df | Guido Trotter | <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [ |
---|---|---|---|
2 | f1a808df | Guido Trotter | ]> |
3 | f1a808df | Guido Trotter | <article class="specification"> |
4 | f1a808df | Guido Trotter | <articleinfo> |
5 | f1a808df | Guido Trotter | <title>Ganeti node/cluster installation tutorial</title> |
6 | f1a808df | Guido Trotter | </articleinfo> |
7 | f1a808df | Guido Trotter | <para>Documents Ganeti version 1.2</para> |
8 | f1a808df | Guido Trotter | |
9 | f1a808df | Guido Trotter | <sect1> |
10 | f1a808df | Guido Trotter | <title>Introduction</title> |
11 | f1a808df | Guido Trotter | |
12 | f1a808df | Guido Trotter | <para>Ganeti is a cluster virtualization management system. This document |
13 | f1a808df | Guido Trotter | explains how to bootstrap a Ganeti node and create a running cluster. You |
14 | f1a808df | Guido Trotter | need to repeat most of the steps in this document for every node you want to |
15 | f1a808df | Guido Trotter | install, but of course we recommend creating some semi-automatic procedure |
16 | f1a808df | Guido Trotter | if you plan to deploy Ganeti on a medium/large scale. |
17 | f1a808df | Guido Trotter | </para> |
18 | f1a808df | Guido Trotter | |
19 | f1a808df | Guido Trotter | <para>This document is divided into two main sections: |
20 | f1a808df | Guido Trotter | |
21 | f1a808df | Guido Trotter | <itemizedlist> |
22 | f1a808df | Guido Trotter | <listitem> |
23 | f1a808df | Guido Trotter | <simpara>Installation of the core system and base components</simpara> |
24 | f1a808df | Guido Trotter | </listitem> |
25 | f1a808df | Guido Trotter | <listitem> |
26 | f1a808df | Guido Trotter | <simpara>Configuration of the environment for Ganeti</simpara> |
27 | f1a808df | Guido Trotter | </listitem> |
28 | f1a808df | Guido Trotter | </itemizedlist> |
29 | f1a808df | Guido Trotter | |
30 | f1a808df | Guido Trotter | Each of these is divided into sub-sections. While a full Ganeti system will |
31 | f1a808df | Guido Trotter | need all of the steps specified, some are not strictly required for every |
32 | f1a808df | Guido Trotter | environment. Which ones they are, and why, is specified in the |
33 | f1a808df | Guido Trotter | corresponding sections. |
34 | f1a808df | Guido Trotter | </para> |
35 | f1a808df | Guido Trotter | |
36 | f1a808df | Guido Trotter | <para>While Ganeti itself is distribution-agnostic most of the examples in |
37 | f1a808df | Guido Trotter | this document will be targeted at Debian or debian derived distributions. |
38 | f1a808df | Guido Trotter | You are expected to be familiar with your distribution, its package |
39 | f1a808df | Guido Trotter | management system, and Xen before trying to use Ganeti. |
40 | f1a808df | Guido Trotter | </para> |
41 | f1a808df | Guido Trotter | |
42 | 6bf0c9bb | Guido Trotter | <para>A basic Ganeti terminology glossary is provided in the introductory |
43 | 6bf0c9bb | Guido Trotter | section of the "admin guide". Please refer to that if you are uncertain |
44 | 6bf0c9bb | Guido Trotter | about the terms we are using. |
45 | 6bf0c9bb | Guido Trotter | </para> |
46 | 6bf0c9bb | Guido Trotter | |
47 | f1a808df | Guido Trotter | </sect1> |
48 | f1a808df | Guido Trotter | |
49 | f1a808df | Guido Trotter | <sect1> |
50 | f1a808df | Guido Trotter | <title>Installing the system and base components</title> |
51 | f1a808df | Guido Trotter | |
52 | f1a808df | Guido Trotter | <sect2> |
53 | f1a808df | Guido Trotter | <title>Installing the base system</title> |
54 | f1a808df | Guido Trotter | |
55 | f1a808df | Guido Trotter | <para>Mandatory. |
56 | f1a808df | Guido Trotter | </para> |
57 | f1a808df | Guido Trotter | |
58 | f1a808df | Guido Trotter | <para>Please install your operating system as you would normally do. The |
59 | f1a808df | Guido Trotter | only requirement you need to be aware of at this stage is to partition |
60 | f1a808df | Guido Trotter | leaving enough space for a big LVM volume group which will then host |
61 | f1a808df | Guido Trotter | your instance file systems. You can even create the volume group at |
62 | f1a808df | Guido Trotter | installation time, of course: the default volume group name Ganeti 1.2 |
63 | f1a808df | Guido Trotter | uses is "xenvg" but you may name it differently should you wish to, as |
64 | f1a808df | Guido Trotter | long as the name is the same for all the nodes in the cluster. |
65 | f1a808df | Guido Trotter | </para> |
66 | f1a808df | Guido Trotter | |
67 | f1a808df | Guido Trotter | </sect2> |
68 | f1a808df | Guido Trotter | |
69 | f1a808df | Guido Trotter | <sect2> |
70 | f1a808df | Guido Trotter | <title>Installing Xen</title> |
71 | f1a808df | Guido Trotter | |
72 | f1a808df | Guido Trotter | <para>Mandatory: While Ganeti is developed with the ability to modularly |
73 | f1a808df | Guido Trotter | run on different virtualization environments in mind the only one |
74 | f1a808df | Guido Trotter | currently useable on a live system is Xen. |
75 | f1a808df | Guido Trotter | </para> |
76 | f1a808df | Guido Trotter | |
77 | f1a808df | Guido Trotter | <para>Please follow your distribution's recommended way to install and set |
78 | f1a808df | Guido Trotter | up Xen, or install Xen from the upstream source, if you wish, following |
79 | f1a808df | Guido Trotter | their manual. |
80 | f1a808df | Guido Trotter | </para> |
81 | f1a808df | Guido Trotter | |
82 | f1a808df | Guido Trotter | <para>For example under Debian 4.0 or 3.1+backports you can install the |
83 | f1a808df | Guido Trotter | relevant xen-linux-system package, which will pull in both the hypervisor |
84 | f1a808df | Guido Trotter | and the relevant kernel. On Ubuntu (from Gutsy on) the package is called |
85 | f1a808df | Guido Trotter | ubuntu-xen-server. |
86 | f1a808df | Guido Trotter | </para> |
87 | f1a808df | Guido Trotter | |
88 | f1a808df | Guido Trotter | <para>After installing Xen you need to reboot into your xenified dom0 |
89 | f1a808df | Guido Trotter | system. Again on some distributions this might involve configuring GRUB |
90 | f1a808df | Guido Trotter | appropriately. |
91 | f1a808df | Guido Trotter | </para> |
92 | f1a808df | Guido Trotter | |
93 | f1a808df | Guido Trotter | </sect2> |
94 | f1a808df | Guido Trotter | |
95 | f1a808df | Guido Trotter | <sect2> |
96 | f1a808df | Guido Trotter | <title>Installing DRBD</title> |
97 | f1a808df | Guido Trotter | |
98 | f1a808df | Guido Trotter | <para>Recommended: DRBD is required if you want to use the high |
99 | f1a808df | Guido Trotter | availability (HA) features of Ganeti, but optional if you don't require |
100 | f1a808df | Guido Trotter | HA or only run Ganeti on single-node clusters. You can upgrade a non-HA |
101 | f1a808df | Guido Trotter | cluster to an HA one later, but you might need to export and reimport |
102 | f1a808df | Guido Trotter | all your instances to take advantage of the new features. |
103 | f1a808df | Guido Trotter | </para> |
104 | f1a808df | Guido Trotter | |
105 | f1a808df | Guido Trotter | <para>Now the bad news: unless your distribution already provides it |
106 | f1a808df | Guido Trotter | installing DRBD might involve recompiling your kernel or anyway fiddling |
107 | f1a808df | Guido Trotter | with it. Hopefully at least the xenified kernel source to start from will |
108 | f1a808df | Guido Trotter | be provided. |
109 | f1a808df | Guido Trotter | </para> |
110 | f1a808df | Guido Trotter | |
111 | f1a808df | Guido Trotter | <para>Under Debian you can just install the drbd0.7-module-source and |
112 | f1a808df | Guido Trotter | drbd0.7-utils packages, and your kernel source, and then run |
113 | f1a808df | Guido Trotter | module-assistant to compile the drbd0.7 module. The commands: |
114 | f1a808df | Guido Trotter | |
115 | f1a808df | Guido Trotter | <programlisting> |
116 | f1a808df | Guido Trotter | m-a update |
117 | f1a808df | Guido Trotter | m-a a-i drbd0.7 |
118 | f1a808df | Guido Trotter | </programlisting> |
119 | f1a808df | Guido Trotter | |
120 | f1a808df | Guido Trotter | should do it for you. |
121 | f1a808df | Guido Trotter | </para> |
122 | f1a808df | Guido Trotter | |
123 | f1a808df | Guido Trotter | <para>The good news is that you don't need to configure DRBD at all. |
124 | f1a808df | Guido Trotter | Ganeti will do it for you for every instance you set up. If you have the |
125 | f1a808df | Guido Trotter | DRBD utils installed and the module in your kernel you're fine. Please |
126 | f1a808df | Guido Trotter | check that your system is configured to load the module at every boot. |
127 | f1a808df | Guido Trotter | </para> |
128 | f1a808df | Guido Trotter | |
129 | f1a808df | Guido Trotter | </sect2> |
130 | f1a808df | Guido Trotter | |
131 | f1a808df | Guido Trotter | </sect1> |
132 | f1a808df | Guido Trotter | |
133 | f1a808df | Guido Trotter | |
134 | f1a808df | Guido Trotter | <sect1> |
135 | f1a808df | Guido Trotter | <title>Setting up the environment for Ganeti</title> |
136 | f1a808df | Guido Trotter | |
137 | f1a808df | Guido Trotter | <sect2> |
138 | f1a808df | Guido Trotter | <title>Configuring the network</title> |
139 | f1a808df | Guido Trotter | |
140 | f1a808df | Guido Trotter | <para>Ganeti relies on Xen running in "bridge mode", which means the |
141 | f1a808df | Guido Trotter | instances network interfaces will be attached to a software bridge |
142 | f1a808df | Guido Trotter | running in dom0. Xen by default creates such a bridge at startup, but |
143 | f1a808df | Guido Trotter | your distribution might have a different way to do things. |
144 | f1a808df | Guido Trotter | </para> |
145 | f1a808df | Guido Trotter | |
146 | f1a808df | Guido Trotter | <para> |
147 | f1a808df | Guido Trotter | In Debian, in order to enable the default Xen behaviour, you have to edit |
148 | f1a808df | Guido Trotter | /etc/xen/xend-config.sxp and replace (network-script network-dummy) with |
149 | f1a808df | Guido Trotter | (network-script network-bridge). The recommended Debian way to configure |
150 | f1a808df | Guido Trotter | things, though, is to edit your /etc/network/interfaces file and |
151 | f1a808df | Guido Trotter | substitute your normal ethernet stanza with something like: |
152 | f1a808df | Guido Trotter | |
153 | f1a808df | Guido Trotter | <programlisting> |
154 | f1a808df | Guido Trotter | auto br0 |
155 | f1a808df | Guido Trotter | iface br0 inet static |
156 | f1a808df | Guido Trotter | address YOUR_IP_ADDRESS |
157 | f1a808df | Guido Trotter | netmask YOUR_NETMASK |
158 | f1a808df | Guido Trotter | network YOUR_NETWORK |
159 | f1a808df | Guido Trotter | broadcast YOUR_BROADCAST_ADDRSS |
160 | f1a808df | Guido Trotter | gateway YOUR_GATEWAY |
161 | f1a808df | Guido Trotter | # dns-* options are implemented by the resolvconf package, if installed |
162 | f1a808df | Guido Trotter | dns-nameservers YOUR_DNS_SERVERS |
163 | f1a808df | Guido Trotter | dns-search YOUR_SEARCH_PATH |
164 | f1a808df | Guido Trotter | bridge_ports eth0 |
165 | f1a808df | Guido Trotter | bridge_stp off |
166 | f1a808df | Guido Trotter | bridge_fd 0 |
167 | f1a808df | Guido Trotter | </programlisting> |
168 | f1a808df | Guido Trotter | |
169 | f1a808df | Guido Trotter | </para> |
170 | f1a808df | Guido Trotter | |
171 | f1a808df | Guido Trotter | <para> |
172 | f1a808df | Guido Trotter | Beware that the default name Ganeti uses is xen-br0 (which was used in |
173 | f1a808df | Guido Trotter | Xen 2.0) while Xen 3.0 uses xenbr0 by default. The default bridge your |
174 | f1a808df | Guido Trotter | cluster will use for new instances can be specified at cluster |
175 | f1a808df | Guido Trotter | initialization time. |
176 | f1a808df | Guido Trotter | </para> |
177 | f1a808df | Guido Trotter | |
178 | f1a808df | Guido Trotter | </sect2> |
179 | f1a808df | Guido Trotter | |
180 | f1a808df | Guido Trotter | <sect2> |
181 | f1a808df | Guido Trotter | <title>Configuring LVM</title> |
182 | f1a808df | Guido Trotter | |
183 | f1a808df | Guido Trotter | <para> |
184 | f1a808df | Guido Trotter | If you haven't configured your LVM volume group at install time you need |
185 | f1a808df | Guido Trotter | to do it before trying to initialize the Ganeti cluster. This is done by |
186 | f1a808df | Guido Trotter | formatting the devices/partitions you want to use for it and then adding |
187 | f1a808df | Guido Trotter | them to the relevant volume group: |
188 | f1a808df | Guido Trotter | |
189 | f1a808df | Guido Trotter | <programlisting> |
190 | f1a808df | Guido Trotter | pvcreate /dev/sda4 |
191 | f1a808df | Guido Trotter | pvcreate /dev/sdb |
192 | f1a808df | Guido Trotter | pvcreate /dev/sdc1 |
193 | f1a808df | Guido Trotter | vgcreate xenvg /dev/sda4 /dev/sdb /dev/sdc1 |
194 | f1a808df | Guido Trotter | </programlisting> |
195 | f1a808df | Guido Trotter | </para> |
196 | f1a808df | Guido Trotter | |
197 | f1a808df | Guido Trotter | <para> |
198 | 53b78ba4 | Guido Trotter | If you want to add a device later you can do so with the |
199 | 53b78ba4 | Guido Trotter | <citerefentry><refentrytitle>vgextend</refentrytitle> |
200 | 53b78ba4 | Guido Trotter | <manvolnum>8</manvolnum></citerefentry> command. |
201 | f1a808df | Guido Trotter | <programlisting> |
202 | f1a808df | Guido Trotter | pvcreate /dev/sdd |
203 | f1a808df | Guido Trotter | vgextend xenvg /dev/sdd |
204 | f1a808df | Guido Trotter | </programlisting> |
205 | f1a808df | Guido Trotter | </para> |
206 | f1a808df | Guido Trotter | |
207 | f1a808df | Guido Trotter | <para> |
208 | f1a808df | Guido Trotter | As said before you may choose a different name for the volume group, |
209 | f1a808df | Guido Trotter | as long as you stick to the same name on all the nodes of a cluster. |
210 | f1a808df | Guido Trotter | </para> |
211 | f1a808df | Guido Trotter | </sect2> |
212 | f1a808df | Guido Trotter | |
213 | f1a808df | Guido Trotter | <sect2> |
214 | f1a808df | Guido Trotter | <title>Installing Ganeti</title> |
215 | f1a808df | Guido Trotter | |
216 | f1a808df | Guido Trotter | <para>It's now time to install the Ganeti software itself if you haven't |
217 | f1a808df | Guido Trotter | done it yet. You can do it from source, with the usual steps: |
218 | f1a808df | Guido Trotter | |
219 | f1a808df | Guido Trotter | <programlisting> |
220 | f1a808df | Guido Trotter | ./configure |
221 | f1a808df | Guido Trotter | make |
222 | f1a808df | Guido Trotter | make install |
223 | f1a808df | Guido Trotter | </programlisting> |
224 | f1a808df | Guido Trotter | |
225 | f1a808df | Guido Trotter | or you can install the package relevant to your distribution, for |
226 | f1a808df | Guido Trotter | example in Debian/Ubuntu: |
227 | f1a808df | Guido Trotter | |
228 | f1a808df | Guido Trotter | <programlisting> |
229 | f1a808df | Guido Trotter | dpkg -i ganeti_VERSION_all.deb |
230 | f1a808df | Guido Trotter | </programlisting> |
231 | f1a808df | Guido Trotter | |
232 | f1a808df | Guido Trotter | or, if you have a source repository that holds the Ganeti software: |
233 | f1a808df | Guido Trotter | |
234 | f1a808df | Guido Trotter | <programlisting> |
235 | f1a808df | Guido Trotter | apt-get install ganeti |
236 | f1a808df | Guido Trotter | </programlisting> |
237 | f1a808df | Guido Trotter | </para> |
238 | f1a808df | Guido Trotter | |
239 | f1a808df | Guido Trotter | </sect2> |
240 | f1a808df | Guido Trotter | |
241 | f1a808df | Guido Trotter | <sect2> |
242 | f1a808df | Guido Trotter | <title>Installing the Operating System support packages</title> |
243 | f1a808df | Guido Trotter | |
244 | f1a808df | Guido Trotter | <para>Another important component for Ganeti is the OS support packages, |
245 | f1a808df | Guido Trotter | which let different operating systems be used as instances. You can |
246 | f1a808df | Guido Trotter | install them by installing the relevant ganeti-instance-OS package. |
247 | f1a808df | Guido Trotter | </para> |
248 | f1a808df | Guido Trotter | |
249 | f1a808df | Guido Trotter | </sect2> |
250 | f1a808df | Guido Trotter | |
251 | f1a808df | Guido Trotter | <sect2> |
252 | f1a808df | Guido Trotter | <title>Initializing the cluster</title> |
253 | f1a808df | Guido Trotter | |
254 | f1a808df | Guido Trotter | <para>Mandatory: only on one node per cluster. |
255 | f1a808df | Guido Trotter | </para> |
256 | f1a808df | Guido Trotter | |
257 | f1a808df | Guido Trotter | |
258 | f1a808df | Guido Trotter | <para>The last step is to initialize the cluster. After you've repeated |
259 | f1a808df | Guido Trotter | the above process or some semi-automatic form of it on all of your |
260 | f1a808df | Guido Trotter | nodes choose one as the master, and execute: |
261 | f1a808df | Guido Trotter | |
262 | f1a808df | Guido Trotter | <programlisting> |
263 | f1a808df | Guido Trotter | gnt-cluster init CLUSTERNAME |
264 | f1a808df | Guido Trotter | </programlisting> |
265 | f1a808df | Guido Trotter | |
266 | f1a808df | Guido Trotter | Options you can pass to gnt-cluster init include the default bridge |
267 | f1a808df | Guido Trotter | name (-b), the cluster-wide name for the volume group (-g) and the |
268 | f1a808df | Guido Trotter | secondary ip address for the initial node should you wish to keep the |
269 | f1a808df | Guido Trotter | data replication network separate. Invoke it with --help to see all the |
270 | f1a808df | Guido Trotter | possibilities. |
271 | f1a808df | Guido Trotter | </para> |
272 | f1a808df | Guido Trotter | |
273 | f1a808df | Guido Trotter | <para>The cluster name must exist in DNS. You must choose a name |
274 | f1a808df | Guido Trotter | different from any of the nodes names for a multi-node cluster. In |
275 | f1a808df | Guido Trotter | general the best choice is to have a completely unique name for each |
276 | f1a808df | Guido Trotter | cluster. |
277 | f1a808df | Guido Trotter | </para> |
278 | f1a808df | Guido Trotter | </sect2> |
279 | f1a808df | Guido Trotter | |
280 | f1a808df | Guido Trotter | <sect2> |
281 | f1a808df | Guido Trotter | <title>Joining the nodes to the cluster.</title> |
282 | f1a808df | Guido Trotter | |
283 | f1a808df | Guido Trotter | <para>Mandatory: for all the other nodes. |
284 | f1a808df | Guido Trotter | </para> |
285 | f1a808df | Guido Trotter | |
286 | f1a808df | Guido Trotter | <para> |
287 | f1a808df | Guido Trotter | If you have already initialized your cluster you need to join the other |
288 | f1a808df | Guido Trotter | nodes to it. You can do so by executing the following command on the |
289 | f1a808df | Guido Trotter | master node: |
290 | f1a808df | Guido Trotter | <programlisting> |
291 | f1a808df | Guido Trotter | gnt-node add NODENAME |
292 | f1a808df | Guido Trotter | </programlisting> |
293 | f1a808df | Guido Trotter | |
294 | f1a808df | Guido Trotter | The only option is (-s), which sets the node's secondary ip address for |
295 | f1a808df | Guido Trotter | replication purposes, if you are using a separate replication network. |
296 | f1a808df | Guido Trotter | </para> |
297 | f1a808df | Guido Trotter | </sect2> |
298 | f1a808df | Guido Trotter | |
299 | f1a808df | Guido Trotter | </sect1> |
300 | f1a808df | Guido Trotter | |
301 | f1a808df | Guido Trotter | <sect1> |
302 | f1a808df | Guido Trotter | <title>This is it!</title> |
303 | f1a808df | Guido Trotter | |
304 | f1a808df | Guido Trotter | <para>Now you can follow the "admin guide" to use your new Ganeti cluster. |
305 | f1a808df | Guido Trotter | </para> |
306 | f1a808df | Guido Trotter | |
307 | f1a808df | Guido Trotter | </sect1> |
308 | f1a808df | Guido Trotter | |
309 | f1a808df | Guido Trotter | |
310 | f1a808df | Guido Trotter | </article> |