cobbler简介

Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCPDNS等。

Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。

Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。

Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。

Cobbler官网

cobbler集成的服务

  • PXE服务支持
  • DHCP服务管理
  • DNS服务管理(可选bind,dnsmasq)
  • 电源管理
  • Kickstart服务支持
  • YUM仓库管理
  • TFTP(PXE启动时需要)
  • Apache(提供kickstart的安装源,并提供定制化的kickstart配置)

cobbler配置文件详解

cobbler配置文件目录在/etc/cobbler

配置文件 作用
/etc/cobbler/settings cobbler 主配置文件
/etc/cobbler/iso/ iso模板配置文件
/etc/cobbler/pxe pxe模板配置文件
/etc/cobbler/power 电源配置文件
/etc/cobbler/user.conf web服务授权配置文件
/etc/cobbler/users.digest web访问的用户名密码配置文件
/etc/cobbler/dhcp.template dhcp服务器的的配置模板
/etc/cobbler/dnsmasq.template dns服务器的配置模板
/etc/cobbler/tftpd.template tftp服务的配置模板
/etc/cobbler/modules.conf 模块的配置文件

cobbler数据目录

目录 作用
/var/lib/cobbler/config/ 用于存放distros,system,profiles等信息配置文件
/var/lib/cobbler/triggers/ 用于存放用户定义的cobbler命令
/var/lib/cobbler/kickstart/ 默认存放kickstart文件
/var/lib/cobbler/loaders/ 存放各种引导程序以及镜像目录
/var/www/cobbler/ks_mirror/ 导入的发行版系统的所有数据
/var/www/cobbler/images/ 导入发行版的kernel和initrd镜像用于远程网络启动
/var/www/cobbler/repo_mirror/ yum仓库存储目录

cobbler日志文件

日志文件路径 说明
/var/log/cobbler/installing 客户端安装日志
/var/log/cobbler/cobbler.log cobbler日志

cobbler命令详解

cobbler check       //核对当前设置是否有问题
cobbler list        //列出所有的cobbler元素
cobbler report      //列出元素的详细信息
cobbler sync        //同步配置到数据目录,更改配置最好都要执行下
cobbler reposync    //同步yum仓库
cobbler distro      //查看导入的发行版系统信息
cobbler system      //查看添加的系统信息
cobbler profile     //查看配置信息

部署:

