使用PXE工具批量部署服务器

简介: 使用PXE工具批量部署服务器

使用PXE工具批量部署服务器

目录

(1) 安装CentOS 6.5操作系统
(2) 配置与管理PXE主机
(3) 使用PXE批量部署安装服务器


PXE节点规划

20200615081919868.png


前期准备

使用VMware workstation虚拟机软件,采用最小化安装方式安装CentOS 6.5 操作系统,使用镜像CentOS-6.5-x86_64-bin.iso,此虚拟机作为PXE的母机系统,使用该机进行批量安装服务器系统的操作。


(1)安装CentOS 6.5操作系统
①、安装CentOS 6.5操作系统(此处略过)
②、配置PXE(CentOS 6.5)母机
配置IP地址

[root@centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

HWADDR=00:0C:29:19:25:65

TYPE=Ethernet

UUID=3cd9fde2-0152-4772-abb5-637fcf1fb61d

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

IPADDR=192.168.200.10

NETMSK=255.255.255.0

GATEWAY=192.168.200.1

重启网络服务

[root@centos ~]# service network restart

使用Winscp等远程传输文件软件来连接PXE母机,将CentOS-6.5-x86_64-bin.iso、CentOS-7.2-x86_64-DVD-1511.iso以及PXE.sh上传至PXE母机/root目录下

[root@centos ~]# ll

total 8734000

-rw-r–r--. 1 root root 29 May 1 01:20 abc

-rw-------. 1 root root 921 Apr 11 23:28 anaconda-ks.cfg

-rw-r–r--. 1 root root 4471971840 Jun 15 08:14 CentOS-6.5-x86_64-bin.iso

-rw-r–r--. 1 root root 4329570304 Jun 15 08:16 CentOS-7-x86_64-DVD-1511.iso

-rw-r–r--. 1 root root 8547467 May 12 01:20 etc.tar.gz

-rw-r–r--. 1 root root 9072 Apr 11 23:28 install.log

-rw-r–r--. 1 root root 3161 Apr 11 23:27 install.log.syslog

-rw-r–r--. 1 root root 22027 Jun 15 08:16 PXE.sh

drwxr-xr-x. 2 root root 4096 May 12 04:39 sh

-rw-r–r--. 1 root root 102400000 May 1 05:16 testfile

赋予PXE.sh可执行权限

[root@centos ~]# chmod +x PXE.sh

临时关闭selinux安全组,使用getenforce命令查看

[root@centos ~]# setenforce 0

[root@centos ~]# getenforce

Permissive


(2)配置与管理PXE主机

执行PXE母机安装脚本,选择“1”按”Enter”键安装PXE,命令如下

[root@centos ~]# ./PXE.sh

-------Install Info------------

1: install pxe

2: switch controller mode

3: switch compute mode

4: switch all mode

Please select installation services: (eg :1 / 2 / 3 )

1

Loaded plugins: fastestmirror

Cleaning repos: centos

Cleaning up Everything

Cleaning up list of fastest mirrors

iptables: Setting chains to policy ACCEPT: filter [ OK ]

iptables: Flushing firewall rules: [ OK ]

iptables: Unloading modules: [ OK ]

Loaded plugins: fastestmirror

Determining fastest mirrors

centos | 4.0 kB 00:00 …

centos/primary_db | 4.4 MB 00:00 …

Setting up Install Process

Package httpd-2.2.15-29.el6.centos.x86_64 already installed and latest version

Package wget-1.12-1.8.el6.x86_64 already installed and latest version

Package 12:dhcp-4.1.1-38.P1.el6.centos.x86_64 already installed and latest version

Resolving Dependencies

–> Running transaction check

—> Package syslinux.x86_64 0:4.02-8.el6 will be installed

–> Processing Dependency: mtools for package: syslinux-4.02-8.el6.x86_64

—> Package tftp-server.x86_64 0:0.49-7.el6 will be installed

–> Running transaction check

—> Package mtools.x86_64 0:4.0.12-1.el6 will be installed

–> Finished Dependency Resolution


Dependencies Resolved


=======================================================================


Package Arch Version Repository Size

Installing:

syslinux x86_64 4.02-8.el6 centos 859 k

tftp-server x86_64 0.49-7.el6 centos 39 k

Installing for dependencies:

mtools x86_64 4.0.12-1.el6 centos 194 k


Transaction Summary

Install 3 Package(s)


Total download size: 1.1 M

Installed size: 2.4 M

Downloading Packages:

Total 86 MB/s | 1.1 MB 00:00

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : mtools-4.0.12-1.el6.x86_64 1/3

Installing : syslinux-4.02-8.el6.x86_64 2/3

Installing : tftp-server-0.49-7.el6.x86_64 3/3

Verifying : syslinux-4.02-8.el6.x86_64 1/3

Verifying : tftp-server-0.49-7.el6.x86_64 2/3

Verifying : mtools-4.0.12-1.el6.x86_64 3/3


Installed:

syslinux.x86_64 0:4.02-8.el6 tftp-server.x86_64 0:0.49-7.el6


Dependency Installed:

mtools.x86_64 0:4.0.12-1.el6


Complete!

YUM IS READY

Starting dhcpd: [ OK ]

Stopping httpd: [FAILED]

Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using 192.168.200.10 for ServerName

[ OK ]

Shutting down dhcpd: [ OK ]

Starting dhcpd: [ OK ]

Stopping xinetd: [ OK ]

Starting xinetd: [ OK ]

-------Install Info------------

1: install pxe

2: switch controller mode

3: switch compute mode

4: switch all mode

Please select installation services: (eg :1 / 2 / 3 )

4

Stopping httpd: [ OK ]

Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using 192.168.200.10 for ServerName

[ OK ]

Shutting down dhcpd: [ OK ]

Starting dhcpd: [ OK ]

Stopping xinetd: [ OK ]

Starting xinetd: [ OK ]

至此,PXE母机安装完成!

(3)批量安装操作系统

①、安装环境配置说明
所需要安装系统的主机或服务器要与母机在同一网络下。默认主机或服务器为双网卡

注意事项:

20200615082145248.png

主机或服务器开机后按F12键进入PXE网卡启动,选择系统安装,默认为“Install CentOS 7 CONTROLLER”,如图所示。

20200615082246639.png

20200615082235408.png

**至此,系统安装完成!

重启登录成功!**

20200615082255387.png

相关文章
|
25天前
|
安全 Linux 文件存储
如何在本地服务器部署TeslaMate并远程查看特斯拉汽车数据无需公网ip
如何在本地服务器部署TeslaMate并远程查看特斯拉汽车数据无需公网ip
|
5天前
|
监控 Cloud Native 测试技术
云原生之使用Docker部署ServerBee服务器监控工具
【5月更文挑战第6天】云原生之使用Docker部署ServerBee服务器监控工具
12 1
|
7天前
|
Devops jenkins 网络安全
【DevOps】(四)jekins服务器ssh部署
【DevOps】(四)jekins服务器ssh部署
12 1
|
7天前
|
存储 安全 网络协议
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
云服务器 Centos7 部署 Elasticsearch 8.0 + Kibana 8.0 指南
18 0
|
8天前
|
安全 Linux 网络安全
Linux _ apache服务器部署 不同域名—访问不同网站(多网站)
Linux _ apache服务器部署 不同域名—访问不同网站(多网站)
|
9天前
|
弹性计算 运维 数据安全/隐私保护
【雾锁王国开服】阿里云一键部署雾锁王国联机服务器详细教程
阿里云提供雾锁王国服务器搭建教程,借助计算巢服务,用户可在3分钟内创建Enshrouded游戏服务器。8核32G服务器1个月109元,3个月327元;4核16G10M带宽1个月30元,3个月90元。需先注册并实名认证阿里云账号,然后通过傻瓜式一键部署入口进行购买和设置,包括地域、购买时长、服务器参数等。部署完成后,分享服务器信息给游戏伙伴,即可开始游戏。详细教程和更多配置信息可在阿里云ECS产品页查看。
27 0
|
12天前
|
Java
如何解决使用若依前后端分离打包部署到服务器上后主包无法找到从包中的文件的问题?如何在 Java 代码中访问 jar 包中的资源文件?
如何解决使用若依前后端分离打包部署到服务器上后主包无法找到从包中的文件的问题?如何在 Java 代码中访问 jar 包中的资源文件?
50 0
|
14天前
本地部署Jellyfin影音服务器并实现远程访问影音库-2
本地部署Jellyfin影音服务器并实现远程访问影音库
|
14天前
|
Linux 网络安全 文件存储
本地部署Jellyfin影音服务器并实现远程访问影音库-1
本地部署Jellyfin影音服务器并实现远程访问影音库
|
15天前
|
前端开发 安全 搜索推荐
【专栏】ngrok` 是一款让本地服务器暴露到公网的工具,提供外网访问、临时公网地址、安全隧道及实时更新功能
`【4月更文挑战第29天】ngrok` 是一款让本地服务器暴露到公网的工具,提供外网访问、临时公网地址、安全隧道及实时更新功能。使用简单,包括下载客户端、注册认证、启动本地服务和执行命令。在前端开发中,ngrok 用于本地开发调试、跨设备测试、前后端联调、演示分享和应急处理。它提高了开发效率,简化网络环境和部署问题。无论是移动应用测试还是团队协作,ngrok 都能发挥关键作用,是前端开发者必备神器。尝试使用 ngrok,提升你的开发体验。

热门文章

最新文章