无盘多系统引导服务器配置
2012-07-12 13:08
211 查看
无盘多系统引导实战及维护
拓扑:
二、搭建无盘服务器:
1)安装iscsi,采用源码安装的方式进行安装,具体的版本可以视使用的习惯来决定
./configure
make
make install
2)iscsi的配置
vim /etc/iet/ietd.conf
Target iqn.2012-06.com.example:diskless2
Lun 0 Path=/tftp/win7.img,Type=fileio
Target iqn.2012-06.com.example:diskless3
Lun 0 Path=/tftp/xp.img,Type=fileio
Target iqn.2012-06.com.example:diskless4
Lun 0 Path=/tftp/d.img,Type=fileio
其中d.img为win7无盘中的虚拟D盘(通过此方法可以解决3dmax软件因为硬盘标识符问题导致的无法激活情况)
3)安装tftp服务器
采用yum安装
yum install tftp* (请确保xinetd守护程序也一并安装)
修改配置文件/etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
4)安装dhcp服务器
yum install dhcp*
修改配置文件/etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow bootp;
allow booting;
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.3.128 192.168.3.254;
default-lease-time 21600;
max-lease-time 43200;
filename "gpxelinux.0";
next-server 192.168.3.25;
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.2.128 192.168.2.254;
default-lease-time 21600;
max-lease-time 43200;
filename "gpxelinux.0";
next-server 192.168.3.25;
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}
5)在tftp的根目录下添加网络引导文件cmd.c32 gpxelinux.0 menu.c32 menu.lst sanboot.c32
上述文件均取自syslinux源码包,请下载3.8以后版本
在tftp根目录下建立目录pxelinux.cfg,并在该目录下创建文件default,内容如下:
DEFAULT menu.c32
TIMEOUT 200
PROMPT 0
MENU WIDTH 70
MENU MARGIN 20
MENU TABMSGROW 18
MENU CMDLINEROW 18
MENU ENDROW 24
MENU TIMEOUTROW 20
MENU TITLE FTP FASTST MENU
LABEL ISCSI BOOT 1
MENU LABEL ISCSI XP
kernel sanboot.c32
append iscsi:192.168.3.25::::iqn.2012-06.com.example:diskless3
LABEL ISCSI BOOT 2
MENU LABEL ISCSI WIN7X64
kernel sanboot.c32
append iscsi:192.168.3.25::::iqn.2012-06.com.example:diskless2
LABEL UBUNTU
kernel linux
append initrd=initrd.nfs root=/dev/nfs nfsroot=192.168.3.25:/ubuntu/root ip=dhcp rw
6)安装dhcp中继服务器
yum install dhcp*
修改内核参数允许端口转发
/etc/sysctl.conf
net.ipv4.ip_forward = 1
修改配置文件/etc/sysconfig/dhcrelay
DHCRELAYARGS=""
INTERFACES="eth1 eth2"
DHCPSERVERS="192.168.3.25"
7)无盘工作站模版建立
1、winxp模版建立:
winxp唯一需要做的就是要安装sanboot启动的补丁,以及iscsi的发起程序,启动iscsi程序后选择自动登录和多路径选项
2、win7模版的建立:
win7自带了iscsi的发起程序,在服务中设置自动启动,唯一不同于xp的是要修改注册表网卡的选项才可以实现无盘
注册表位置为:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007\Linkage\filterlist
取消掉最后一行保存
8)ubuntu无盘
1、服务器端
安装NFS服务yum install nfs portmap
修改配置文件/etc/exports
/ubuntu 192.168.3.0/24(rw,no_root_squash,sync)
/ubuntu 192.168.2.0/24(rw,no_root_squash,sync)
2、客户机端
安装nfs客户端:apt-get install nfs-client
修改配置文件/etc/network/interfaces
auto lo
iface lo inet loopback
auto eht0
iface eth0 inet manual
编译fstab文件把除了proc外的所有都注释掉
编辑udev的rules中关于网络借口记录的文件,去掉已经定义了的网络接口,否则无盘启动了有个报错(/etc/udev/rules.d/70-persistent-net.rules)
安装initramfs-tools
apt-get install initramfs-tools
编辑initramfs.conf把BOOT=LOCAL 改为BOOT=nfs
创建支持nfs的启动文件initrd.img
mkinitramfs -o /abc/initrd.nfs
cp /boot/vmlinuz-2.6.22-14 /abc/linux
将以上两个文件拷贝到服务器端的tftp根下面
8)上传系统镜像到服务器
windows模版可通过dd命令复制:
dd if=/dev/sdb of=/tftp/win7(xp).img bs=8225280 count=3309
至于dd命令相关的具体参数,请参考fdisk -l命令显示的数值
ubuntu模版通过tar命令打包整个系统,解压到服务器的相应目录即可
tar zcvfp /netfs/root/netfs.tgz / --exclude=/sys/* --exclude=/netfs --exclude=mnt/* \--exclude=/lost+found --exclude=/var/cache/* --exclude=/var/tmp/* --exclude=/proc/*
至此,2网段以及3网段的PC已经可以无盘网络引导系统了。
三、无盘服务器维护及软件更新
如果要更新软件windows下可先给服务器端的相关镜像可读写权限然后启动一台机器,进行正常的软件更新,安装。然后再将权限改为只读。
如果要更新ubuntu的环境,只要去服务器端的系统目录直接修改配置文件即可
四、无盘系统的稳定性及可用性调研:
计划采取hearbeat集群实现故障转移,通过LVS进行负载均衡处理,以实现大型网络,在带宽一定的情况下无盘客户端可以较快捷的连接多个服务器去引导系统。
本文出自 “技术为王” 博客,请务必保留此出处http://wangzhenyu.blog.51cto.com/2996939/928973
拓扑:
二、搭建无盘服务器:
1)安装iscsi,采用源码安装的方式进行安装,具体的版本可以视使用的习惯来决定
./configure
make
make install
2)iscsi的配置
vim /etc/iet/ietd.conf
Target iqn.2012-06.com.example:diskless2
Lun 0 Path=/tftp/win7.img,Type=fileio
Target iqn.2012-06.com.example:diskless3
Lun 0 Path=/tftp/xp.img,Type=fileio
Target iqn.2012-06.com.example:diskless4
Lun 0 Path=/tftp/d.img,Type=fileio
其中d.img为win7无盘中的虚拟D盘(通过此方法可以解决3dmax软件因为硬盘标识符问题导致的无法激活情况)
3)安装tftp服务器
采用yum安装
yum install tftp* (请确保xinetd守护程序也一并安装)
修改配置文件/etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
4)安装dhcp服务器
yum install dhcp*
修改配置文件/etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
allow bootp;
allow booting;
subnet 192.168.3.0 netmask 255.255.255.0 {
option routers 192.168.3.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.3.128 192.168.3.254;
default-lease-time 21600;
max-lease-time 43200;
filename "gpxelinux.0";
next-server 192.168.3.25;
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.10;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.2.128 192.168.2.254;
default-lease-time 21600;
max-lease-time 43200;
filename "gpxelinux.0";
next-server 192.168.3.25;
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
}
5)在tftp的根目录下添加网络引导文件cmd.c32 gpxelinux.0 menu.c32 menu.lst sanboot.c32
上述文件均取自syslinux源码包,请下载3.8以后版本
在tftp根目录下建立目录pxelinux.cfg,并在该目录下创建文件default,内容如下:
DEFAULT menu.c32
TIMEOUT 200
PROMPT 0
MENU WIDTH 70
MENU MARGIN 20
MENU TABMSGROW 18
MENU CMDLINEROW 18
MENU ENDROW 24
MENU TIMEOUTROW 20
MENU TITLE FTP FASTST MENU
LABEL ISCSI BOOT 1
MENU LABEL ISCSI XP
kernel sanboot.c32
append iscsi:192.168.3.25::::iqn.2012-06.com.example:diskless3
LABEL ISCSI BOOT 2
MENU LABEL ISCSI WIN7X64
kernel sanboot.c32
append iscsi:192.168.3.25::::iqn.2012-06.com.example:diskless2
LABEL UBUNTU
kernel linux
append initrd=initrd.nfs root=/dev/nfs nfsroot=192.168.3.25:/ubuntu/root ip=dhcp rw
6)安装dhcp中继服务器
yum install dhcp*
修改内核参数允许端口转发
/etc/sysctl.conf
net.ipv4.ip_forward = 1
修改配置文件/etc/sysconfig/dhcrelay
DHCRELAYARGS=""
INTERFACES="eth1 eth2"
DHCPSERVERS="192.168.3.25"
7)无盘工作站模版建立
1、winxp模版建立:
winxp唯一需要做的就是要安装sanboot启动的补丁,以及iscsi的发起程序,启动iscsi程序后选择自动登录和多路径选项
2、win7模版的建立:
win7自带了iscsi的发起程序,在服务中设置自动启动,唯一不同于xp的是要修改注册表网卡的选项才可以实现无盘
注册表位置为:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0007\Linkage\filterlist
取消掉最后一行保存
8)ubuntu无盘
1、服务器端
安装NFS服务yum install nfs portmap
修改配置文件/etc/exports
/ubuntu 192.168.3.0/24(rw,no_root_squash,sync)
/ubuntu 192.168.2.0/24(rw,no_root_squash,sync)
2、客户机端
安装nfs客户端:apt-get install nfs-client
修改配置文件/etc/network/interfaces
auto lo
iface lo inet loopback
auto eht0
iface eth0 inet manual
编译fstab文件把除了proc外的所有都注释掉
编辑udev的rules中关于网络借口记录的文件,去掉已经定义了的网络接口,否则无盘启动了有个报错(/etc/udev/rules.d/70-persistent-net.rules)
安装initramfs-tools
apt-get install initramfs-tools
编辑initramfs.conf把BOOT=LOCAL 改为BOOT=nfs
创建支持nfs的启动文件initrd.img
mkinitramfs -o /abc/initrd.nfs
cp /boot/vmlinuz-2.6.22-14 /abc/linux
将以上两个文件拷贝到服务器端的tftp根下面
8)上传系统镜像到服务器
windows模版可通过dd命令复制:
dd if=/dev/sdb of=/tftp/win7(xp).img bs=8225280 count=3309
至于dd命令相关的具体参数,请参考fdisk -l命令显示的数值
ubuntu模版通过tar命令打包整个系统,解压到服务器的相应目录即可
tar zcvfp /netfs/root/netfs.tgz / --exclude=/sys/* --exclude=/netfs --exclude=mnt/* \--exclude=/lost+found --exclude=/var/cache/* --exclude=/var/tmp/* --exclude=/proc/*
至此,2网段以及3网段的PC已经可以无盘网络引导系统了。
三、无盘服务器维护及软件更新
如果要更新软件windows下可先给服务器端的相关镜像可读写权限然后启动一台机器,进行正常的软件更新,安装。然后再将权限改为只读。
如果要更新ubuntu的环境,只要去服务器端的系统目录直接修改配置文件即可
四、无盘系统的稳定性及可用性调研:
计划采取hearbeat集群实现故障转移,通过LVS进行负载均衡处理,以实现大型网络,在带宽一定的情况下无盘客户端可以较快捷的连接多个服务器去引导系统。
本文出自 “技术为王” 博客,请务必保留此出处http://wangzhenyu.blog.51cto.com/2996939/928973
相关文章推荐
- 使用sp_configure 系统存储过程,设置服务器配置选项
- 阿里云服务器 ECS Ubuntu系统安装配置
- 检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件失败,原因是出现以下错误: 8000401a 因为配置标识不正确,系统无法开始服务器进程。请检查用户名和密码。 (异常来自 HRESULT:0x8000401A)。 在 BatchImportEntryTable.GetExcelData(String FileName)
- CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境
- CentOS6.6服务器系统配置(LAMP+phpMyAdmin)全流程
- Mysql性能优化----SQL语句优化、索引优化、数据库结构优化、系统配置优化、服务器硬件优化
- 阿里云服务器linux系统配置svn
- Domino安装配置系统之七 :Lotus Domino R8.x分区服务器配置手册
- 服务器配置不当引发的“血案”——论IT系统配置核查的重要性
- 在Ubuntu 12.04系统中安装jdk和配置tomcat服务器
- linux服务器系统中手动配置lamp服务器的经验分享
- 中小企业服务器配置方案(文件服务器之NFS篇及后 网络文件系统(Network File System)
- 编译android4.0出现jdk版本问题 & 服务器系统变量配置
- IBM X System ServerGuide 8.41 服务器 系统安装 引导盘
- RHEL6服务器网络配置 修改linux RHEL6系统下的ip方法
- Win2003 R2 SP2 64位服务器系统 配置PHP+IIS6
- CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境
- HP刀片服务器系统Flex-10 VC配置与VMware vSphere网络设计 推荐
- SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_co
- 03. ubuntu 16.04 LTS 双系统安装之配置双系统引导