CentOS 7 快速部署 Cobbler

目录


一、Cobbler简述

1.什么是Cobbler

官方网站:https://cobbler.github.io/
GITHUB: https://github.com/cobbler/cobbler

  • Cobbler 可以用来快速建立 Linux 网络安装环境,而且在经过调整也可以支持网络安装windows。
  • 使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP、DNS、以及yum包镜像。
  • 可以大批量的部署操作系统,可以同时部署多个不同的操作系统,配合kickstart文件可以定制和无人值守的方式部署操作系统。
  • 对PXE进行二次开发和封装,同时提供二次开发接口。
  • Cobbler由Python语言开发,是对PXE和Kickstart以及DHCP的封装。
  • 提供了CLI和Web的管理形式。更加方便的实行网络安装。
  • 同时,Cobbler也提供了API接口,使用其它语言也很容易做扩展。
  • 不仅可以安装物理机,同时也支持kvm、xen虚拟化、Guest OS的安装。
  • 能结合Puppet等集中化管理软件,实现自动化的管理。

2.Cobbler配置结构

Cobbler的配置结构基于一组注册的对象。每个对象表示一个与另一个实体相关联的实体。当一个对象指向另一个对象时,它就继承了被指向对象的数据,并可覆盖或添加更多特定信息。

以下对象类型的定义为:

  • 发行版(Distro):
    表示一个操作系统。它承载了内核和initrd 的信息,以及内核参数等其他数据。
  • 配置文件(Profile):
    包含一个发行版、一个kickstart 文件以及可能的存储库,还包含更多特定的内核参数等其他数据。
  • 系统(System):
    表示要配给的机器。它包含一个配置文件或一个镜像,还包含 IP 和 MAC 地址、电源管理(地址、凭据、类型)以及更为专业的数据等信息。
  • 存储库(Repo):
    保存一个 yum 或 rsync 存储库的镜像信息。
  • 镜像(Image):
    可替换一个包含不属于此类别的文件的发行版对象(例如,无法分为内核和 initrd 的对象)。

基于注册的对象以及各个对象之间的关联,Cobbler 知道如何更改文件系统以反映具体配置。因为系统配置的内部是抽象的,所以您可以仅关注想要执行的操作。


3.Cobbler配置流程

Server端

  1. 启动Cobbler服务
  2. 进行Cobbler错误检查,执行cobbler check命令
  3. 进行配置同步,执行cobbler sync命令
  4. 复制相关启动文件文件到TFTP目录中
  5. 启动DHCP服务,提供地址分配
  6. DHCP服务分配IP地址
  7. TFTP传输启动文件
  8. Server端接收安装信息
  9. Server端发送ISO镜像与Kickstart文件

Client端

  1. 客户端以PXE模式启动
  2. 客户端获取IP地址
  3. 通过TFTP服务器获取启动文件
  4. 进入Cobbler安装选择界面
  5. 客户端确定加载信息
  6. 根据配置信息准备安装系统
  7. 加载Kickstart文件
  8. 传输系统安装的其它文件
  9. 进行安装系统

二、Cobbler部署

1、采用epel源安装Cobbler、dhcp、httpd等服务及相关依赖包

# yum install epel-release -y
# yum clean all
# yum install cobbler cobbler-web httpd rsync tftp-server xinetd dhcp python-ctypes debmirror pykickstart -y

2、启动服务,检查cobbler配置

# systemctl enable cobblerd
# systemctl start cobblerd
# systemctl enable httpd
# systemctl start httpd
# cobbler check

报错:

1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
3 : change 'disable' to 'no' in /etc/xinetd.d/tftp
4 : Some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
5 : enable and start rsyncd.service with systemctl
6 : comment out 'dists' on /etc/debmirror.conf for proper debian support
7 : comment out 'arches' on /etc/debmirror.conf for proper debian support
8 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still 
  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值