linux5.9安装教程,Linux5.9无人值守安装

LINUX无人值守安装多台服务器

前言:本文介绍了PC平台上的一种快速Red Hat Linux 5.9安装方案。它具有很高的自动化程度,用户只需要手工启动机器并选择从网络启动,就可以完成整个安装过程。在需要批量安装大量Red Hat Linux5.9系统的情况下,这种方案可以节省大量的时间。而且由于不需要额外的软件和光驱等硬件设备,在成本上也有很大的有事。最后希望安装Red Hat Linux的开放/测试人员和IT支持人员都能够从本人获益

一、实验拓扑:

-----PXE Server(vmnet1)-------------Client(vmnet1)------

二、具体实现:

1、配置DHCP(给需要安装系统的主机分配ip)

[root@localhost~]# ifconfig eth0 | grep "inet addr"

inet addr:192.168.10.10  Bcast:192.168.10.255  Mask:255.255.255.0

//设置PXE Server IP

[root@localhost~]# cd /etc/yum.repos.d/

[root@localhostyum.repos.d]# cp rhel-debuginfo.repo rhel.repo

[root@localhostyum.repos.d]# cat rhel.repo

[rhel-server]

name=Red HatEnterprise Linux 5.9 Server

baseurl=file:///misc/cd/Server

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

//配置yum数据库

[root@localhost~]# rpm -q dhcp

package dhcp isnot installed

[root@localhost~]# yum -y install dhcp

//安装dhcp服务软件包

[root@localhost~]# cat /etc/dhcpd.conf

ddns-update-styleinterim;

next-server192.168.10.10;

filename"pxelinux.0";

subnet192.168.10.0 netmask 255.255.255.0 {

option subnet-mask              255.255.255.0;

option domain-name              "tarena.com";

option domain-name-servers      192.168.10.10;

range dynamic-bootp 192.168.10.50192.168.10.100;

default-lease-time 21600;

max-lease-time 43200;

}

//修改dhcp服务配置文件

[root@localhost~]# service dhcpd restart

[root@localhost~]# chkconfig dhcpd on

//启动服务并设置开机自启动

[root@localhost~]# netstat -tulnp | grep :67

udp        0     0 0.0.0.0:67              0.0.0.0:*                    5219/dhcpd

//查看服务是否启动

2、配置TFTP

[root@localhost~]# rpm -q tftp-server

tftp-server-0.49-2

//查看tftp服务软件包已经安装

[root@localhost~]# vim /etc/xinetd.d/tftp

...

13        server_args             = -s/tftpboot

14        disable                 = no

.. .                                                  //修改tftp配置文件

[root@localhost~]# service xinetd restart

[root@localhost~]# chkconfig xinetd on

//开启服务并设置开机自启动

[root@localhost~]# netstat -tulnp | grep :69

udp    0   0 0.0.0.0:69   0.0.0.0:*  5366/xinetd

//查看服务状态,确认服务已启动

3、配置VSFTP

[root@localhost~]# yum -y install vsftp*

//安装vsftpd服务软件包

[root@localhost~]# service vsftpd restart

[root@localhost~]# chkconfig vsftpd on

//启动服务

4、配置DNS

[root@localhost ~]# yum -yinstall bind bind-chroot caching- nameserver

//安装软件包

[root@localhost~]# cd /var/named/chroot/etc/

[root@localhostetc]# cp -p named.caching-nameserver.conf named.conf

[root@localhostetc]# vim named.conf

...

15        listen-on port 53 { 192.168.10.10; };

...

27        allow-query     { any; };

28        allow-query-cache { any; };

...

37        match-clients      { any; };

38        match-destinations { any; };

//进入主配置文件named.conf进行配置

[root@localhostetc]# vim named.rfc1912.zones

...

51 zone "tarena.com" IN {

52        type master;

53        file "tarena.com.zone";

54 };

55

56 zone "10.168.192.in-addr.arpa" IN{

57        type master;

58        file "tarena.com.arpa";

59 };

//进入主配置文件named.rfc1912.zones配置

[root@ser1 etc]#named-checkconf named.conf

//检测配置文件语法是否正确

[root@localhost etc]# cd/var/named/chroot/var/named/

//修改数据库文件

