📄 small-lan.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Tracking for Multiple Machines</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="The Cutting Edge" href="cutting-edge.html" /><link rel="PREVIOUS" title="Rebuilding world" href="makeworld.html" /><link rel="NEXT" title="Network Communication" href="network-communication.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="makeworld.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 19 The Cutting Edge</td><td width="10%" align="right" valign="bottom"><a href="network-communication.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="SMALL-LAN" name="SMALL-LAN">19.5 Tracking for MultipleMachines</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Mike Meyer.</i> <p>If you have multiple machines that you want to track the same source tree, then havingall of them download sources and rebuild everything seems like a waste of resources: diskspace, network bandwidth, and CPU cycles. It is, and the solution is to have one machinedo most of the work, while the rest of the machines mount that work via NFS. This sectionoutlines a method of doing so.</p><div class="SECT2"><h2 class="SECT2"><a id="SMALL-LAN-PRELIMINARIES" name="SMALL-LAN-PRELIMINARIES">19.5.1Preliminaries</a></h2><p>First, identify a set of machines that is going to run the same set of binaries, whichwe will call a <span class="emphasis"><i class="EMPHASIS">build set</i></span>. Eachmachine can have a custom kernel, but they will be running the same userland binaries.From that set, choose a machine to be the <span class="emphasis"><iclass="EMPHASIS">build machine</i></span>. It is going to be the machine that the worldand kernel are built on. Ideally, it should be a fast machine that has sufficient spareCPU to run <tt class="COMMAND">make buildworld</tt> and <tt class="COMMAND">makebuildkernel</tt>. You will also want to choose a machine to be the <spanclass="emphasis"><i class="EMPHASIS">test machine</i></span>, which will test softwareupdates before they are put into production. This <span class="emphasis"><iclass="EMPHASIS">must</i></span> be a machine that you can afford to have down for anextended period of time. It can be the build machine, but need not be.</p><p>All the machines in this build set need to mount <tt class="FILENAME">/usr/obj</tt>and <tt class="FILENAME">/usr/src</tt> from the same machine, and at the same point.Ideally, those are on two different drives on the build machine, but they can be NFSmounted on that machine as well. If you have multiple build sets, <ttclass="FILENAME">/usr/src</tt> should be on one build machine, and NFS mounted on therest.</p><p>Finally make sure that <tt class="FILENAME">/etc/make.conf</tt> on all the machines inthe build set agrees with the build machine. That means that the build machine must buildall the parts of the base system that any machine in the build set is going to install.Also, each build machine should have its kernel name set with <ttclass="MAKEVAR">KERNCONF</tt> in <tt class="FILENAME">/etc/make.conf</tt>, and the buildmachine should list them all in <tt class="MAKEVAR">KERNCONF</tt>, listing its own kernelfirst. The build machine must have the kernel configuration files for each machine in <ttclass="FILENAME">/usr/src/sys/<var class="REPLACEABLE">arch</var>/conf</tt> if it isgoing to build their kernels.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN28357" name="AEN28357">19.5.2 The Base System</a></h2><p>Now that all that is done, you are ready to build everything. Build the kernel andworld as described in <a href="makeworld.html#MAKE-BUILDWORLD">Section 19.4.7.2</a> onthe build machine, but do not install anything. After the build has finished, go to thetest machine, and install the kernel you just built. If this machine mounts <ttclass="FILENAME">/usr/src</tt> and <tt class="FILENAME">/usr/obj</tt> via NFS, when youreboot to single user you will need to enable the network and mount them. The easiest wayto do this is to boot to multi-user, then run <tt class="COMMAND">shutdown now</tt> to goto single user mode. Once there, you can install the new kernel and world and run <ttclass="COMMAND">mergemaster</tt> just as you normally would. When done, reboot to returnto normal multi-user operations for this machine.</p><p>After you are certain that everything on the test machine is working properly, use thesame procedure to install the new software on each of the other machines in the buildset.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN28366" name="AEN28366">19.5.3 Ports</a></h2><p>The same ideas can be used for the ports tree. The first critical step is mounting <ttclass="FILENAME">/usr/ports</tt> from the same machine to all the machines in the buildset. You can then set up <tt class="FILENAME">/etc/make.conf</tt> properly to sharedistfiles. You should set <tt class="MAKEVAR">DISTDIR</tt> to a common shared directorythat is writable by whichever user <tt class="USERNAME">root</tt> is mapped to by yourNFS mounts. Each machine should set <tt class="MAKEVAR">WRKDIRPREFIX</tt> to a localbuild directory. Finally, if you are going to be building and distributing packages, youshould set <tt class="MAKEVAR">PACKAGES</tt> to a directory similar to <ttclass="MAKEVAR">DISTDIR</tt>.</p></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="makeworld.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="network-communication.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Rebuilding ``world''</td><td width="34%" align="center" valign="top"><a href="cutting-edge.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Network Communication</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -