免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 900 | 回复: 0
打印 上一主题 下一主题

linux下利用LTSP实现无盘终端服务器系统 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-03 20:21 |只看该作者 |倒序浏览

著名的Linux终端服务器项目LTSP(Linux Terminal Server Project)linux K12LTSP无盘系统
http://wiki.ascentsci.com

    基于Red Hat Linux及LTSP终端服务器软件包(见http: //www.ltsp.org),它易于安装和配置。K12LTSP遵循GNU通用公共许可证发布,这意味着它是免费的并且基于开源软件。一旦安装好, K12LTSP可以让你从一台应用服务器引导多台无盘工作站,而这些无盘客户可以用老旧的PC机充当,或者以非常低的价钱购买到。所有的应用程序都是在终端服务器上运行的,相比之下那些工作站就显得很“微薄”,在它们上面不存在软件及硬盘驱动器。这些微薄的客户机对学校而言是极其适合的,因为装配它们非常容易,并且几乎不需要维护。它们非常可靠,并且不会受恶意破坏或者是计算机病毒的影响。
    使用K12 LTSP 4.2(Fedore Core 4),从
http://k12ltsp.org/download.html
下载完整的4个iso文件,在一个旧的硬盘上安装,只需要在安装过程中设置名称server,网卡设置ip就ok了,很是方便,只不过里面的软件都是美国小朋友用的。
    ltsp-4.2u2-0版的安装光盘(ISO)文件可以到
http://ltsp.mirror.com/
下载,LTSP4.2版使用的安装管理程序ltsp-utils_0.25提供了deb、rpm和tgz三种格式的安装包。  
    如只用LTSP 4.2,也可到
http://wiki.ltsp.org/twiki/bin/view/Ltsp/LTSP-42
下载ltsp-4.2u2-0.iso文件,按以下说明安装。
                      Installing from the LTSP_4.2u2 ISO image
   You MUST install a new version of the ltsp-utils package. At least version 0.20 of the ltsp-utils package (containing version 0.15 of ltspadmin) is required.
LTSP-4.2 must be installed to a new directory. You cannot do an in-place upgrade. But this is actually a great way to do it. You can install LTSP-4.2 into a new subdir, such as /opt/ltsp-4.2, and then update the filename and root-path entries in dhcpd.conf to point to the new LTSP tree. This is a great way to test it, because you can change those dhcpd.conf entries for individual workstations very easily. Meanwhile, your other workstations will continue to function using the older version of LTSP.
To install LTSP-4.2, following these instructions:
Download and install the latest ltsp-utils package(ltsp-utils was updated to version 0.25 on April 17th, 2006)
China Mirror
Debian - Download official deb
Debian - Download deb
Ubuntu - Download deb
Redhat/Fedora - Download RPM
Slackware - Download TGZ (contributed by martijn at inlv dot org)
Others - Download TGZ
As root, run ltspadmin.
If you have a previous version LTSP already installed, it is recommended that you install the ltsp-4.2 packages into a separate directory, such as: /opt/ltsp-4.2. You can configure this with the ltspadmin utility.
Install ALL of the packages
Choose the 'Configure LTSP' menu item, which will cause it to run the ltspcfg utility. Use this utility to setup the services.
Installing from the LTSP_4.2u2 ISO image
An ISO image of the LTSP-4.2u2 packages has been created for those who want to download a single file, and install it on multiple servers, without requiring additional downloads.
Installing LTSP from the ISO image:
1. Download the ISO image from the ISO download page China Mirror ltsp-4.2u2-0.iso 06-Jul-2006 21:34 100MB. Save it on your system. For this example, we'll put it in /tmp.Download md5sum
2. Make sure you are either logged in as root, or you've switched to super user using su - (Notice the '-', it's important) #下载ISO文件到一个目录下
3. Run md5sum on the downloaded file, and make sure the result matches the number in the .md5sum file that accompanies the ISO image.
md5sum  #检验MD5真实性
4. Mount the ISO image, using the loopback device:
mount -o loop /tmp/ltsp-4.2u2-0.iso /mnt #在linux下将下载的ISO文件挂载到一个目录
5. Install the ltsp-utils package. It's included in the ISO image.
If your system is RPM based (Redhat, Suse,Mandriva...) you can install the ltsp-utils RPM package:
cd /mnt/ltsp-utils  #打开ltsp-utils的安装目录
rpm -ivh ltsp-utils-0.25-0.noarch.rpm  #安装ltsp的RPM包
Or, if you've got a Debian based system, you can install the .deb package:
cd /mnt/ltsp-utils
dpkg -i ltsp-utils_0.25_all.deb #或安装ltsp的DEB包
Or, if your system doesn't support either the RPM or the DEB package, you can install teh TGZ package:
cd /mnt/ltsp-utils
cp ltsp-utils-0.25-0.tgz /tmp
cd /tmp
tar xvzf ltsp-utils-0.25-0.tgz
cd ltsp-utils
./install.sh   #或解压TGZ安装ltsp
6. Run *ltspadmin as root.  #执行ltspadmin命令
7. From the main menu in ltspadmin, choose:
Configure the installer options   #选择配置选项菜单(第二选项)
8. Specify the pathname to the files:
file:///mnt
    #输入此
