Linux无盘工作站架设实例

所属分类: 操作系统 / unix linux 阅读数: 97
收藏 0 赞 0 分享

摘要 
架设Linux无盘工作站实例,服务器和客户端都使用Linux。主要涉及:DHCP TFTP SYSLINUX NFS(2003-03-12 08:52:24) 

-------------------------------------------------------------------------------------- 


客户端是支持PXE方式启动的刀片,用Linux作为服务器,服务器配置如下: 


1) 安装DHCP服务器dhcpd 


2) 配置/etc/dhcpd.conf文件,下面是我机器上的文件 


max-lease-time -1; 
default-lease-time -1; #注:IP地址永不过期 
option subnet-mask 255.0.0.0; 
option routers 10.0.0.1; 
option domain-name-servers 10.10.10.10; 
# option netbios-name-servers 10.10.10.10; 
option broadcast-address 10.255.255.255; 
# option dhcp-class-identifier "PXEClient"; 
# option vendor-encapsulated-options 01:04:00:00:00:00:ff; 
# option option-135 "start"; 

subnet 10.0.0.0 netmask 255.0.0.0 { 
range 10.10.12.131 10.10.12.150; 

host blade01 { 
hardware ethernet 00:e0:43:00:02:00; 
fixed-address 10.10.12.131; 
filename "/tftpboot/pxelinux.0"; #注:启动映象文件 


host blade02 { 
hardware ethernet 00:e0:43:00:02:02; 
fixed-address 10.10.12.132; 
filename "/tftpboot/pxelinux.0"; 


host blade03 { 
hardware ethernet 00:e0:43:00:02:04; 
fixed-address 10.10.12.133; 
filename "/tftpboot/pxelinux.0"; 


host blade04 { 
hardware ethernet 00:e0:43:00:02:06; 
fixed-address 10.10.12.134; 
filename "/tftpboot/pxelinux.0"; 


host blade05 { 
hardware ethernet 00:e0:43:00:02:08; 
fixed-address 10.10.12.135; 
filename "/tftpboot/pxelinux.0"; 




说明:dhcp客户得到IP地址后用TFTP协议从服务器上下载启动映象文件。我用syslinux 

工具包里边的pxelinux来作为远程启动的loder. 

3) 配置tftp server 

使用pxelinux作引导工具需要支持TSIZE参数的tftp server。可从http://www.kernel.org/pub/software/network/tftp/下载。 

通过xinetd来使用tftp服务,我的/etc/xinetd.conf文件如下 


...... 
service tftp 

socket_type = dgram 
protocol = udp 
wait = yes 
user = root 
server = /usr/sbin/in.tftpd 



4) 配置PXELINUX 

先安装syslinux软件包。可从http://www.kernel.org/pub/linux/utils/boot/syslinux/下载。 

将pxelinux.0拷贝到/tftpboot/目录下,然后建立/tftpboot/syslinux.cfg/目录。该目录下存放配置文件。 

pxelinux使用ip地址的十六进制表示来作为该ip地址的配置文件的文件名。如blade01的 

ip地址为10.10.12.131,配置文件名为0A0A0C83,内容为: 


default linux 

label linux 
kernel vmlinuz 
append ip=dhcp root=/dev/nfsroot nfsroot=10.10.11.120:/remote/blade01 vga=normal 


5) 配置nfs 

为每个刀片建立一个根目录,在该刀片的pxelinux配置文件里指定了从这个nfs export的目录启动。 

该根目录里应把标准的目录都建好,另外需要重新mount的usr, home, public等目录也要export。 

我的 /etc/exports文件: 


# /etc/exports: the access control list for filesystems which may be exported 
# to NFS clients. See exports(5). 

/remote/blade01 blade01(rw,async,no_root_squash) 
/remote/blade02 blade02(rw,async,no_root_squash) 
/remote/blade03 blade03(rw,async,no_root_squash) 
/remote/blade04 blade04(rw,async,no_root_squash) 
/remote/blade05 blade05(rw,async,no_root_squash) 
/remote/root *(rw,async,no_root_squash) 
/remote/home *(rw,async,no_root_squash) 
/usr *(ro,async,no_root_squash) 
/sbin *(ro,async,no_root_squash) 
/bin *(ro,async,no_root_squash) 
/lib *(ro,async,no_root_squash) 
/home *(ro,async,no_root_squash) 


6)为每个刀片修改它的/etc/fstab文件,以blade01为例,它的nfs root是/remote/blade01 
/remote/blade01/etc/fstab文件如下: 
# /etc/fstab: static file system information. 


10.10.11.120:/remote/blade01 / nfs defaults,intr 0 1 
10.10.11.120:/remote/root /root nfs defaults,intr 0 1 
10.10.11.120:/remote/home /home nfs defaults,intr 0 1 
10.10.11.120:/bin /bin nfs defaults,intr 0 1 
10.10.11.120:/usr /usr nfs defaults,intr 0 1 
10.10.11.120:/sbin /sbin nfs defaults,intr 0 1 
10.10.11.120:/lib /lib nfs defaults,intr 0 1 
none /proc proc defaults,intr 0 1 


同时还要为每个刀片修改它的网络配置文件,配置ip地址,启动两块网卡等等。。 

7) 编译内核 

刀片用的内核,应该支持Kernel Level Auto Configuration的DHCP协议,支持NFS,支持NFS ROOT, 

假设编译好的内核为vmlinuz,将它拷贝到/tftpboot/目录下。 

参考文档: 

http://syslinux.zytor.com/pxe.php 
http://syslinux.zytor.com/faq.php 
http://www.cn-cio.org/xx/show.php?article_id=1680 
http://www-900.ibm.com/developerWorks/cn/linux/l-tip-prompt/l-pex/index.shtml 
更多精彩内容其他人还在看

教你隐藏Linux的命令行历史

有的时候你可能不想让一些命令记录你的的命令行历史中,本文整理了多种方法让你可以参考。
收藏 0 赞 0 分享

怎样在Linux上录制你的终端操作及回放

在这次的文章中,我们将简单的了解一下如何在Linux上录制和回放终端会话及以gif格式记录的方法。
收藏 0 赞 0 分享

SUSE Linux登录出现黑屏解决方法

登录linux时出现黑屏的找到这篇解决SUSE的黑屏问题
收藏 0 赞 0 分享

个人学习Linux知识总结第1/4页

个人学习linux经常用到的小知识,方便大家以后查阅
收藏 0 赞 0 分享

Linux 下rename 命令的用法第1/2页

刚学习linux的时候,对文件重命名首先想到的就是rename命令,但是按照在windows下对文件重命名的方式试了N多次都没有反应,在网上一搜索,发现很多人都对rename命令知之甚少,甚至有一部分人说linux下没有rename命令,建议大家用mv命令。鉴于此,于是man r
收藏 0 赞 0 分享

Centos 源

Centos操作说明
收藏 0 赞 0 分享

linux备份文件命令收集

收集一些linux下实现文件备份
收藏 0 赞 0 分享

Linux rdesktop操作系统下远程登录Windows XP桌面

众所周知XP下有"远程桌面连接"用来远程登录桌面,设置也非常简单。那有没有什么办法在linux下远程登录到XP呢?有。用rdesktop这个linux下的软件就能实现。
收藏 0 赞 0 分享

Linux操作系统添加新硬盘方法

linux下添加硬盘的方法
收藏 0 赞 0 分享

CentOS 5.1 4.6最新官方下载地址列表

最近公司接触到centos系统,于是找了下,不太容易找到,所以我直接把官方的下载地址,给贴出来了,方便以后下载
收藏 0 赞 0 分享
查看更多