歡迎您光臨本站 註冊首頁

linux下利用LTSP實現無盤終端伺服器系統

←手機掃碼閱讀     火星人 @ 2014-03-29 , reply:0

基於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.com
DHCP 配置:在我看來這是最複雜的步驟,你需要建立有效的 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: 0KDM:在 /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

[火星人 ] linux下利用LTSP實現無盤終端伺服器系統已經有786次圍觀

http://coctec.com/docs/linux/show-post-203759.html