file:///mnt
,回车
Notice that the value MUST be in the form of a URL, and also, notice that there are 3 slashes '///'. The first 2 slashes are part of the URL specification ("file://"), the 3rd slash is for the root directory on your server.
9. Leave the remaining options as is.
10. If you have a previous version of LTSP (Pre-LTSP-4.2) already installed, it is recommended that you install the LTSP-4.2u2 packages into a separate directory, such as /opt/ltsp-4.2. You can configure this with the ltspadmin utility.
11. Install ALL of the packages.  #安装所有包(第一选项)
12. Choose the 'Configure LTSP' menu item, which will cause it to run the ltspcfg utility. Use this utility to setup the necessary services.  #配置ltsp(第三选项)
13. Unmount the ISO image from /mnt:
umount /mnt  #取消挂载
Please report any problems you have with this ISO iage to the ltsp-discuss mailing list, or contact me on the #ltsp IRC channel on irc.freenode.net.

需要以下服务:
  • XFree:叫作 X终端
  • DHCP: DHCP 是一个协议,用于自动配置使用 TCP/IP 的计算机,被 ltsp 用来为工作站分配 IP
  • NFS: NFS 是一个协议,允许通过网络访问硬盘,被 ltsp 用来为工作站加载基本系统
  • TFTP: TFTP 是一个简单文件传输协议,被 ltsp 用来向工作站传递内核
  • XINETD: Xinetd 是 inetd的强力代替,有更高级的特性,被 ltsp 用来启动 tftp
    NFS配置:编辑你的 /etc/exports 文件,以便允许工作站加载根文件系统。至少要有下面两行:
    #vi /etc/exports
    /opt/ltsp/i386             10.0.2.0/255.255.255.0(ro,no_root_squash,async)
    /var/opt/ltsp/swapfiles    10.0.2.0/255.255.255.0(rw,no_root_squash,async)
    注释: 你可以改变网络、掩码设置以适应你的网络。

    启动 nfs
    # rc-update add nfs default
    # /etc/init.d/nfs start
    xinetd/tftp配置 :缺省下 TFTP 不会启动,要改变这个,编辑 /etc/xinetd.d/tftp
    #vi /etc/xinetd.d/tftp #并把 disable=yes 替换为 disable=no. 然后启动 xinitd。
    启动 xinetd
    # rc-update add xinetd default
    # /etc/init.d/xinetd start
    DNS配置:为了使工作站接触所有的资源,必须要有正确的名字解析。有几种方法来达到这点。一种是为本地网络配置 DNS 服务器,另一种(更简单的)是在所有的系统上使用几乎相同的 /etc/hosts 文件。我们采取后一种方案。 所有的工作站必须列在 /etc/hosts 中。看看例子:
    #vi /etc/hosts
    127.0.0.1        localhost
    10.0.2.254    server      server.yourdomain.com
    10.0.2.1      ws-1        ws-1.yourdomain.comDHCP 配置:在我看来这是最复杂的步骤,你需要建立有效的 DHCP 配置(/etc/dhcp/dhcpd.conf)。这里是例子:
    #vi dhcpd.conf
    // 一般选项
    default-lease-time            21600;
    max-lease-time                21600;
    use-host-decl-names           on;
    ddns-update-style             ad-hoc;
    // Bootp 选项
    allow booting;
    allow bootp;
    // 网络选项
    option subnet-mask            255.255.255.0;
    option broadcast-address      10.0.2.255;
    option routers                10.0.2.202;
    option domain-name-servers    10.0.2.202;
    option log-servers            10.0.2.254;
    option domain-name            "yourdomain.com";
    // LTSP 路径选项
    option root-path              "10.0.2.202:/opt/ltsp/i386";
    filename                      "tftpboot/lts/vmlinuz-2.6.17.3-ltsp-1";
    // 如果你的工作站有 ISA 网卡,取消下面的行注释// 并且选择你的驱动和 IO
    #option option-128 code 128 = string;
    #option option-129 code 129 = text;
    #option option-128 e4:45:74:68:00:00;
    #option option-129 "NIC=ne IO=0x300";
    shared-network WORKSTATIONS {
      subnet 10.0.2.0 netmask 255.255.255.0 {
        // 分配给工作站的动态 IP
        range dynamic-bootp 10.0.2.100 10.0.2.200;
        // 工作站特定的 PXE 引导配置
        #host ws001 {
        #  hardware ethernet     00:E0:06:E8:00:84;
        #  fixed-address         10.0.2.1;
        #}
      }
    }
           如果你的工作站支持 PXE,你应当列出她们中的每一个,像我在 host ws001 中所作的(别忘了取消注释)。不要给它们在动态范围中的地址,否则可能会有工作站有相同的IP (将是有问题的)。        需要关于本项目的更多文档,请阅读 dhcp 官方手册:
    http://www.dhcp-handbook.com/
           现在启动 DHCP ,就像你在 NFS 和 xinetd 中一样:
    启动 dhcp
    # rc-update add dhcp default
    # /etc/init.d/dhcp start
    注释: DHCPD 需要 CONFIG_PACKET 和 CONFIG_FILTER 在内核中激活才能工作。
    LTSP 配置 :有很多选项来配置你的工作站,查看
    http://www.ltsp.org/documentation/ltsp-3.0-4-en.html#AEN903
    来得到 /opt/ltsp/i386/etc/lts.conf 的完整描述。
    显示管理器 现在你要改变你的显示管理器配置,使之接受远程连接。 首先修改你的 Xaccess 文件,去掉下一行的注释:
    #vi /etc/Xaccess
    #any host can get a login window
    现在修改你所使用的显示管理器配置:
    XDM:在 /etc/X11/xdm/xdm-config 注释掉 DisplayManager.requestPort: 0
    KDM:在 /usr/kde/3.1/share/config/kdm/kdmrc 找到 [Xdmcp] 部分并把 Enable = false 改为 Enable = true。
    GDM:在 /etc/X11/gdm/gdm.conf 找到 [Xdmcp] 部分并把 Enable = false 改为 Enable = true。
    然后启动显示管理器:
    启动 xdm
    # rc-update add xdm default
    # /etc/init.d/xdm start
    警告: 好像 XDM 和 GDM有些问题。作者使用 KDM 来解决这些问题。
    创建引导软盘
    如果你的工作站不支持PXE引导,你必须创建一个引导软盘,在启动你的工作站时需要的。到
    http://www.rom-o-matic.net/5.0.9/
    ,选择你的 NIC(网卡),按下 Get ROM 并把镜像写到软盘中:
    写软盘镜像
    # cat nicfile.lzdsk > /dev/fd0以下为自动配置文件:
    /etc/dhcpd.conf 会自动生成一个/etc/dhcpd.conf.sample文件,将下面一行的your_domain.org改正为我真实的domain-name=server. 并拷贝为/etc/dhcpd.conf 。
    option domain-name "your_domain.org"; # You really should fix
    option domain-name "server"; # You really should fix this
    其他就用自动生成的配置文件即可。
    /etc/hosts
    /etc/hosts.allow
    /etc/exports
    /opt/ltsp/i386/etc/lts.conf


    总的感觉速度是比较快的,一个老掉牙PII,只要几秒就进入X window,打开
    openoffice速度和P4服务器差不多,真厉害,使老旧的电脑枯木逢春。实在是中小学电脑教室改造的首选。
    因为先装了DRBL,所以要开启LTSP必须做以下几步:
    # /opt/drbl/sbin/drbl-all-service stop 先停止drbl,它同时停止以下服务:
    Stopping xinetd: [ OK ]
    Stopping portmap: [ OK ]
    Flushing firewall rules: [ OK ]
    Setting chains to policy ACCEPT: filter nat [ OK ]
    Stopping YP server services: [ OK ]
    Shutting down NIS services: [ OK ]
    Stopping YP passwd service: [ OK ]
    Stopping YP map server: [ OK ]
    Shutting down NFS mountd: [ OK ]
    Shutting down NFS daemon: [FAILED]
    Shutting down NFS quotas: [ OK ]
    Shutting down NFS services: [ OK ]
    Stopping NFS locking: [ OK ]
    Stopping NFS statd: [ OK ]
    Shutting down ntpd: [ OK ]
    所以要重启以下服务:
    # dhcpd 开启dhcp
    # /etc/rc.d/init.d/portmap start 开启portmap nfs
    # service xinetd restart 重启 httpd tftp
    CHINA LTSP中文首页:
    http://www.ltsp.org.cn/
    使用手册:
    http://www.ltsp.org/documentation/ltsp-4.1/ltsp-4.1-en.html

    关于LTSP4.2版的详细信息请参见:
    http://wiki.ltsp.org/twiki/bin/view/Ltsp/WebHome


    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/25765/showart_195019.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP