运维自动化工具 Kickstart
简介:
批量安装操作系统工具之 Kickstart ,RedHat 早前推出的产品( 不多说了,现在都玩 Cobbler 啦 )。
测试环境:CentOS 6.6 x86_64 minimal
一、安装软件包
shell > yum -y install dhcp tftp-server syslinux nfs-utils kickstart
二、配置 DHCP
shell > cp /usr/share/doc/dhcp-4.1./dhcpd.conf.sample /etc/dhcp/dhcpd.conf
cp:是否覆盖"/etc/dhcp/dhcpd.conf"? y shell > vim /etc/dhcp/dhcpd.conf # dhcpd.conf
# option definitions common to all supported networks...
option domain-name-servers 192.168.214.2, 202.106.46.151;
# A slightly different configuration for an internal subnet.
subnet 192.168.214.0 netmask 255.255.255.0 {
range 192.168.214.100 192.168.214.120;
option routers 192.168.214.2;
option subnet-mask 255.255.255.0;
filename "/pxelinux.0";
default-lease-time ;
max-lease-time ;
}
三、配置 tftp
shell > vim /etc/xinetd.d/tftp service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no ## 原为 yes
per_source =
cps =
flags = IPv4
}
四、pxelinux.0
shell > cp /usr/share/syslinux/pxelinux. /var/lib/tftpboot/
shell > mount /dev/cdrom /mnt/
shell > cp /mnt/isolinux/* /var/lib/tftpboot/
shell > cd /var/lib/tftpboot/
shell > mkdir pxelinux.cfg
shell > mv isolinux.cfg pxelinux.cfg/default
五、配置 NFS
shell > vim /etc/exports /mnt 192.168.0.0/(ro,sync)
六、最后的调整
shell > chkconfig --add nfs
shell > chkconfig --add dhcpd
shell > chkconfig --add xinetd
shell > chkconfig --add rpcbind
shell > chkconfig --level nfs on
shell > chkconfig --level dhcpd on
shell > chkconfig --level xinetd on
shell > chkconfig --level rpcbind on shell > exportfs -ar
shell > service dhcpd restart
关闭 dhcpd: [确定]
正在启动 dhcpd: [确定]
shell > service xinetd restart
停止 xinetd: [确定]
正在启动 xinetd: [确定]
shell > service rpcbind restart
停止 rpcbind: [确定]
正在启动 rpcbind: [确定]
shell > service nfs restart
关闭 NFS 守护进程: [确定]
关闭 NFS mountd: [确定]
关闭 NFS 服务: [确定]
Shutting down RPC idmapd: [确定]
启动 NFS 服务: [确定]
启动 NFS mountd: [确定]
启动 NFS 守护进程: [确定]
正在启动 RPC idmapd: [确定] shell > setenforce
shell > service iptables stop
七、测试 PXE 引导安装
1、客户机设置从网络引导(其实不用设置,本地找不到自然会去网络找),就可以看到安装界面
2、选择语言( Chinese Simplified )
3、OK
4、选择键盘( us )OK
5、选择媒体位置( NFS Directory )OK
6、配置网络( 默认即可 )OK
7、设置 NFS 服务( NFS server name: 192.168.214.10 ## NFS 服务器地址
CentOS directroy: /mnt ## ISO 存放位置 )OK
8、这里出现正常的安装界面,证明没有问题( 跟光盘安装一模样即可 )
## 这是实现了 PXE 引导安装,想要无人干预还得配置 Kickstart !
八、安装桌面环境
## 以下操作直接在虚拟机中执行,非终端连接 !(不是必要的)
shell > yum grouplist | grep -iP "(x window system|desktop)" Desktop
X Winsow System
## 其中搜索出来的这两个包是我们需要安装的。
shell > yum update ## 首先需要更新一下 yum shell > yum -y groupinstall "X Window System" shell > yum -y groupinstall "Desktop" shell > yum -y groupinstall "Chinese Support" ## 安装中文支持 shell > init
## 现在已经进入桌面环境
1、设置字体(不是必须的)
## 打开终端时,默认显示的字体简直难看到极致,中间还有空格乱入,对处女座来说根本忍不了!
系统--首选项--外观--字体--( 将等宽字体改为 AR PL UKai CN )--确定即可
2、安装软件包 system-config-kickstart
shell > yum -y install system-config-kickstart shell > system-config-kickstart ## 启动 Kickstart 配置程序
## 接下来就全是鼠标点点点啦 !
·基本配置
默认语言 :简体中文,也可以默认 ( English )
键盘 :默认即可
时区 :Asia/Shanghai ,按实际情况来
UTC 时钟 :勾选
根口令 :123456
确认根口令:123456
根口令加密:默认是勾上的,不用管
高级配置
安装后重新引导系统:勾选
·安装方法
执行新安装:勾选
选择 NFS :
NFS 服务器:192.168.214.10
NFS 目录 :/mnt ## NFS 共享的 ISO 存放目录
·引导装载程序选项
安装类型
安装新引导装载程序:勾选
安装选项
在主引导记录(MBR)上安装引导装载程序
·分区信息
主引导记录
清除主引导记录:勾选
分区
删除所有现存分区:勾选
磁盘标签
初始化磁盘标签:勾选
布局
添加分区( 跟装真机一样 )
·网络配置
添加网络设备--网络设备(eth0)--网络类型(DHCP)--确认即可
·验证
默认
·防火墙配置
全部禁用
·显示配置
安装图形环境:不勾选(如果不想安装的话)
禁用
·软件包选择
默认
·预安装脚本
默认
·安装后脚本
默认
选择--文件--保存--(将文件保存到 /root 目录下,文件名为 ks.cfg)
shell > mkdir /nfsdir shell > cp ks.cfg /nfsdir shell > chown /nfsdir/ks.cfg shell > vim /etc/exports /mnt 192.168.214.0/(ro,sync)
/nfsdir 192.168.214.0/(ro,sync) ## 添加共享目录 shell > exportfs -ar shell > vim /var/lib/tftpboot/pxelinux.cfg/default default vesamenu.c32
#prompt
timeout display boot.msg menu background splash.jpg
menu title Welcome to CentOS 6.6!
menu color border #ffffffff #
menu color sel #ffffffff #ff000000
menu color title #ffffffff #
menu color tabmsg #ffffffff #
menu color unsel #ffffffff #
menu color hotsel #ff000000 #ffffffff
menu color hotkey #ffffffff #ff000000
menu color scrollbar #ffffffff # label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=nfs:192.168.214.10:/nfsdir/ks.cfg initrd=initrd.img
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label memtest86
menu label ^Memory test
kernel memtest
append -
## 其中,timeout 50 ( 这个参数原为 600 ,就是一进去系统时那个选择模式的时间,我们不想等待太长时间所以调为 5 秒 )
## 在第一个 label 中加入了:ks=nfs:192.168.214.10:/nfsdir/ks.cfg ( 定义 ks.cfg 路径 )
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=nfs:192.168.214.10:/nfsdir/ks.cfg initrd=initrd.img
## 下面贴一下 ks.cfg 的文件内容( 不需要修改 )
shell > vim /nfsdir/ks.cfg #platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use NFS installation media
nfs --server=192.168.214.10 --dir=/mnt
# Root password
rootpw --iscrypted $$56NxQt/e$3fz.wnuWl7Ak7q9TIpwl0.
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone --isUtc Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=
part swap --fstype="swap" --size=
part / --fstype="ext4" --grow --size=
4、重新启动服务,测试无人值守
## 执行第 六 步操作
## 现在客户机只需开机( 引导方式为网络引导,其实不用设置,自己会去找的),即可 !
## 经测试没问题 !
运维自动化工具 Kickstart的更多相关文章
- Ansible运维自动化工具19个常用模块使用实例【转】
一.模块列表 1.setup 2.ping 3.file 4.copy 5.command 6.shell 7.script 8.cron 9.yum 10.service 11.group 12.u ...
- 使用Chef管理windows集群 | 运维自动化工具
但凡服务器上了一定规模(百台以上),普通的ssh登录管理的模式就越来越举步维艰.试想Linux发布了一个高危漏洞的补丁,你要把手下成百上千台机器都更新该补丁,如果没有一种自动化方式,那么至少要耗上大半 ...
- 运维自动化工具ansible
企业级自动化运维工具应用实战ansible 公司计划在年底做一次大型市场促销活动,全面冲刺下交易额,为明年的上市做准备.公司要求各业务组对年底大促做准备,运维部要求所有业务容量进行三倍的扩容,并搭建出 ...
- Ansible运维自动化工具
1>Ansible 1>ansible简介 ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfengine.chef.func.fabri ...
- 运维自动化工具 Cobbler
简介: 关于操作系统安装方面的自动化,早前我们使用 RedHat 推出的 Kickstart 来批量安装操作系统,近年来 RedHat 又推出一个 Cobbler . Cobbler 使用 Pytho ...
- 运维自动化工具---Puppet
案例环境:-----------------------------------------------------------------主机 操作系统 IP地址 主要软件--------- ...
- Centos7安装配置ansible运维自动化工具
准备至少两台机器 Centos7,这两台机器都关闭 selinux IP:106.13.118.132 服务端(ansible) masterIP:148.70.60.244 节点 slaver 服务 ...
- Centos7搭建ansible运维自动化工具
1)设置主机名和hosts文件 2)配置阿里云repo源 Wget -O /etc/yum.repos.d/aliyun.repo https://mirrors.aliyun.com/repo/Ce ...
- Ansible 运维自动化 ( 配置管理工具 )
背景 出差背景,要搞项目的自动化部署.因为只直接对接生产分发,机器又非常多,这样以往使用的bat只能作为应急方案了,还是得考虑使用专业化的工具来做这个事情! 当下有许多的运维自动化工具( 配置管理 ) ...
随机推荐
- Git-Svn 建立工作目录
使用Git-SVN 建立工作目录 GIT-SVN可以以SVN的版本为基础, 实现”私有”的版本管理功能. 这样一些不成熟但又需要记录的版本就不必提交到SVN上, 而只在自己本地私有的版本里出现. 下面 ...
- flash 一直在最上方,z-index无效
设置embed的透明度 wmode="transparent" <embed src="http://player.youku.com/player.php/sid ...
- 【2018.06.26NOIP模拟】T2号码bachelor 【数位DP】*
[2018.06.26NOIP模拟]T2号码bachelor 题目描述 Mike 正在在忙碌地发着各种各样的的短信.旁边的同学 Tom 注意到,Mike 发出短信的接收方手机号码似乎都满足着特别的性质 ...
- WPF 程序无法触摸操作?我们一起来找原因和解决方法!
WPF 自诞生以来就带着微软先生的傲慢.微软说 WPF 支持触摸,于是 WPF 就真的支持触摸了.对,我说的是"支持触摸",那种摸上去能点能动的:偶尔还能带点儿多指的炫酷效果.但是 ...
- hadoop下远程调试方法
JPDA 简介Sun Microsystem 的 Java Platform Debugger Architecture (JPDA) 技术是一个多层架构,使您能够在各种环境中轻松调试 Java 应用 ...
- Hadoop常见错误问题及解决方法总结二
问题导读:1.遇到问题该如何排除错误?2.看不到namenode的可能原因是什么?3.地址占用该如何解决?4.could only be replicatied to 0 nodes, instead ...
- python3.x 类和对象
python同样支持类和对象.在python3.x中没有了经典类,只有新式类,默认创建的就是新式类.具体的新式类与经典类的不同在python3.x中已经没有意义了. 类的定义和实例化 python定义 ...
- liunx系统环境下,爆出该错误"org.eclipse.wst.validation" has been removed解决办法
导出maven工程遇到的问题,"org.eclipse.wst.validation" has been removed,还以为是工程本身的问题,后来发现是eclipse的问题. ...
- C# 文字转成声音
C#程序要把特定的文字朗读出来,对于Windows 7及之后的系统可以使用.Net组件——System.Speech 首先在项目中添加“System.Speech”的引用: 然后大致的示例代码如下: ...
- AT指令(二)
1.常用操作1.1 AT命令解释:检测 Module 与串口是否连通,能否接收 AT 命令:命令格式:AT<CR>命令返回:OK (与串口通信正常) (无返回,与串 ...