当前位置:网站首页>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.新建虚拟机测试装系统,收工。
边栏推荐
- Tensorflow2 ten must know for deep learning
- Full recharge, im+rtc+x full communication service "feedback season" starts
- slice
- The cloud native landing practice of using rainbow for Tuowei information
- 秉持'家在中国'理念 2022 BMW儿童交通安全训练营启动
- mysql for update 死锁问题排查
- depends工具查看exe和dll依赖关系
- The online procurement system of the electronic components industry accurately matches the procurement demand and leverages the digital development of the electronic industry
- hdfs上的数据导入到clickhouse用什么方式最快呢?spark通过jdbc导入,还是hdfs
- 《客从何处来》
猜你喜欢

MySQL transaction concurrency and mvcc mechanism

深度学习编译器的理解

Deep learning compiler understanding

教你30分钟快速搭建直播间

Multipass Chinese document - setting graphical interface

屏幕显示技术进化史

电子元器件招标采购商城:优化传统采购业务,提速企业数字化升级

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

The online procurement system of the electronic components industry accurately matches the procurement demand and leverages the digital development of the electronic industry
Do you really understand the persistence mechanism of redis?
随机推荐
Rust 书籍资料 - 芽之家书馆
opencv数据类型代码表 dtype
C WinForm program interface optimization example
Teach you to quickly set up a live studio in 30 minutes
传统微服务框架如何无缝过渡到服务网格 ASM
Adhering to the concept of 'home in China', 2022 BMW children's traffic safety training camp was launched
电子元器件行业在线采购系统精准匹配采购需求,撬动电子产业数字化发展
正则表达式(正则匹配)
The easynvr platform equipment channels are all online. What is the reason for the "network request failure" in the operation?
MySQL cannot find mysql Temporary solution of sock file
Sword finger offer 17 Print from 1 to maximum n digits
秉持'家在中国'理念 2022 BMW儿童交通安全训练营启动
3.10 haas506 2.0开发教程-example-TFT
slice
Coding officially entered Tencent conference application market!
4个技巧告诉你,如何使用SMS促进业务销售?
小程序容器技术,促进园区运营效率提升
医疗行业企业供应链系统解决方案:实现医疗数智化供应链协同可视
拓維信息使用 Rainbond 的雲原生落地實踐
Infineon - GTM architecture -generic timer module