[root@localhostnamed]# cp -p named.local tarena.com.zone

[root@localhostnamed]# cp -p named.local tarena.com.arpa

//复制数据库文件模板修改

[root@localhostnamed]# cat tarena.com.zone

$TTL    86400

@       IN     SOA     localhost.root.localhost.  (

1997022700 ; Serial

28800      ; Refresh

14400      ; Retry

3600000    ; Expire

86400)    ; Minimum

IN     NS      dns1.tarena.com.

dns1    IN     A       192.168.10.10

www     IN     A       192.168.10.11

bbs     IN     A       192.168.10.12

$GENERATE 50-100station$  IN  A  192.168.10.$           //泛域名正向解析

//配置正向解析文件

[root@localhost named]# cat tarena.com.arpa

$TTL    86400

@       IN     SOA     localhost.root.localhost.  (

1997022700; Serial

28800      ; Refresh

14400      ; Retry

3600000    ; Expire

86400)    ; Minimum

IN     NS      dns1.tarena.com.

10      IN     PTR     dns1.tarena.com.

11      IN     PTR     www.tarena.com.

12      IN     PTR     bbs.tarena.com.

$GENERATE 50-100  $ IN PTR  station$.tarena.com        //泛域名反向解析

//配置反向解析文件

[root@localhost~]#named-checkzone  tarena.com  tarena.com.zone

zonetarena.com/IN: loaded serial 1997022700

OK

[root@localhostnamed]# named-checkzone tarena.com tarena.com.arpa

zonetarena.com/IN: loaded serial 1997022700

OK

//检测正向解析文件是否有语法错误

[root@localhostnamed]# service named restart

[root@localhostnamed]# chkconfig named on

/ /启动服务

5、将所需文件放置在固定位置

[root@localhost~]# cd /misc/cd/p_w_picpaths/pxeboot/

[root@localhostpxeboot]# cp initrd.img vmlinuz /tftpboot/

//将内核文件和初始化文件放在/tftpboot下

[root@localhostpxeboot]#cp /usr/share/syslinux/pxelinux.0 /tftpboot/

//将引导文件也复制在/tftpboot/下

[root@localhostpxeboot]# mkdir /tftpboot/pxelinux.G

[root@localhostpxeboot]#cp/misc/cd/isolinux/isolinux.G /tftpboot/pxelinux.G/default

//将光盘中的isolinux.G文件拷贝成pxelinux.G下的default

[root@localhostpxeboot]#mkdir /var/ftp/rhel

[root@localhostpxeboot]#mount /dev/cdrom /var/ftp/rhel

//将光盘挂载在FTP共享位置以便于找到镜像文件

[root@localhostpxeboot]#vim /tftpboot/pxelinux.0/default

….

F4 param.msg

F5 rescue.msg

label linux

kernel vmlinuz

append ks=ftp://192.168.10.10/ks.Ginitrd=initrd.img

label text

kernel vmlinuz

appendinitrd=initrd.img text

//添加ks的文件位置

6、使用软件system-config-kickstart形成ks文件

[root@localhostpxeboot]#yum  -y  install  system-config-kickstart

[root@localhostpxeboot]#system-config-kickstart

形成ks文件的步骤如下图所示:

87bb6509b1945abdd659f104b3a8d835.png

a309bc24b01c3989669e82493d8320e0.png

28789cbbc98d44d791813e5faf60bbab.png

280fd162215b91851e34948370208b0c.png

e4d861ca6768e107be125bed0d409167.png

2d53ee00e56d7af609add172e45b1e50.png

7ae3816d9c652a40efa082a3fe9b1094.png

4fb3f34a45f1ca263955f3d9b1a8cd66.png

ea4d37a8855bb5e511d2929d35a2c3ab.png

85b6259b8d05657cefd47088a63ad1fa.png

7、在ks文件中添加一行,来实现跳过安装序列号的那个步骤

[root@localhostpxeboot]#vim  /var/ftp/ks.G

…..

clearpart --none

# Use graphical install

graphical

key --skip

# Firewall configuration

firewall --enabled

……

8、开启多台服务器,进入BOS选择从网络启动就可以实现无人值守安装了

注:由于小写G在文章中不允许出现,故将小写全部替换成大写。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值