/[gentoo]/xml/htdocs/doc/en/diskless-howto.xml
Gentoo

Contents of /xml/htdocs/doc/en/diskless-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.37 - (hide annotations) (download) (as text)
Sun Oct 30 11:56:08 2011 UTC (2 years, 11 months ago) by swift
Branch: MAIN
Changes since 1.36: +5 -4 lines
File MIME type: application/xml
Fix bug #388953 - Refer to /usr/share/doc/openrc-*/net.example.bz2 instead of /etc/conf.d/net.example

1 cam 1.28 <?xml version="1.0" encoding="UTF-8"?>
2 swift 1.37 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/diskless-howto.xml,v 1.36 2011/09/04 17:53:40 swift Exp $ -->
3 neysx 1.1 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4    
5 swift 1.36 <guide>
6 neysx 1.1 <title>Diskless Nodes with Gentoo</title>
7    
8     <author title="Researcher">
9 cam 1.29 <mail link="ma53@drexel.edu">Michael Andrews</mail>
10 neysx 1.1 </author>
11 swift 1.3 <author title="Editor">
12 cam 1.29 <mail link="unsolo@sysrq.no">Kristian Jerpetjoen</mail>
13 swift 1.3 </author>
14 neysx 1.1 <author title="Reviewer">
15 nightmorph 1.32 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
16 neysx 1.1 </author>
17     <author title="Reviewer">
18 cam 1.29 <mail link="neysx@gentoo.org">Xavier Neys</mail>
19 neysx 1.1 </author>
20    
21     <abstract>
22 cam 1.29 This HOWTO will help you create setup diskless nodes with Gentoo Linux.
23 neysx 1.1 </abstract>
24    
25 jkt 1.22 <!-- The content of this document is licensed under the CC-BY-SA license -->
26     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
27 swift 1.2 <license/>
28    
29 swift 1.37 <version>2</version>
30     <date>2011-10-30</date>
31 neysx 1.1
32     <chapter>
33     <title>Introduction</title>
34     <section>
35     <title>About this HOWTO</title>
36     <body>
37    
38     <p>
39 cam 1.29 This HOWTO will help you setup <e>diskless</e> workstations based on the Gentoo
40     Linux distribution. We intend to make this as user friendly as possible and
41     cater to the Linux newbie, because every one of us was one at a certain point :)
42     While an experienced user could easily tie the multiple HOWTOs available on
43     diskless nodes and networking together we hope that this guide can ease the
44     installation for all interested users, geeks or not.
45 neysx 1.1 </p>
46    
47     </body>
48     </section>
49     <section>
50     <title>What is a diskless machine?</title>
51     <body>
52    
53     <p>
54     A diskless machine is a PC without any of the usual boot devices such as hard
55 cam 1.29 disks, floppy drives or CD-ROMs. The diskless node boots off the network and
56     needs a server that will provide it with storage space as a local hard disk
57     would. From now on we call the server the <e>master</e>, while the diskless
58     machine gets called the <e>slave</e> (what's in a name :). The slave node needs
59     a network adapter that supports PXE booting or Etherboot; check <uri
60     link="http://www.etherboot.org">Etherboot.org</uri> for support listings. Most
61     modern cards support PXE and many built-in adapters on motherboards will also
62 swift 1.5 work.
63 neysx 1.1 </p>
64    
65     </body>
66     </section>
67     <section>
68     <title>Before you start</title>
69     <body>
70    
71     <p>
72 cam 1.29 You should have Gentoo installed on your master node and enough space on the
73     master to store the file systems of the slave nodes you want to host. Also make
74     sure you have one interface to the internet separated from the local area
75     connection.
76 neysx 1.1 </p>
77    
78     </body>
79     </section>
80     </chapter>
81    
82     <chapter>
83     <title>Configuring the master and the slaves</title>
84     <section>
85     <title>About kernels</title>
86     <body>
87    
88     <p>
89 cam 1.29 The kernel is the software that sits between your hardware and all other
90     software you have loaded on your machine, essentially the heart of a kernel
91     based operating system. When your computer is started, the BIOS executes the
92     instructions found at the reserved boot space of your hard drive. These
93     instructions are typically a boot loader that loads your kernel. After your
94     kernel has been loaded all processes are handled by the kernel.
95 neysx 1.1 </p>
96    
97     <p>
98 cam 1.29 For more information on kernels and kernel configuration you might want to check
99     out the <uri link="http://www.tldp.org/HOWTO/Kernel-HOWTO.html">kernel
100 neysx 1.1 HOWTO</uri>.
101     </p>
102    
103     </body>
104     </section>
105     <section>
106     <title>Configuring the master kernel</title>
107     <body>
108    
109     <p>
110 cam 1.29 The master kernel can be as large and as customized as you would like but there
111     are a few required kernel options you need to select. Go into your kernel
112     configuration menu by typing:
113 neysx 1.1 </p>
114    
115     <pre caption="Editing the master's kernel configuration">
116     # <i>cd /usr/src/linux</i>
117     # <i>make menuconfig</i>
118     </pre>
119    
120     <p>
121 cam 1.29 You should get a grey and blue GUI that offers a safe alternative to manually
122     editing the <path>/usr/src/linux/.config</path> file. If your kernel is
123     currently functioning well you might want to save the current configuration file
124     by exiting the GUI and type:
125 neysx 1.1 </p>
126    
127     <pre caption="Backing up the master's kernel configuration">
128     # <i>cp .config .config_working</i>
129     </pre>
130    
131     <p>
132 cam 1.29 Go into the following sub-menus and make sure the listed items are checked as
133     built-in (and <e>NOT</e> as modular). The options show below are taken from the
134     2.6.10 kernel version. If you use a different version, the text or sequence
135 neysx 1.1 might differ. Just make sure you select at least those shown below.
136     </p>
137    
138     <pre caption="master's kernel options">
139     Code maturity level options ---&gt;
140     [*] Prompt for development and/or incomplete code/drivers
141    
142 swift 1.12 Device Drivers ---&gt;
143     Networking options ---&gt;
144     &lt;*&gt; Packet socket
145     &lt;*&gt; Unix domain sockets
146     [*] TCP/IP networking
147     [*] IP: multicasting
148     [ ] Network packet filtering (replaces ipchains)
149 cam 1.29
150 neysx 1.1 File systems ---&gt;
151     Network File Systems ---&gt;
152     &lt;*&gt; NFS server support
153     [*] Provide NFSv3 server support
154 swift 1.3
155     <comment>
156 cam 1.29 If you want to access the internet through your master node and/or have a
157 swift 1.3 secure firewall make sure to add support for iptables
158     </comment>
159     [*] Network packet filtering (replaces ipchains)
160     IP: Netfilter Configuration ---&gt;
161     &lt;*&gt; Connection tracking (required for masq/NAT)
162     &lt;*&gt; IP tables support (required for filtering/masq/NAT)
163 neysx 1.1 </pre>
164    
165 swift 1.3 <p>
166 neysx 1.17 If you want to use packet filtering, you can add the rest as modules later.
167     Make sure to read the <uri
168 cam 1.29 link="/doc/en/security/security-handbook.xml?part=1&amp;chap=12">Gentoo Security
169     Handbook Chapter about Firewalls</uri> on how to set this up properly.
170 swift 1.3 </p>
171    
172 neysx 1.1 <note>
173 cam 1.29 These kernel configuration options should only be added to your system specific
174     configuration options and are not meant to completely replace your kernel
175     configuration.
176 neysx 1.1 </note>
177    
178     <p>
179 cam 1.29 After you have re-configured the master's kernel you will want to rebuild it:
180 neysx 1.1 </p>
181    
182     <pre caption="Recompiling the master's kernel and modules">
183 swift 1.12 # <i>make &amp;&amp; make modules_install</i>
184 neysx 1.1 <comment>(Make sure /boot is mounted before copying to it)</comment>
185     # <i>cp arch/i386/boot/bzImage /boot/bzImage-master</i>
186     </pre>
187    
188     <p>
189     Then add an entry for that new kernel into <path>lilo.conf</path> or
190     <path>grub.conf</path> depending on which bootloader you are using and make the
191     new kernel the default one. Now that the new bzImage has been copied into your
192     boot directory all you will have to do is reboot the system in order to load
193     these new options.
194     </p>
195    
196     </body>
197     </section>
198     <section>
199     <title>About the slave kernel</title>
200     <body>
201    
202     <p>
203 cam 1.29 It is recommended that you compile the slave kernel without any modules, since
204     loading and setting them up via remote boot is a difficult and unnecessary
205     process. Additionally, the slave kernel should be as small and compact as
206     possible in order to efficiently boot from the network. We are going to compile
207 neysx 1.1 the slave's kernel in the same place where the master was configured.
208     </p>
209    
210     <p>
211 cam 1.29 To avoid confusion and wasting time it is probably a good idea to backup the
212 neysx 1.1 master's configuration file by typing:
213     </p>
214    
215     <pre caption="Backing up the master's kernel configuration">
216     # <i>cp /usr/src/linux/.config /usr/src/linux/.config_master</i>
217     </pre>
218    
219     <p>
220 cam 1.29 Now we will want to configure the slave's kernel in the same fashion we
221     configured the master's kernel. If you want to start with a fresh configuration
222     file you can always recover the default <path>/usr/src/linux/.config</path> file
223     by typing:
224 neysx 1.1 </p>
225    
226     <pre caption="Getting a clean kernel configuration">
227     # <i>cd /usr/src/linux</i>
228 swift 1.9 # <i>cp .config_master .config</i>
229 neysx 1.1 </pre>
230    
231     <p>
232     Now go into the configuration GUI by typing:
233     </p>
234    
235     <pre caption="Editing the slave's kernel configuration">
236     # <i>cd /usr/src/linux</i>
237     # <i>make menuconfig</i>
238     </pre>
239    
240     <p>
241 cam 1.29 You will want to make sure you select the following options as built-in and
242     <e>NOT</e> as kernel modules:
243 neysx 1.1 </p>
244    
245     <pre caption="slave's kernel options">
246     Code maturity level options ---&gt;
247     [*] Prompt for development and/or incomplete code/drivers
248    
249 swift 1.12 Device Drivers ---&gt;
250     [*] Networking support
251     Networking options ---&gt;
252     &lt;*&gt; Packet socket
253     &lt;*&gt; Unix domain sockets
254     [*] TCP/IP networking
255     [*] IP: multicasting
256     [*] IP: kernel level autoconfiguration
257     [*] IP: DHCP support (NEW)
258 neysx 1.1
259     File systems ---&gt;
260     Network File Systems ---&gt;
261 cam 1.29 &lt;*&gt; file system support
262 neysx 1.1 [*] Provide NFSv3 client support
263     [*] Root file system on NFS
264     </pre>
265    
266 swift 1.3 <note>
267     An alternative to having an dhcp server is setting up a BOOTP server.
268     </note>
269    
270     <impo>
271 cam 1.29 It is important that you add your network adapter into the kernel (and not as a
272     module) on the nodes. Using modules however is generally not a problem for
273 swift 1.3 diskless nodes.
274     </impo>
275    
276 neysx 1.1 <p>
277 cam 1.29 Now the slave's kernel needs to be compiled. You have to be careful here
278     because you don't want to mess up the modules (if any) you have built for the
279 neysx 1.1 master:
280     </p>
281    
282     <pre caption="Compiling the slave kernel">
283     # <i>cd /usr/src/linux</i>
284 swift 1.12 # <i>make</i>
285 neysx 1.1 </pre>
286    
287     <p>
288     Now create the directory on the master that will be used to hold slaves' files
289 cam 1.29 and required system files. We use <path>/diskless</path> but you may choose any
290     location you like. Now copy the slave's bzImage into the <path>/diskless</path>
291     directory:
292 neysx 1.1 </p>
293    
294 swift 1.3 <note>
295 swift 1.4 If you are using different architectures you might want to save each config into
296 cam 1.29 <path>.config_arch</path>. Do the same with the images: save them into the
297 swift 1.3 <path>/diskless</path> as <path>bzImage_arch</path>.
298     </note>
299    
300 neysx 1.1 <pre caption="Copying the slave kernel">
301     # <i>mkdir /diskless</i>
302     # <i>cp /usr/src/linux/arch/i386/boot/bzImage /diskless</i>
303     </pre>
304    
305     </body>
306     </section>
307     <section>
308     <title>Configuring a preliminary slave file system</title>
309     <body>
310    
311     <p>
312 cam 1.29 The master and slave filesystems can be tweaked and changed a lot. Right now we
313     are only interested in getting a preliminary filesystem of appropriate
314     configuration files and mount points. First we need to create a directory within
315     <path>/diskless</path> for the first slave. Each slave needs it's own root file
316     system because sharing certain system files will cause permission problems and
317     hard crashes. You can call these directories anything you want but I suggest
318     using the slaves IP addresses as they are unique and not confusing. The static
319     IP of our first slave will be, for instance, <c>192.168.1.21</c>:
320 neysx 1.1 </p>
321    
322     <pre caption="Creating a remote root directory">
323     # <i>mkdir /diskless/192.168.1.21</i>
324     </pre>
325    
326     <p>
327 cam 1.29 Various configuration files in <path>/etc</path> need to be altered to work on
328     the slave. Copy the master's <path>/etc</path> directory onto your new slave
329     root by typing:
330 neysx 1.1 </p>
331    
332     <pre caption="Creating /etc for the slave's filesystem">
333     # <i>cp -r /etc /diskless/192.168.1.21/etc</i>
334     </pre>
335    
336     <p>
337     Still this filesystem isn't ready because it needs various mount points and
338     directories. To create them, type:
339     </p>
340    
341     <pre caption="Creating mount points and directories in the slave's filesystem">
342     # <i>mkdir /diskless/192.168.1.21/home</i>
343     # <i>mkdir /diskless/192.168.1.21/dev</i>
344     # <i>mkdir /diskless/192.168.1.21/proc</i>
345     # <i>mkdir /diskless/192.168.1.21/tmp</i>
346     # <i>mkdir /diskless/192.168.1.21/mnt</i>
347 swift 1.3 # <i>chmod a+w /diskless/192.168.1.21/tmp</i>
348 neysx 1.1 # <i>mkdir /diskless/192.168.1.21/mnt/.initd</i>
349     # <i>mkdir /diskless/192.168.1.21/root</i>
350 jkt 1.23 # <i>mkdir /diskless/192.168.1.21/sys</i>
351 neysx 1.1 # <i>mkdir /diskless/192.168.1.21/var</i>
352     # <i>mkdir /diskless/192.168.1.21/var/empty</i>
353     # <i>mkdir /diskless/192.168.1.21/var/lock</i>
354     # <i>mkdir /diskless/192.168.1.21/var/log</i>
355     # <i>mkdir /diskless/192.168.1.21/var/run</i>
356 swift 1.3 # <i>mkdir /diskless/192.168.1.21/var/spool</i>
357 neysx 1.8 # <i>mkdir /diskless/192.168.1.21/usr</i>
358     # <i>mkdir /diskless/192.168.1.21/opt</i>
359 neysx 1.1 </pre>
360    
361     <p>
362 jkt 1.23 Most of these "stubs" should be recognizable to you; stubs like
363     <path>/dev</path>, <path>/proc</path> or <path>/sys</path> will be populated
364     when the slave starts, the others will be mounted later. You should also change
365     the <path>/diskless/192.168.1.21/etc/conf.d/hostname</path> file to reflect the
366 jkt 1.21 hostname of the slave. Binaries, libraries and other files will be populated
367     later in this HOWTO right before you attempt to boot the slave.
368 neysx 1.1 </p>
369    
370 swift 1.15 <p>
371     Even though <path>/dev</path> is populated by <c>udev</c> later on, you need to
372     create the <path>console</path> entry. If not, you will receive the error
373     "unable to open initial console".
374     </p>
375    
376     <pre caption="Creating console entry in the /dev">
377 swift 1.16 # <i>mknod /diskless/192.168.1.21/dev/console c 5 1</i>
378 swift 1.15 </pre>
379    
380 neysx 1.1 </body>
381     </section>
382     </chapter>
383    
384     <chapter>
385     <title>Configuring the DHCP server</title>
386     <section>
387     <title>About the DHCP server</title>
388     <body>
389    
390     <p>
391 cam 1.29 DHCP stands for Dynamic Host Configuration Protocol. The DHCP server is the
392     first computer the slaves will communicate with when they PXE boot. The primary
393     purpose of the DHCP server is to assign IP addresses. The DHCP server can
394     assign IP addresses based on hosts ethernet MAC addresses. Once the slave has
395     an IP address, the DHCP server will tell the slave where to get its initial file
396     system and kernel.
397 neysx 1.1 </p>
398    
399     </body>
400     </section>
401     <section>
402     <title>Before you get started</title>
403     <body>
404    
405     <p>
406 cam 1.29 There are several things you will want to make sure are working before you
407 neysx 1.1 begin. First check your network connectivity:
408     </p>
409    
410     <pre caption="Checking networking configurations">
411 jkt 1.20 # <i>ifconfig eth0 multicast</i>
412 neysx 1.1 # <i>ifconfig -a</i>
413     </pre>
414    
415     <p>
416 cam 1.29 You will want to make sure you have have an <e>eth0</e> device running. It
417 neysx 1.1 should look something like this:
418     </p>
419    
420     <pre caption="A properly working eth0 device">
421     eth0 Link encap:Ethernet HWaddr 00:E0:83:16:2F:D6
422     inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
423     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
424     RX packets:26460491 errors:0 dropped:0 overruns:2 frame:0
425     TX packets:32903198 errors:0 dropped:0 overruns:0 carrier:1
426     collisions:0 txqueuelen:100
427     RX bytes:2483502568 (2368.4 Mb) TX bytes:1411984950 (1346.5 Mb)
428     Interrupt:18 Base address:0x1800
429     </pre>
430    
431     <p>
432 rane 1.19 It's important that it says <e>MULTICAST</e>, if it doesn't then you will have
433     to recompile your kernel to include multicast support.
434 neysx 1.1 </p>
435    
436     </body>
437     </section>
438     <section>
439     <title>Installing the DHCP server</title>
440     <body>
441    
442     <p>
443 cam 1.29 If your network does not already have a DHCP server installed you will need to
444     install one:
445 neysx 1.1 </p>
446    
447     <pre caption="Installing the dhcp server">
448     # <i>emerge dhcp</i>
449     </pre>
450    
451     <p>
452 cam 1.29 If your network already has a DHCP server installed you will have to edit the
453 neysx 1.1 configuration file to get the PXE boot to function correctly.
454     </p>
455    
456     </body>
457     </section>
458     <section>
459     <title>Configuring the DHCP server</title>
460     <body>
461    
462     <p>
463     There is only one configuration file you will have to edit before starting the
464     DHCP server: <path>/etc/dhcp/dhcpd.conf</path>. Copy and edit the provided
465     sample file:
466     </p>
467    
468     <pre caption="Editing the dhcp server's configuration file">
469     # <i>cp /etc/dhcp/dhcpd.conf.sample /etc/dhcp/dhcpd.conf</i>
470     # <i>nano -w /etc/dhcp/dhcpd.conf</i>
471     </pre>
472    
473     <p>
474 cam 1.29 The general layout of the file is set up in an indented fashion and looks like
475     this:
476 neysx 1.1 </p>
477    
478     <pre caption="Sample dhcpd.conf layout">
479     <comment># global options here</comment>
480     ddns-update-style none;
481     shared-network LOCAL-NET {
482     <comment># shared network options here</comment>
483     subnet 192.168.1.0 netmask 255.255.255.0 {
484     <comment> # subnet network options here</comment>
485     host slave{
486     <comment> # host specific options here</comment>
487     }
488     group {
489     <comment> # group specific options here</comment>
490     }
491     }
492     }
493     </pre>
494    
495     <p>
496 cam 1.29 The <c>shared-network</c> block is optional and should be used for IPs you want
497 neysx 1.1 to assign that belong to the same network topology. At least one <c>subnet</c>
498     must be declared and the optional <c>group</c> block allows you to group options
499     between items. A good example of <path>dhcpd.conf</path> looks like this:
500     </p>
501    
502     <pre caption="Sample dhcpd.conf">
503 cam 1.28 #
504     # Sample dhcpd.conf for diskless clients
505     #
506    
507     # Disable dynamic DNS
508 neysx 1.1 ddns-update-style none;
509 cam 1.28
510     # Assume one default gateway for IP traffic will do
511     option routers 192.168.1.1;
512    
513     # Provide DNS info to clients
514     option domain-name-servers 192.168.1.1;
515     option domain-name "mydomain.com";
516    
517     # Specify the TFTP server to be used
518     next-server 192.168.1.1;
519    
520     # Declare a vendor-specific option buffer for PXE clients:
521 neysx 1.1 # Code 1: Multicast IP address of boot file server
522     # Code 2: UDP port that client should monitor for MTFTP responses
523     # Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
524     # Code 4: Number of seconds a client must listen for activity before trying
525     # to start a new MTFTP transfer
526     # Code 5: Number of seconds a client must listen before trying to restart
527     # a MTFTP transfer
528 cam 1.28
529 neysx 1.1 option space PXE;
530     option PXE.mtftp-ip code 1 = ip-address;
531     option PXE.mtftp-cport code 2 = unsigned integer 16;
532     option PXE.mtftp-sport code 3 = unsigned integer 16;
533     option PXE.mtftp-tmout code 4 = unsigned integer 8;
534     option PXE.mtftp-delay code 5 = unsigned integer 8;
535     option PXE.discovery-control code 6 = unsigned integer 8;
536     option PXE.discovery-mcast-addr code 7 = ip-address;
537 cam 1.28
538     # Declare the subnet where our diskless nodes will live
539 neysx 1.1 subnet 192.168.1.0 netmask 255.255.255.0 {
540 cam 1.28
541     # Provide PXE clients with appropriate information
542     class "pxeclient" {
543     match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
544 neysx 1.1 vendor-option-space PXE;
545 cam 1.28
546 neysx 1.1 # At least one of the vendor-specific PXE options must be set in
547     # order for the client boot ROMs to realize that we are a PXE-compliant
548     # server. We set the MCAST IP address to 0.0.0.0 to tell the boot ROM
549 cam 1.28 # that we can't provide multicast TFTP.
550    
551 neysx 1.1 option PXE.mtftp-ip 0.0.0.0;
552 cam 1.28
553 neysx 1.1 # This is the name of the file the boot ROMs should download.
554     filename "pxelinux.0";
555     }
556 swift 1.3
557 cam 1.28 # Provide Etherboot clients with appropriate information
558 swift 1.3 class "etherboot" {
559 cam 1.28 match if substring(option vendor-class-identifier, 0, 9) = "Etherboot";
560     filename "vmlinuz_arch";
561 swift 1.3 }
562 cam 1.28
563     # Add one host declaration for each diskless host
564 neysx 1.1 host slave21 {
565 cam 1.28 hardware ethernet 00:02:A5:04:3B:66;
566     fixed-address 192.168.1.21;
567 neysx 1.1 }
568     }
569     </pre>
570    
571 swift 1.3 <note>
572 swift 1.10 There is nothing prohibiting the use of both PXE boot and Etherboot together.
573 cam 1.29 The above Code Listing is merely an example; if you have issues, please consult
574     the DHCPd documentation.
575 swift 1.3 </note>
576    
577 neysx 1.1 <p>
578 cam 1.29 The IP address after <c>next-server</c> will be asked for the specified
579     <c>filename</c>. This IP address should be the IP of the tftp server, usually
580 neysx 1.1 the same as the master's IP address. The <c>filename</c> is relative to the
581 cam 1.29 <path>/diskless</path> directory (this is due to the tftp server specific
582     options which will be covered later). Inside the <c>host</c> block, the
583     <c>hardware ethernet</c> option specifies a MAC address, and
584 neysx 1.1 <c>fixed-address</c> assigns a fixed IP address to that particular MAC address.
585 cam 1.29 There is a pretty good man page on <path>dhcpd.conf</path> with options that are
586     beyond the scope of this HOWTO. You can read it by typing:
587 neysx 1.1 </p>
588    
589     <pre caption="Viewing the man pages for dhcpd.conf">
590     # <i>man dhcpd.conf</i>
591     </pre>
592    
593     </body>
594     </section>
595     <section>
596     <title>Starting the DHCP server</title>
597     <body>
598    
599     <p>
600 cam 1.29 Before you start the dhcp initialisation script edit the
601     <path>/etc/conf.d/dhcp</path> file so that it looks something like this:
602 neysx 1.1 </p>
603    
604     <pre caption="Sample /etc/conf.d/dhcp">
605     IFACE="eth0"
606     <comment># insert any other options needed</comment>
607     </pre>
608    
609     <p>
610 cam 1.29 The <c>IFACE</c> variable is the device you wish to run your DHCP server on, in
611     our case <c>eth0</c>. Adding more arguments to the <c>IFACE</c> variable can be
612     useful for a complex network topology with multiple Ethernet cards. To start the
613     dhcp server type:
614 neysx 1.1 </p>
615    
616     <pre caption="Starting the dhcp server on the master">
617     # <i>/etc/init.d/dhcp start</i>
618     </pre>
619    
620     <p>
621     To add the dhcp server to your start-up scripts type:
622     </p>
623    
624     <pre caption="Adding the dhcp server to the master's default run level">
625     # <i>rc-update add dhcp default</i>
626     </pre>
627    
628     </body>
629     </section>
630     <section>
631     <title>Troubleshooting the DHCP server</title>
632     <body>
633    
634     <p>
635 nightmorph 1.26 To see if a node boots you can take a look at <path>/var/log/messages</path>.
636     If the node successfully boots, the <path>messages</path> file should have some
637     lines at the bottom looking like this:
638 neysx 1.1 </p>
639    
640 swift 1.3 <pre caption="Sample log file entries created by dhcp">
641 neysx 1.1 DHCPDISCOVER from 00:00:00:00:00:00 via eth0
642     DHCPOFFER on 192.168.1.21 to 00:00:00:00:00:00 via eth0
643     DHCPREQUEST for 192.168.1.21 from 00:00:00:00:00:00 via eth0
644     DHCPACK on 192.168.1.21 to 00:00:00:00:00:00 via eth0
645     </pre>
646    
647     <note>
648     This log file can also help you discover the slaves' MAC addresses.
649     </note>
650    
651     <p>
652 cam 1.29 If you get the following message it probably means there is something wrong in
653     the configuration file but that the DHCP server is broadcasting correctly.
654 neysx 1.1 </p>
655    
656     <pre caption="Sample dhpc server error">
657     no free leases on subnet LOCAL-NET
658     </pre>
659    
660     <p>
661     Every time you change the configuration file you must restart the DHCP server.
662     To restart the server type:
663     </p>
664    
665     <pre caption="Restarting the dhcp server on the master">
666     # <i>/etc/init.d/dhcpd restart</i>
667     </pre>
668    
669     </body>
670     </section>
671     </chapter>
672    
673     <chapter>
674 cam 1.29 <title>Configuring the TFTP server and PXE Linux Bootloader and/or Etherboot</title>
675 neysx 1.1 <section>
676     <title>About the TFTP server</title>
677     <body>
678    
679     <p>
680 cam 1.29 TFTP stands for Trivial File Transfer Protocol. The TFTP server is going to
681     supply the slaves with a kernel and an initial filesystem. All of the slave
682     kernels and filesystems will be stored on the TFTP server, so it's probably a
683     good idea to make the master the TFTP server.
684 neysx 1.1 </p>
685    
686 swift 1.3 </body>
687     </section>
688     <section>
689     <title>Installing the TFTP server</title>
690     <body>
691    
692     <p>
693 cam 1.29 A highly recommended tftp server is available as the tftp-hpa package. This
694     tftp server happens to be written by the author of SYSLINUX and it works very
695     well with pxelinux. To install simply type:
696 swift 1.3 </p>
697    
698     <pre caption="Installing the tfp server">
699     # <i>emerge tftp-hpa</i>
700     </pre>
701    
702     </body>
703     </section>
704     <section>
705     <title>Configuring the TFTP server</title>
706     <body>
707    
708     <p>
709     Edit <path>/etc/conf.d/in.tftpd</path>. You need to specify the tftproot
710     directory with <c>INTFTPD_PATH</c> and any command line options with
711     <c>INTFTPD_OPTS</c>. It should look something like this:
712     </p>
713    
714     <pre caption="Sample /etc/conf.d/in.tftpd">
715     INTFTPD_PATH="/diskless"
716     INTFTPD_OPTS="-l -v -s ${INTFTPD_PATH}"
717     </pre>
718    
719     <p>
720 cam 1.29 The <c>-l</c> option indicates that this server listens in stand alone mode so
721     you don't have to run inetd. The <c>-v</c> indicates that log/error messages
722     should be verbose. The <c>-s /diskless</c> specifies the root of your tftp
723 swift 1.3 server.
724     </p>
725    
726     </body>
727     </section>
728     <section>
729     <title>Starting the the TFTP Server</title>
730     <body>
731    
732     <p>
733     To start the tftp server type:
734     </p>
735    
736     <pre caption="Starting the master's tftp server">
737     # <i>/etc/init.d/in.tftpd start</i>
738     </pre>
739    
740     <p>
741     This should start the tftp server with the options you specified in the
742 swift 1.6 <path>/etc/conf.d/in.tftpd</path>. If you want this server to be automatically
743 swift 1.3 started at boot type:
744     </p>
745    
746     <pre caption="Adding the tftp server to the master's default run level">
747     # <i>rc-update add in.tftpd default</i>
748     </pre>
749    
750 neysx 1.1 </body>
751     </section>
752     <section>
753     <title>About PXELINUX</title>
754     <body>
755    
756     <p>
757 cam 1.29 This section is not required if you are only using Etherboot. PXELINUX is the
758     network bootloader equivalent to LILO or GRUB and will be served via TFTP. It
759     is essentially a tiny set of instructions that tells the client where to locate
760     its kernel and initial filesystem and allows for various kernel options.
761 neysx 1.1 </p>
762    
763     </body>
764     </section>
765     <section>
766     <title>Before you get started</title>
767     <body>
768    
769     <p>
770 cam 1.29 You will need to get the pxelinux.0 file which comes in the SYSLINUX package by
771     H. Peter Anvin. You can install this package by typing:
772 neysx 1.1 </p>
773    
774     <pre caption="Installing syslinux">
775     # <i>emerge syslinux</i>
776     </pre>
777    
778     </body>
779     </section>
780     <section>
781 swift 1.3 <title>Setting up PXELINUX</title>
782 neysx 1.1 <body>
783    
784 swift 1.3 <note>
785     This isn't needed for Etherboot
786     </note>
787 neysx 1.1
788     <p>
789 cam 1.29 Before you start your tftp server you need to setup pxelinux. First copy the
790     pxelinux binary into your <path>/diskless</path> directory:
791 neysx 1.1 </p>
792    
793     <pre caption="Setting up the remote bootloader">
794 nightmorph 1.35 # <i>cp /usr/share/syslinux/pxelinux.0 /diskless</i>
795 neysx 1.1 # <i>mkdir /diskless/pxelinux.cfg</i>
796     # <i>touch /diskless/pxelinux.cfg/default</i>
797     </pre>
798    
799     <p>
800 cam 1.29 This will create a default bootloader configuration file. The binary
801     <path>pxelinux.0</path> will look in the <path>pxelinux.cfg</path> directory for
802     a file whose name is the client's IP address in hexadecimal. If it does not find
803     that file it will remove the rightmost digit from the file name and try again
804     until it runs out of digits. Versions 2.05 and later of syslinux first perform a
805     search for a file named after the MAC address. If no file is found, it starts
806     the previously mentioned discovery routine. If none is found, the
807 swift 1.11 <path>default</path> file is used.
808 neysx 1.1 </p>
809    
810     <pre caption="Files that PXE looks for in pxelinux.cfg/ in sequence">
811 swift 1.11 <comment>(Leading 01 means Ethernet, next bytes match our slave's MAC address)</comment>
812     01-00-40-63-c2-ca-c9
813    
814 neysx 1.1 <comment>(Assigned IP in hexadecimal)</comment>
815     C0A80115
816     C0A8011
817     C0A801
818     C0A80
819     C0A8
820     C0A
821     C0
822     C
823 swift 1.11
824 neysx 1.1 default
825     </pre>
826    
827 swift 1.3 <note>
828     These are all in lowercase.
829     </note>
830    
831 neysx 1.1 <p>
832     Let's start with the <path>default</path> file:
833     </p>
834    
835     <pre caption="Sample pxelinux.cfg/default">
836 swift 1.14 DEFAULT /bzImage
837 neysx 1.1 APPEND ip=dhcp root=/dev/nfs nfsroot=192.168.1.1:/diskless/192.168.1.21
838     </pre>
839    
840     <p>
841     The <c>DEFAULT</c> tag directs pxelinux to the kernel bzImage that we compiled
842     earlier. The <c>APPEND</c> tag appends kernel initialisation options. Since we
843     compiled the slave kernel with <c>NFS_ROOT_SUPPORT</c>, we will specify the
844     nfsroot here. The first IP is the master's IP and the second IP is the
845     directory that was created in <path>/diskless</path> to store the slave's
846 cam 1.29 initial filesystem.
847 neysx 1.1 </p>
848    
849     </body>
850     </section>
851 swift 1.3
852 neysx 1.1 <section>
853 swift 1.3 <title>About Etherboot</title>
854 neysx 1.1 <body>
855    
856 swift 1.3 <note>
857     This isn't required if you are using PXE boot.
858     </note>
859    
860 neysx 1.1 <p>
861 cam 1.29 Etherboot boots network boot images from a TFTP server. As the PXE this is
862     equivalent to LILO or GRUB. The <c>mknbi</c> utility enables you to create
863 swift 1.3 different images using different options.
864 neysx 1.1 </p>
865    
866 swift 1.3 </body>
867     </section>
868     <section>
869     <title>Before you get started</title>
870     <body>
871 neysx 1.1
872     <p>
873 cam 1.29 You will need to get the <c>mknbi</c> (utility for making tagged kernel images
874     useful for netbooting) package to create your Etherboot images. This tool will
875     create a preconfigured kernel image from your original kernel. This contains the
876     boot options as shown further down.
877 neysx 1.1 </p>
878    
879 swift 1.3 <pre caption="Installing mknbi">
880     # <i>emerge mknbi</i>
881     </pre>
882    
883 neysx 1.1 </body>
884     </section>
885     <section>
886 swift 1.3 <title>Setting up Etherboot</title>
887 neysx 1.1 <body>
888    
889     <p>
890 cam 1.29 In this section we will create a simple etherboot image. As the dhcp server
891     gives out the clients root-path in the "option root-path" dhcp.conf, we do not
892     have to include this here. More details can be found in the mknbi manual.
893 neysx 1.1 </p>
894    
895 swift 1.3 <pre caption="mknbi manual">
896     # <i>man mknbi</i>
897 neysx 1.1 </pre>
898    
899     <p>
900 cam 1.29 Making the boot images. This will create a ELF bootable image capable of passing
901     dhcp and the rootpath to the kernel. Also forcing the kernel to browse the
902     network for a dhcp server.
903 neysx 1.1 </p>
904    
905 swift 1.3 <pre caption="making netboot images">
906     # <i>mkelf-linux -ip=dhcp /diskless/bzImage &gt; /diskless/vmlinuz </i>
907 neysx 1.1 </pre>
908    
909 swift 1.3 <note>
910 cam 1.29 For the arch specific images you have to type <c>bzImage_arch</c> and
911 swift 1.6 <c>vmlinuz_arch</c>.
912 swift 1.3 </note>
913    
914 neysx 1.1 </body>
915     </section>
916     <section>
917     <title>Troubleshooting the network boot process</title>
918     <body>
919    
920     <p>
921     There are a few things you can do to debug the network boot process. Primarily
922     you can use a tool called <c>tcpdump</c>. To install <c>tcpdump</c> type:
923     </p>
924    
925     <pre caption="Installing tcpdump">
926     # <i>emerge tcpdump</i>
927     </pre>
928    
929     <p>
930 cam 1.29 Now you can listen to various network traffic and make sure your client/server
931     interactions are functioning. If something isn't working there are a few things
932     you might want to check. First make sure that the client/server is physically
933     connected properly and that the networking cables are not damaged. If your
934     client/server is not receiving requests on a particular port make sure that
935     there is no firewall interference. To listen to interaction between two
936 neysx 1.1 computers type:
937     </p>
938    
939     <pre caption="Listening to client and server interaction via tcpdump">
940     # <i>tcpdump host </i><comment>client_ip</comment><i> and </i><comment>server_ip</comment>
941     </pre>
942    
943     <p>
944 cam 1.29 You can also use <c>tcpdump</c> to listen on particular port such as the tftp
945 neysx 1.1 port by typing:
946     </p>
947    
948     <pre caption="Listening to the tftp server">
949     # <i>tcpdump port 69</i>
950     </pre>
951    
952     <p>
953 cam 1.29 A common error you might receive is: "PXE-E32: TFTP open time-out". This is
954     probably due to firewall issues. If you are using <c>TCPwrappers</c>, you might
955     want to check <path>/etc/hosts.allow</path> and <path>etc/hosts.deny</path> and
956     make sure that they are configured properly. The client should be allowed to
957     connect to the server.
958 neysx 1.1 </p>
959    
960     </body>
961     </section>
962     </chapter>
963    
964     <chapter>
965     <title>Configuring the NFS server</title>
966     <section>
967     <title>About the NFS server</title>
968     <body>
969    
970     <p>
971 cam 1.29 NFS stands for Network File System. The NFS server will be used to serve
972     directories to the slave. This part can be somewhat personalized later, but
973 neysx 1.1 right now all we want is a preliminary slave node to boot diskless.
974     </p>
975    
976     </body>
977     </section>
978     <section>
979     <title>About Portmapper</title>
980     <body>
981    
982     <p>
983 cam 1.29 Various client/server services do not listen on a particular port, but instead
984     rely on RPCs (Remote Procedure Calls). When the service is initialised it
985     listens on a random port and then registers this port with the Portmapper
986     utility. NFS relies on RPCs and thus requires Portmapper to be running before
987     it is started.
988 neysx 1.1 </p>
989    
990     </body>
991     </section>
992     <section>
993     <title>Before you start</title>
994     <body>
995    
996     <p>
997 cam 1.29 The NFS Server needs kernel level support so if you don't have this you should
998     recompile your master's kernel. To double check your master's kernel
999 neysx 1.1 configuration type:
1000     </p>
1001    
1002     <pre caption="Checking for NFS specific options">
1003     # <i>grep NFS /usr/src/linux/.config_master</i>
1004     </pre>
1005    
1006     <p>
1007 cam 1.29 You should see output that looks something like this if your kernel has been
1008 neysx 1.1 properly configured:
1009     </p>
1010    
1011     <pre caption="Proper NFS specific options in the master's kernel configuration">
1012 swift 1.12 CONFIG_PACKET=y
1013     # CONFIG_PACKET_MMAP is not set
1014     # CONFIG_NETFILTER is not set
1015     CONFIG_NFS_FS=y
1016     CONFIG_NFS_V3=y
1017     # CONFIG_NFS_V4 is not set
1018     # CONFIG_NFS_DIRECTIO is not set
1019 neysx 1.1 CONFIG_NFSD=y
1020     CONFIG_NFSD_V3=y
1021 swift 1.12 # CONFIG_NFSD_V4 is not set
1022 neysx 1.1 # CONFIG_NFSD_TCP is not set
1023     </pre>
1024    
1025     </body>
1026     </section>
1027     <section>
1028     <title>Installing the NFS server</title>
1029     <body>
1030    
1031     <p>
1032     The NFS package that can be acquired through portage by typing:
1033     </p>
1034    
1035     <pre caption="Installing nfs-utils">
1036     # <i>emerge nfs-utils</i>
1037     </pre>
1038    
1039     <p>
1040 cam 1.29 This package will emerge a portmapping utility, nfs server, and nfs client
1041 neysx 1.1 utilities and will automatically handle initialisation dependencies.
1042     </p>
1043    
1044     </body>
1045     </section>
1046     <section>
1047     <title>Configuring the NFS server</title>
1048     <body>
1049    
1050     <p>
1051     There are three major configuration files you will have to edit:
1052     </p>
1053    
1054     <pre caption="Nfs configuration files">
1055     /etc/exports
1056     /diskless/192.168.1.21/etc/fstab
1057     /etc/conf.d/nfs
1058     </pre>
1059    
1060     <p>
1061 cam 1.29 The <path>/etc/exports</path> file specifies how, to who and what to export
1062     through NFS. The slave's fstab will be altered so that it can mount the NFS
1063 neysx 1.1 filesystems that the master is exporting.
1064     </p>
1065    
1066     <p>
1067 cam 1.29 A typical <path>/etc/exports</path> for the master should look something like
1068 neysx 1.1 this:
1069     </p>
1070    
1071     <pre caption="Sample master /etc/exports">
1072     <comment># one line like this for each slave</comment>
1073 swift 1.3 /diskless/192.168.1.21 192.168.1.21(sync,rw,no_root_squash,no_all_squash)
1074 neysx 1.1 <comment># common to all slaves</comment>
1075 swift 1.3 /opt 192.168.1.0/24(sync,ro,no_root_squash,no_all_squash)
1076     /usr 192.168.1.0/24(sync,ro,no_root_squash,no_all_squash)
1077     /home 192.168.1.0/24(sync,rw,no_root_squash,no_all_squash)
1078 neysx 1.1 <comment># if you want to have a shared log</comment>
1079 swift 1.3 /var/log 192.168.1.21(sync,rw,no_root_squash,no_all_squash)
1080 neysx 1.1 </pre>
1081    
1082     <p>
1083 cam 1.29 The first field indicates the directory to be exported and the next field
1084 neysx 1.1 indicates to who and how. This field can be divided in two parts: who should be
1085 cam 1.29 allowed to mount that particular directory, and what the mounting client can do
1086     to the filesystem: <c>ro</c> for read only, <c>rw</c> for read/write;
1087     <c>no_root_squash</c> and <c>no_all_squash</c> are important for diskless
1088     clients that are writing to the disk, so that they don't get "squashed" when
1089     making I/O requests. The slave's fstab file,
1090     <path>/diskless/192.168.1.21/etc/fstab</path>, should look like this:
1091 neysx 1.1 </p>
1092    
1093     <pre caption="Sample slave fstab">
1094     <comment># these entries are essential</comment>
1095 swift 1.3 master:/diskless/192.168.1.21 / nfs sync,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 0
1096     master:/opt /opt nfs sync,hard,intr,ro,nolock,rsize=8192,wsize=8192 0 0
1097     master:/usr /usr nfs sync,hard,intr,ro,nolock,rsize=8192,wsize=8192 0 0
1098     master:/home /home nfs sync,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 0
1099 neysx 1.1 none /proc proc defaults 0 0
1100     <comment># useful but superfluous</comment>
1101     master:/var/log /var/log nfs hard,intr,rw 0 0
1102     </pre>
1103    
1104     <p>
1105     In this example, <e>master</e> is just the hostname of the master but it could
1106     easily be the IP of the master. The first field indicates the directory to be
1107     mounted and the second field indicates where. The third field describes the
1108     filesystem and should be NFS for any NFS mounted directory. The fourth field
1109     indicates various options that will be used in the mounting process (see
1110 cam 1.29 mount(1) for info on mount options). Some people have had difficulties with
1111 neysx 1.1 soft mount points so we made them all hard, but you should look into various
1112 cam 1.29 <path>/etc/fstab</path> options to make your cluster more efficient.
1113 neysx 1.1 </p>
1114    
1115     <p>
1116 cam 1.29 The last file you should edit is <path>/etc/conf.d/nfs</path> which describes a
1117     few options for nfs when it is initialised and looks like this:
1118 neysx 1.1 </p>
1119    
1120     <pre caption="Sample master /etc/conf.d/nfs">
1121     # Config file for /etc/init.d/nfs
1122    
1123     # Number of servers to be started up by default
1124     RPCNFSDCOUNT=8
1125    
1126     # Options to pass to rpc.mountd
1127     RPCMOUNTDOPTS=""
1128     </pre>
1129    
1130     <p>
1131     You should change <c>RPCNFSDCOUNT</c> to the number of diskless nodes on the
1132     network.
1133     </p>
1134    
1135     </body>
1136     </section>
1137     <section>
1138     <title>Starting the NFS server</title>
1139     <body>
1140    
1141     <p>
1142 cam 1.29 You should start the nfs server with its init script located in
1143 neysx 1.1 <path>/etc/init.d</path> by typing:
1144     </p>
1145    
1146     <pre caption="Starting the master's nfs server">
1147     # <i>/etc/init.d/nfs start</i>
1148     </pre>
1149    
1150     <p>
1151     If you want to this script to start when the system boots simply type:
1152     </p>
1153    
1154     <pre caption="Adding the nfs server to the master's default run level">
1155     # <i>rc-update add nfs default</i>
1156     </pre>
1157    
1158     </body>
1159     </section>
1160     </chapter>
1161    
1162     <chapter>
1163     <title>Completing the slave filesystem</title>
1164     <section>
1165     <title>Copy the missing files</title>
1166     <body>
1167    
1168     <p>
1169 cam 1.29 We will now make the slave's file system in sync with the master's and provide
1170 neysx 1.1 the necessary binaries while still preserving slave specific files.
1171     </p>
1172    
1173     <pre caption="Creating a slave filesystem">
1174 swift 1.7 # <i>rsync -avz /bin /diskless/192.168.1.21</i>
1175     # <i>rsync -avz /sbin /diskless/192.168.1.21</i>
1176     # <i>rsync -avz /lib /diskless/192.168.1.21</i>
1177 neysx 1.1 </pre>
1178    
1179 swift 1.3 <note>
1180 cam 1.29 The reason for rsync -avz instead of cp is to maintain symlinks and permissions.
1181 swift 1.3 </note>
1182    
1183 neysx 1.1 </body>
1184     </section>
1185     <section>
1186 nightmorph 1.34 <title>Configure diskless networking</title>
1187     <body>
1188    
1189     <p>
1190     In order to prevent the networking initscript from killing the connection to
1191     your NFS server, you will need to add an option to <path>/etc/conf.d/net</path>
1192     on your diskless client's filesystem.
1193     </p>
1194    
1195     <pre caption="Editing /etc/conf.d/net">
1196     <comment>(Add this to the existing options for your diskless client's interface)</comment>
1197     config_eth0=( "noop" )
1198     </pre>
1199    
1200     <note>
1201 swift 1.37 For more information, please read
1202     <path>/usr/share/doc/openrc-*/net.example.bz2</path>.
1203 nightmorph 1.34 </note>
1204    
1205     </body>
1206     </section>
1207     <section>
1208 neysx 1.1 <title>Initialisation scripts</title>
1209     <body>
1210    
1211     <p>
1212     You need as many init scripts under
1213 jkt 1.21 <path>/diskless/192.168.1.21/etc/runlevels</path> as you need services on your
1214 neysx 1.1 diskless nodes. It all depends on what you want your slaves to do.
1215     </p>
1216    
1217     <warn>
1218 cam 1.29 Do not use the <c>rc-update</c> program to add or remove scripts from the slave
1219     runlevels when logged on your master. This would change your master runlevels.
1220     You need to create the links manually or log into your slave nodes using ssh or
1221     connect a screen and keyboard to your slave.
1222 neysx 1.1 </warn>
1223    
1224     <pre caption="Typical slave runlevels">
1225     /diskless/192.168.1.21/etc/runlevels/:
1226     total 16
1227     drwxr-xr-x 2 root root 4096 2003-11-09 15:27 boot
1228     drwxr-xr-x 2 root root 4096 2003-10-01 21:10 default
1229     drwxr-xr-x 2 root root 4096 2003-03-13 19:05 nonetwork
1230     drwxr-xr-x 2 root root 4096 2003-02-23 12:26 single
1231 cam 1.29
1232 neysx 1.1 /diskless/192.168.1.21/etc/runlevels/boot:
1233     total 0
1234     lrwxrwxrwx 1 root root 20 2003-10-18 17:28 bootmisc -> /etc/init.d/bootmisc
1235     lrwxrwxrwx 1 root root 19 2003-10-18 17:28 checkfs -> /etc/init.d/checkfs
1236     lrwxrwxrwx 1 root root 17 2003-10-18 17:28 clock -> /etc/init.d/clock
1237 nightmorph 1.24 lrwxrwxrwx 1 root root 22 2003-10-18 17:28 domainname -> /etc/init.d/domainname
1238 neysx 1.1 lrwxrwxrwx 1 root root 20 2003-10-18 17:28 hostname -> /etc/init.d/hostname
1239     lrwxrwxrwx 1 root root 22 2003-10-18 17:28 localmount -> /etc/init.d/localmount
1240 nightmorph 1.24 lrwxrwxrwx 1 root root 19 2003-10-18 17:28 modules -> /etc/init.d/modules
1241 neysx 1.1 lrwxrwxrwx 1 root root 18 2003-10-18 17:28 net.lo -> /etc/init.d/net.lo
1242     lrwxrwxrwx 1 root root 20 2003-10-18 17:28 netmount -> /etc/init.d/netmount
1243     lrwxrwxrwx 1 root root 21 2003-10-18 17:28 rmnologin -> /etc/init.d/rmnologin
1244     lrwxrwxrwx 1 root root 19 2003-10-18 17:28 urandom -> /etc/init.d/urandom
1245 cam 1.29
1246 neysx 1.1 /diskless/192.168.1.21/etc/runlevels/default:
1247     total 0
1248 nightmorph 1.27 lrwxrwxrwx 1 root root 23 2003-10-18 17:28 consolefont -> /etc/init.d/consolefont
1249 neysx 1.1 lrwxrwxrwx 1 root root 19 2003-10-18 17:28 distccd -> /etc/init.d/distccd
1250 nightmorph 1.27 lrwxrwxrwx 1 root root 19 2003-10-18 17:28 keymaps -> /etc/init.d/keymaps
1251 neysx 1.1 lrwxrwxrwx 1 root root 17 2003-10-18 17:28 local -> /etc/init.d/local
1252     lrwxrwxrwx 1 root root 16 2003-10-18 17:28 sshd -> /etc/init.d/sshd
1253 nightmorph 1.24 lrwxrwxrwx 1 root root 21 2003-10-18 17:28 syslog-ng -> /etc/init.d/syslog-ng
1254     lrwxrwxrwx 1 root root 17 2003-10-18 17:28 vixie-cron -> /etc/init.d/vixie-cron
1255 cam 1.29
1256 neysx 1.1 /diskless/192.168.1.21/etc/runlevels/nonetwork:
1257     total 0
1258     lrwxrwxrwx 1 root root 17 2003-10-18 17:28 local -> /etc/init.d/local
1259 cam 1.29
1260 neysx 1.1 /diskless/192.168.1.21/etc/runlevels/single:
1261     total 0
1262     </pre>
1263    
1264     <p>
1265     Now is a good time to boot your slave and cross your fingers. It works?
1266     Congratulations, you are now the proud owner of (a) diskless node(s) :)
1267     </p>
1268    
1269     </body>
1270     </section>
1271    
1272 cam 1.29 <!--
1273 neysx 1.1
1274     <section>
1275     <title>An alternative : ClusterNFS</title>
1276     <body>
1277    
1278     <warn>
1279     This is mentioned only because a reviewer of this document is using this
1280     solution. Be aware that Gentoo <e>does not</e> support ClusterNFS. It is not in
1281     portage and requires changes to a baselayout init script. <b>Use at your own
1282     risks</b>.
1283     </warn>
1284    
1285     <p>
1286     If you don't fancy having a distinct root for each slave because it needs some
1287 cam 1.29 maintenance when upgrading files from the master directories, you could share
1288 neysx 1.1 the same root across all nodes, master and slaves included. This means all your
1289     machines need to be compatible because you will have only one set of binaries.
1290     You also need to be aware that this might have security issues because all of
1291     your master root will be exported through NFS.
1292     </p>
1293    
1294     <p>
1295     If you still want to try out this alternative, visit the ClusterNFS <uri
1296     link="http://clusternfs.sourceforge.net/">home page</uri>, download the
1297     software and read the doc.
1298     </p>
1299    
1300     <p>
1301     To make it short, all files are shared and the files that need to be different
1302     between master and all slaves are copied to <path>file$$CLIENT$$</path>. When a
1303     slave requests <path>file</path>, ClusterNFS will notice the existence of
1304     <path>file$$CLIENT$$</path> and send it instead. Files that need to be
1305     different on each node are copied to <path>file$$IP=192.168.1.21$$</path>.
1306     The same applies to directories.
1307     </p>
1308    
1309     <p>
1310 cam 1.29 Very shortly, this is what differs from the installation procedure described
1311 neysx 1.1 above:
1312     </p>
1313    
1314     <ul>
1315     <li>You do not need NFS server support in your master kernel</li>
1316     <li>Install ClusterNFS <e>after</e> you emerge nfs-utils</li>
1317     <li>Make slave copies of files and directories as described below</li>
1318     <li>Do not create a root dir for each node</li>
1319     <li>Export only / in your <path>/etc/exports</path> file</li>
1320     <li>
1321     Only mount / via NFS in the slave <path>/etc/fstab$$CLIENT$$</path> file
1322     </li>
1323     <li>Edit <path>/etc/init.d/nfs</path> as described below</li>
1324     <li>
1325     Edit <path>/etc/conf.d/local.start$$CLIENT$$</path> as described below
1326     </li>
1327     </ul>
1328    
1329     <pre caption="Files that need to be different between master and slaves">
1330     /etc/conf.d/local.start$$CLIENT$$
1331     /etc/conf.d/local.stop$$CLIENT$$<comment> (Probably empty)</comment>
1332     /etc/crontab$$CLIENT$$<comment> (Probably empty, master takes care of chores)</comment>
1333     /etc/exports$$CLIENT$$<comment> (Empty, slaves do not export NFS mounts)</comment>
1334     /etc/fstab$$CLIENT$$
1335     /etc/hostname$$IP=192.168.1.21$$<comment> (Name your slaves)</comment>
1336     /etc/mtab$$IP=192.168.1.21$$
1337     /etc/runlevels$$CLIENT$$<comment> (Clean separation between master and slave boot scripts)</comment>
1338     /tmp$$IP=192.168.1.21$$
1339     /var$$IP=192.168.1.21$$<comment> (Create subdirs as in /var)</comment>
1340     </pre>
1341    
1342     <pre caption="Editing /etc/init.d/nfs">
1343     ebegin "Starting NFS daemon"
1344     start-stop-daemon - -start - -quiet - -exec \
1345     <comment># Add - -translate-names option</comment>
1346     $nfsd - - - -translate-names
1347     eend $? "Error starting NFS daemon"
1348     # Check if we support NFSv3
1349     ebegin "Starting NFS mountd"
1350     <comment># Comment the following two lines (ClusterNFS only knows NFS v2)</comment>
1351     # rpcinfo -u localhost nfs 3 &amp;&gt;/dev/null || \
1352     # RPCMOUNTDOPTS="$RPCMOUNTDOPTS - -no-nfs-version 3"
1353     start-stop-daemon - -start - -quiet - -exec \
1354     $mountd - - $RPCMOUNTDOPTS 1&gt;&amp;2
1355     eend $? "Error starting NFS mountd"
1356     </pre>
1357    
1358     </body>
1359     </section>
1360     -->
1361 cam 1.29
1362 neysx 1.1 </chapter>
1363     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20