//开启cobbler仓库(这里需要先配置yum库和epel源)
[root@localhost ~]# dnf -y module enable cobbler
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Extra Packages for Enterprise L 343 kB/s | 955 kB     00:02
Extra Packages for Enterprise L  77 kB/s |  10 MB     02:18
上次元数据过期检查:0:00:01 前,执行于 2021年10月13日 星期三 14时59分07秒。
依赖关系解决。
================================================================软件包        架构         版本            仓库           大小
================================================================
启用模块流:cobbler                    3                                  事务概要
================================================================完毕!//安装cobbler
[root@localhost ~]# dnf -y install cobbler cobbler-web
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:04:24 前,执行于 2021年10月13日 星期三 14时59分07秒。
依赖关系解决。
================================================================软件包              架构   版本             仓库          大小
================================================================
安装:cobbler             noarch 3.2.2-3.module_el8+13166+f291d70cepel-modular 605 kcobbler-web         noarch 3.2.2-3.module_el8+13166+f291d70cepel-modular 175 k
......python3-urllib3-1.24.2-5.el8.noarch                           python36-3.6.8-2.module_el8.4.0+790+083e3d81.x86_64           rsync-3.1.3-12.el8.x86_64                                     sscg-2.3.3-14.el8.x86_64                                      tftp-server-5.2-24.el8.x86_64                                 xorriso-1.4.8-4.el8.x86_64                                    完毕!
[root@localhost ~]# //安装依赖包
[root@localhost ~]# dnf -y install pykickstart
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:01:42 前,执行于 2021年10月13日 星期三 15时07分10秒。
依赖关系解决。
================================================================软件包               架构    版本             仓库        大小
================================================================
安装:pykickstart          noarch  3.16.11-1.el8    AppStream   64 k
安装依赖关系:python3-kickstart    noarch  3.16.11-1.el8    AppStream  441 kpython3-ordered-set  noarch  2.0.2-4.el8      AppStream   17 k事务概要
================================================================
安装  3 软件包总下载:521 k
安装大小:2.0 M
下载软件包:
(1/3): python3-ordered-set-2.0. 145 kB/s |  17 kB     00:00
(2/3): python3-kickstart-3.16.1 764 kB/s | 441 kB     00:00
(3/3): pykickstart-3.16.11-1.el 104 kB/s |  64 kB     00:00
----------------------------------------------------------------
总计                            848 kB/s | 521 kB     00:00
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务准备中  :                                                 1/1 安装    : python3-ordered-set-2.0.2-4.el8.noarch          1/3 安装    : python3-kickstart-3.16.11-1.el8.noarch          2/3 安装    : pykickstart-3.16.11-1.el8.noarch                3/3 运行脚本: pykickstart-3.16.11-1.el8.noarch                3/3 验证    : pykickstart-3.16.11-1.el8.noarch                1/3 验证    : python3-kickstart-3.16.11-1.el8.noarch          2/3 验证    : python3-ordered-set-2.0.2-4.el8.noarch          3/3
Installed products updated.已安装:pykickstart-3.16.11-1.el8.noarch                              python3-kickstart-3.16.11-1.el8.noarch                        python3-ordered-set-2.0.2-4.el8.noarch                        完毕!
[root@localhost ~]# //设置http和cobbler开机自启
[root@localhost ~]# systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable --now cobblerd
Created symlink /etc/systemd/system/multi-user.target.wants/cobblerd.service → /usr/lib/systemd/system/cobblerd.service.//出现80和25151端口就表示成功
[root@localhost ~]# ss -antl
State  Recv-Q  Send-Q   Local Address:Port    Peer Address:Port
LISTEN 0       128            0.0.0.0:22           0.0.0.0:*
LISTEN 0       5            127.0.0.1:25151        0.0.0.0:*
LISTEN 0       128                  *:80                 *:*
LISTEN 0       128               [::]:22              [::]:*
LISTEN 0       128                  *:443                *:*
[root@localhost ~]# //生成密码
[root@localhost ~]# openssl passwd -1
Password:
Verifying - Password:
$1$Tg103bPw$j39OEUYQuZOEO9WKXoT8b1  //复制
[root@localhost ~]# //修改配置文件
[root@localhost ~]# cd /etc/cobbler/
[root@localhost cobbler]# ls
auth.conf               logging_config.conf  secondary.template
boot_loader_conf        modules.conf         settings.d
cheetah_macros          mongodb.conf         settings.yaml
dhcp.template           named.template       users.conf
dnsmasq.template        ndjbdns.template     users.digest
genders.template        reporting            version
import_rsync_whitelist  rsync.exclude        zone.template
iso                     rsync.template       zone_templates
[root@localhost cobbler]# vim settings.yaml
default_password_crypted: "$1$Tg103bPw$j39OEUYQuZOEO9WKXoT8b1"  //将刚刚生成的复制到这里
server: 192.168.75.142                                          //将此两行的ip该为本机ip
next_server: 192.168.75.142
manage_dhcp: true                                               //将此处改为1或true//修改dhcp配置文件
[root@localhost cobbler]# vim dhcp.template
subnet 192.168.75.0 netmask 255.255.255.0 {                     //改成自己网段option routers             192.168.75.142;                 //改成自己ipoption domain-name-servers 192.168.75.2;                   //设置dns地址option subnet-mask         255.255.255.0;                  range dynamic-bootp        192.168.75.200 192.168.200.254; //设置获取ip地址的范围default-lease-time         21600;max-lease-time             43200;next-server                $next_server;class "pxeclients" {match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";//重启服务并查看状态
[root@localhost cobbler]# systemctl restart httpd cobblerd
[root@localhost cobbler]# systemctl status cobblerd
● cobblerd.service - Cobbler Helper DaemonLoaded: loaded (/usr/lib/systemd/system/cobblerd.service; en>Active: active (running) since Wed 2021-10-13 15:28:59 CST; >  //running状态就表示成功Process: 80332 ExecStartPost=/usr/bin/touch /usr/share/cobble>Main PID: 80331 (cobblerd)Tasks: 1 (limit: 23789)Memory: 30.0MCGroup: /system.slice/cobblerd.service└─80331 /usr/bin/python3.6 -s /usr/bin/cobblerd -F10月 13 15:28:59 localhost.localdomain systemd[1]: Starting Cob>
10月 13 15:28:59 localhost.localdomain systemd[1]: Started Cobb>

测试并排错

//检差错误
[root@localhost cobbler]# cobbler check
The following are potential configuration items that you may want to fix:1: dhcpd is not installed
2: 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, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
3: reposync is not installed, install yum-utils or dnf-plugins-core
4: yumdownloader is not installed, install yum-utils or dnf-plugins-core
5: debmirror package is not installed, it will be required to manage debian deployments and repositories
6: fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use themRestart cobblerd and then run 'cobbler sync' to apply changes.
[root@localhost cobbler]# //解决第一个错误
[root@localhost ~]# yum install -y dhcp*
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:35:17 前,执行于 2021年10月13日 星期三 15时07分10秒。
软件包 dhcp-client-12:4.3.6-40.el8.x86_64 已安装。
软件包 dhcp-common-12:4.3.6-40.el8.noarch 已安装。
软件包 dhcp-libs-12:4.3.6-40.el8.x86_64 已安装。
软件包 dhcpd-pools-3.1-1.el8.x86_64 已安装。
依赖关系解决。
================================================================软件包             架构     版本                  仓库    大小
================================================================
......//解决第三个和第四个
[root@localhost ~]# dnf -y install yum-utils
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:37:10 前,执行于 2021年10月13日 星期三 15时07分10秒。
依赖关系解决。
================================================================软件包                    架构    版本             仓库   大小
================================================================
......//解决第六个问题
[root@localhost ~]# dnf -y install fence-agents
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:40:03 前,执行于 2021年10月13日 星期三 15时07分10秒。
依赖关系解决。
================================================================软件包                 架构   版本             仓库       大小
================================================================
安装:fence-agents-all       x86_64 4.2.1-65.el8_4.1 AppStream  21 k
升级:gnutls                 x86_64 3.6.14-8.el8_3   base      1.0 Mkpartx                 x86_64 0.8.4-10.el8     base      111 k//解决第二个问题
[root@localhost cobbler]# cobbler get-loaders
task started: 2021-10-13_155154_get_loaders
task started (id=Download Bootloader Content, time=Wed Oct 13 15:51:54 2021)
running python triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/get_loaders/pre/*
shell triggers finished successfully
path /var/lib/cobbler/loaders/README already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/COPYING.yaboot already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/COPYING.syslinux already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/yaboot already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/pxelinux.0 already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/menu.c32 already exists, not overwriting existing content, use --force if you wish to update
path /var/lib/cobbler/loaders/grub-x86.efi already exists, not overwriting existing content, use --force if you wish to update
downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***
[root@localhost cobbler]# //重启服务并同步
[root@localhost cobbler]# systemctl restart cobblerd
[root@localhost cobbler]# cobbler sync
task started: 2021-10-13_155416_sync
task started (id=Sync, time=Wed Oct 13 15:54:16 2021)
running python triggers from /var/lib/cobbler/triggers/task/sync/pre/*
running shell triggers from /var/lib/cobbler/triggers/task/sync/pre/*
shell triggers finished successfully
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/grub/system
removing: /var/lib/tftpboot/grub/system_link
removing: /var/lib/tftpboot/grub/grub.cfg
removing: /var/lib/tftpboot/grub/local_efi.cfg
removing: /var/lib/tftpboot/grub/local_legacy.cfg
removing: /var/lib/tftpboot/grub/local_powerpc-ieee1275.cfg
copying bootloaders
running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/var/lib/tftpboot']
received on stdout:
received on stderr:
running: ['rsync', '-rpt', '--copy-links', '--exclude=README.grubconfig', '/var/lib/cobbler/grub_config/', '/var/lib/tftpboot']
received on stdout:
received on stderr:
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: dhcpd -t -q
received on stdout:
received on stderr:
dhcpd -t failed
Exception occurred: <class 'cobbler.cexceptions.CX'>
Exception value: 'Cobbler trigger failed: cobbler.modules.sync_post_restart_services'
Exception Info:File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 98, in runrc = self._run(self)File "/usr/lib/python3.6/site-packages/cobbler/remote.py", line 224, in runnerself.remote.api.sync(self.options.get("verbose", False), logger=self.logger)File "/usr/lib/python3.6/site-packages/cobbler/api.py", line 1317, in syncsync.run()File "/usr/lib/python3.6/site-packages/cobbler/actions/sync.py", line 139, in runutils.run_triggers(self.api, None, "/var/lib/cobbler/triggers/sync/post/*", logger=self.logger)File "/usr/lib/python3.6/site-packages/cobbler/utils.py", line 922, in run_triggersraise CX("Cobbler trigger failed: %s" % m.__name__)!!! TASK FAILED !!!
[root@localhost cobbler]# 

cobbler 部署相关推荐

  1. Cobbler部署指南之Cobbler安装操作系统篇

    ##################################################### ##如有转载,请务必保留本文链接及版权信息 ##欢迎广大运维同仁一起交流linux/unix ...

  2. Cobbler部署之FAQ处理

    Cobbler报错处理 通过cobbler check检查出现的报错 红色标注为报错关键信息 9.1 报错一 # cobbler check httpd does not appear to be r ...

  3. cobbler部署与示例

    文章目录 1. cobbler介绍 2. CentOS7 cobbler服务端部署与装机流程 2.1 CentOS7服务端部署 2.2 CentOS7客户端装机流程 2.2.1 新建虚拟机,手动启动后 ...

  4. cobbler介绍与部署

    cobbler介绍 Cobbler是一个Linux系统安装的服务,可以通过网络启动(PXE)的方式来快速安装.重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等. Cobbler可以使用命令行方 ...

  5. VMWare 虚拟机, CentOS7环境下 部署Cobbler (含web)

    目录 1.环境准备 2 cobbler部署 2.1 关闭seLinux 2.2 安装依赖软件 2.3 修改cobbler配置文件 2.3.1 设置cobbler server ip 2.3.2 设置c ...

  6. 自动化运维系列之Cobbler (资源)

    2019独角兽企业重金招聘Python工程师标准>>> 下图为开源自动化运维体系链: 1.cobbler实现自动装机 2.saltstack实现工程自动化配置 3.kubernete ...

  7. Centos6上安装cobbler及cobbler常见参数详解

    前言 Cobbler是一个自动化和简化系统安装的工具,通过使用网络引导来控制和启动安装.Cobbler的特性包括存储库镜像.Kickstart模板和连接电源管理系统.使用Cobbler之前需要先了解下 ...

  8. 自动化运维之–Cobbler

    Cobbler 自动化 Cobbler简介 Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows.该工具使用python开发,小巧轻便(才15k行pytho ...

  9. 批量安装系统工具cobbler配置

    Cobbler部署指南之配置管理 四.配置管理Cobbler 4.1 Cobbler命令说明 命令名称 命令用途 cobbler check 检查cobbler配置 cobbler list 列出所y ...

  10. x3650 M4 usb cobbler PXE install linux system 使用网络装系统问题,及解决方法

    今天使用cobbler 进行网络装系统,我确认我的cobbler 部署的没有错误,因为用它给我的笔记本装系统是没问题的,但在给x3650 M4 装系统时居然报了下面错误: Trying to allo ...

最新文章

  1. 设置树莓派的无线网卡为监听模式(monitor)
  2. Oracle-No.04 Oracle视图加主键解决hibernate复合主键问题
  3. 对微服务监控系统分层和监控架构的理解
  4. matlab的函数要写在哪,matlab函数库在哪
  5. 十分钟释疑Oracle中“小表超慢”之谜(SQL调优/SQL优化)
  6. Git工具项目管理的基础使用方式(GitHub同步方式)
  7. form表单提交大量input,php接收不全
  8. LwIP协议栈的学习与应用
  9. winxp netbeui install
  10. Arduino开发板使用TFT LCD液晶显示屏的终极新手入门指南
  11. vue组件中ctrl键和shift键操作多选
  12. 一键查询自己名下所有微信账户
  13. 《计算机系统与网络安全技术》一页纸开卷/期末复习内容
  14. (一)淘宝首页的代码(周六一天敲出来的)html结构展示
  15. h5与原生app交互的原理
  16. 如何查询电脑系统和服务器地址,如何查询电脑系统和服务器地址
  17. BootStrap bootstrap日历控件
  18. 条形码识别(4)——校验
  19. IT技术晋级之路-桌面管理
  20. 一样的歌 不一样的感觉

热门文章

  1. 计算机丢失lua51dll怎么修复,lua51.dll
  2. 微积分是研究连续变化的数学理论
  3. IDEA几款不错的基于Darcula的深色主题
  4. 【keil5】安装及注册
  5. php代码审计工具+seay,代码审计利器-Seay源代码审计系统
  6. css 设置浏览器最小宽度
  7. 修正oracle错误,oracle数据库菜鸟教程 [数据库中一个常见错误信息诊断与修正]
  8. Win10系统利用注册表完美设置桌面图标的技巧
  9. MD文件阅读工具及配置
  10. python webkit内核_GitHub - yunate/wke: 基于Webkit精简的纯C接口的浏览器内核,可用于桌面UI、浏览器。...