歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> 實戰:架設Linux無盤工作站

實戰:架設Linux無盤工作站

日期:2017/2/27 9:28:57   编辑:更多Linux
  作者:Linux_tao   客戶端是支持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




Copyright © Linux教程網 All Rights Reserved