运维部署自动化实践(一)利用PXE远程自动化安装Ubuntu16.04 server

运维部署自动化实践(一)利用PXE远程自动化安装Ubuntu16.04 server,第1张

因为项目需要(实际是没有人手。。。),需要搞开发的我自己来搭建服务器集群环境,并完成软件服务的自动化部署。本文及后续文章,记录运维部署自动化实践中的每一步工作,便于以后追踪参考。

本文先完成第一步工作:远程自动化安装Linux系统

技术方案选择:PXE+dhcp+tftp+kickstart 安装ubuntu16.04 server

宿主机:ubuntu16.04 desktop

目标服务器:(1)Dell Poweredge R540

(2)VMware虚拟机

安装镜像: ubuntu-16.04.5-server-amd64.iso

安装isc-dhcp-server

sudo apt-get install isc-dhcp-server

修改/etc/default/isc-dhcp-server

修改/etc/dhcp/dhcpd.conf,添加如下配置:

运行dhcp服务

sudo service isc-dhcp-server start

安装tftpd-hpa

sudo apt-get install tftpd-hpa

修改/etc/default/tftpd-hpa

创建tftp目录

sudo mkdir /var/lib/tftpboot

sudo chmod 777 /var/lib/tftpboot

运行tftp

sudo service tftp-hpa start

安装apache2

sudo apt-get install apache2

apache 默认的根目录是/var/www/html ,使用默认配置启动apache

sudo service apache2 start

通过浏览器访问http://192.168.1.110 测试http服务已开启

从修改内容看出,主要是为了添加pxe服务器的地址,以便目标机能够找到对应的ks.cfg以及seed文件。

将ks.cfg文件拷贝至http根目录

sudo cp ks.cfg /var/www/html/

Dell服务器与虚拟机均可自动开启安装过程,虚拟机全程无干扰安装完毕。

Dell服务器安装过程中报错:

the partition table format in use on your disks normally requires you to create a separate partition for boot loader code. this partition should de marked for use as a "reserved bios boot area" and should de at least 1 mb in size. note that this is not same as a partition mounted in /boot.

if you do not go back to the partitioning menu and correct,boot loader installation may fail later,although it may still be possible to install the loader to a partition.

在这一步卡住后安装程序无法自动执行,我手工点击忽略后系统也能够继续安装完毕。

网上各种搜,看到一些评论说debian系的linux不建议用kickstart安装,建议直接使用preseed配置来安装,接下来研究下看看能不能解决问题。

问题链接: https://serverfault.com/questions/658070/kickstarting-ubuntu-14-04-how-do-i-create-an-efi-boot-partition-from-my-ks-cf

下一章: 运维部署自动化实践(二)PXE+Preseed自动安装Ubuntu16.04 server

《Linux集群和自动化运维余洪春》百度网盘pdf最新全集下载:

链接: https://pan.baidu.com/s/1QHd7317pZcsjYvhQqKNroA

?pwd=bywn 提取码: bywn

简介:全书分为8章:第1章主要介绍进行网站架构设计的软硬件环境;第2章主要介绍生产环境下的shell脚本;第3章讲解的是自动化运维工具Farbic;第4章介绍自动化部署管理工具Ansible;第5章详解分布式自动化部署管理工具Puppet;第6章讲解的是Linux防火墙在企业中的部署;第7章分享高可用Linux集群案例;第8章介绍网站系统架构设计。  


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/8980899.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-23
下一篇 2023-04-23

发表评论

登录后才能评论

评论列表(0条)

保存