当前位置:网站首页>Cobbler轻松上手
Cobbler轻松上手
2022-06-30 17:46:00 【oaa114龙仔】
cobbler简介
cobbler是什么?
cobbler 是基于pxe底层使用 python 编写的快速网络安装操作系统服务。
支持众多的Linux发行版:Red Hat、Fedora、CentOS、Debian、Ubuntu和SuSE,也可以支持网络安装windows。
cobbler 核心内容
1.安装树
repo +yum
2.系统镜像
3.pxe引导
vmlinuz+initrd.img
4.ks脚本
Kickstart
自动化安装=安装树 + pxe引导 +系统镜像 +ks脚本
cobbler 实现架构
1.需要 dhcpd 分发IP+引导地址
2.需要 tftp 共享pxe引导文件
3.需要 xinted 启动tftp
4.需要 apache 共享安装树
5.需要 cobbler组件 简化安装程序
实现cobbler
准备环境
0.一台centos7主机,IP为192.168.1.20,自定义nat网络模式
1.关闭防火墙与selinux
systemctl stop firewalld && systemctl disable firewalld && setenforce 0
2.清空旧 yum 源
cd /etc/yum.repos.d/
rm -rf *
3.添加 aliyun 源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
4.添加 epel 扩展源
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
5.yum 缓存
yum clean all
yum makecache
cobbler安装
1.安装cobbler组件
yum install cobbler dhcp dhcp-common tftp tftp-server xinetd syslinux pykickstart debmirror -y
2.修改cobbler基本配置
vi /etc/cobbler/settings
manage_dhcp: 0 //0人为管理DHCP,1为cobbler管理
manage_tftpd: 0
server: 192.168.1.20 //指定cobbler监听的端口
next_server: 192.168.1.20 //指定安装树地址
3.启动组件服务
systemctl start httpd
systemctl start cobblerd
4.cobbler自检并按照提示修改
cobbler check

5.按需求修改完之后重启cobbler服务
systemctl restart cobblerd.service
cobbler sync //刷新cobbler配置
此时已经在 /var/lib/tftpboot目录下生成基于pxe启动相关文件
cobbler使用
1.修改dhcp配置文件
vi /etc/dhcp/dhcpd.conf
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.120;
option routers 192.168.1.2;
option domain-name-servers 8.8.8.8;
filename "pxelinux.0";
}
2.启动dhcpd,xinetd,tftp
3.挂载光盘
mount /dev/sr0 /mnt/
4.在cobbler中导入centos7镜像
cobbler import --path=/mnt/ --name=centos7
5.导入成功后执行一次sync
cobbler sync
6.到这里就可以实现基本的自动化安装系统了,因为 DHCP分发服务做好了,tftp里的 pxe 引导文件也存在,系统镜像 在cobbler导入的时候做了一个将
系统镜像复制到 /var/www/cobbler 目录下的操作 ,所以需要安装的机器就可以通过网络访问到 需要安装的 系统镜像。
同时cobbler 有自己默认的ks脚本文件,你不去手动指定的化也能完成自动化安装。
7.新建一个虚拟机尝试安装系统 ,内存必须要2g 以上,不够会超时报错
cobbler 定制profile
1.由于生产环境中不可能用默认的安装脚本,所以需要根据要求自定义 ks 脚本来封装一个profile ,也就是系统镜像。
2.ks文件默认在家目录就有一个 anaconda-ks.cfg ,可以使用这个作为模板进行使用。
3.安装树地址在 http://192.168.1.20/cobbler/ks_mirror/centos7/
4.修改 anaconda-ks.cfg
vi anaconda-ks.cfg
增加:url --url=http://192.168.1.20/cobbler/ks_mirror/centos7/
增加:reboot
删除:network --bootproto=static --device=ens33 --gateway=192.168.1.2 --ip=192.168.1.11 --nameserver=114.114.114.114 --netmask=255.255.255.0 --ipv6=auto --activate
保存退出:wq
5.ks 文件固定在 /var/lib/cobbler/kickstarts/
6.移动 ks 文件 至 /var/lib/cobbler/kickstarts/
mv anaconda-ks.cfg /var/lib/cobbler/kickstarts/
7.创建profile
cobbler profile add --distro=centos7-x86_64 --kickstart=/var/lib/cobbler/kickstarts/anaconda-ks.cfg --name=profile_centos7
8.cobbler 刷新配置
cobbler sync
9.新建虚拟机测试装系统,收工。
边栏推荐
- ONEFLOW source code parsing: automatic inference of operator signature
- The online procurement system of the electronic components industry accurately matches the procurement demand and leverages the digital development of the electronic industry
- 领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!
- Small program container technology to promote the operation efficiency of the park
- opencv数据类型代码表 dtype
- Dependencies tool to view exe and DLL dependencies
- Vulnerability recurrence ----- 35. Uwsgi PHP directory traversal vulnerability (cve-2018-7490)
- 《Go题库·15》go struct 能不能比较?
- 云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
- Vulnerability recurrence ----37. Apache unomi Remote Code Execution Vulnerability (cve-2020-13942)
猜你喜欢

Swin-Transformer(2021-08)

Countdowncatch and completabilefuture and cyclicbarrier

MySQL transaction concurrency and mvcc mechanism

Vulnerability recurrence ----37. Apache unomi Remote Code Execution Vulnerability (cve-2020-13942)

医疗行业企业供应链系统解决方案:实现医疗数智化供应链协同可视

depends工具查看exe和dll依赖关系

EasyNVR平台设备通道均在线,操作出现“网络请求失败”是什么原因?

Classic problem of leetcode dynamic programming (I)

浏览器窗口切换激活事件 visibilitychange
Do you really understand the persistence mechanism of redis?
随机推荐
正则表达式(正则匹配)
Memory Limit Exceeded
煤炭行业数智化供应商管理系统解决方案:数据驱动,供应商智慧平台助力企业降本增效
屏幕显示技术进化史
Glacier teacher's book
音频 librosa 库 与 torchaudio 库中 的 Mel- spectrogram 进行对比
Rust 如何实现依赖注入?
Vulnerability recurrence ----37. Apache unomi Remote Code Execution Vulnerability (cve-2020-13942)
[community star selection] the 23rd issue of the July revision plan | bit by bit creation, converging into a tower! Huawei freebuses 4E and other cool gifts
Leader: who can use redis expired monitoring to close orders and get out of here!
20200525-生物技术-四川师范大学自考生物技术(本科)考试计划.txt
Sword finger offer 16 Integer power of numeric value
Reading notes of "high EQ means being able to talk"
Summary of methods for offline installation of chrome extensions in China
秉持'家在中国'理念 2022 BMW儿童交通安全训练营启动
Redis - persistent RDB and persistent AOF
js 字符串截取方法汇总
php利用队列解决迷宫问题
TCP粘包问题
小程序容器技术,促进园区运营效率提升