广告
返回顶部
首页 > 资讯 > 操作系统 >Linux系统中如何安装Cobbler自动化部署
  • 546
分享到

Linux系统中如何安装Cobbler自动化部署

2023-06-27 17:06:35 546人浏览 薄情痞子
摘要

这篇文章将为大家详细讲解有关linux系统中如何安装Cobbler自动化部署,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装

这篇文章将为大家详细讲解有关linux系统中如何安装Cobbler自动化部署,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows。该工具使用python开发,小巧轻便,使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP、DNS、以及yum仓库、构造系统ISO镜像。

Linux系统中如何安装Cobbler自动化部署

搭建 Cobbler 无人值守安装服务器

1 环境初始化

Cobbler 服务端:Centos Linux release 7.6.1810 Cobbler 服务端对内存的要求不高,只要能把Cobbler服务跑起来就行。 Linux系统中如何安装Cobbler自动化部署

#关闭 selinux 和防火墙[root@Jaking ~]# systemctl stop firewalld.service && systemctl disable firewalld.service && iptables -F && setenforce 0#永久关闭 selinux 执行下面命令[root@Jaking ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
2 安装配置 Cobbler

首先安装 epel-release,Cobbler 和 tftp-server 在 base 源中是没有的

[root@Jaking ~]# yum install -y epel-release

安装 Cobbler 其实有一部分软件会被当做依赖进行安装上去,比如 tftp 和 Httpd 服务,我们这里为了方便可以一并安装,避免后续出现相关问题。

[root@Jaking ~]# yum install -y cobbler cobbler-WEB dhcp tftp-server pykickstart httpd rsync xinetd

注意:必须把yum源配好,否则无法全部安装以上软件!

[root@Jaking ~]# vim /etc/yum.repos.d/CentOS-Base.repo#在CentOS-Base.repo配置文件中添加以下源[aliyun-os]name=aliyun-osbaseurl=https://mirrors.aliyun.com/centos/7/os/x86_64/enabled=1gpGCheck=0[aliyun-epel]name=aliyun-epelbaseurl=https://mirrors.aliyun.com/epel/7/x86_64/enabled=1gpgcheck=0[aliyun-extra]name=aliyun-extrabaseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/enabled=1gpgcheck=0

软件作用说明

cobbler #Cobbler 程序包cobbler-web #Cobbler 的 Web 服务包pykickstart #Cobbler 检查 kickstart 语法错误httpd #Apache Web 服务

Cobbler 工作目录介绍

[root@Jaking ~]# ls /etc/cobbler/auth.conf         genders.template        named.template  secondary.template  zone.templatecheetah_Macros    import_rsync_whitelist  power           settings            zone_templatescobbler_bash      iso                     pxe             tftpd.templatecompletions       ldap                    reporting       users.confdhcp.template     modules.conf            rsync.exclude   users.digestdnsmasq.template  mongodb.conf            rsync.template  version/etc/cobbler # 配置文件目录/etc/cobbler/settings # Cobbler 主配置文件,这个文件是 YAML 栺式,Cobbler 是 python 写的程序。/etc/cobbler/dhcp.template # DHCP服务的配置模板/etc/cobbler/tftpd.template # tftp 服务的配置模板/etc/cobbler/rsync.template # rsync 服务的配置模板/etc/Cobbler/iso # iso 模板配置文件目录/etc/cobbler/pxe # pxe 模板文件目录/etc/cobbler/power # 电源的配置文件目录/etc/cobbler/users.conf # Web 服务授权配置文件/etc/cobbler/users.digest # 用于 Web 访问的用户名密码配置文件/etc/cobbler/dnsmasq.template # DNS 服务的配置模板/etc/cobbler/modules.conf # Cobbler 模块配置文件/var/lib/cobbler # Cobbler 数据目录/var/lib/cobbler/config # 配置文件/var/lib/cobbler/kickstarts # 默认存放 kickstart 文件/var/lib/cobbler/loaders # 存放的各种引导程序/var/www/cobbler # 系统安装镜像目录/var/www/cobbler/ks_mirror # 导入的系统镜像列表/var/www/cobbler/images # 导入的系统镜像启动文件/var/www/cobbler/repo_mirror # yum 源存储目录/var/log/cobbler # 日志目录/var/log/cobbler/install.log # 客户端系统安装日志/var/log/cobbler/cobbler.log # Cobbler 日志

首先启动 Cobbler 和 httpd 服务

[root@Jaking ~]# systemctl start cobblerd httpd

检查配置

[root@Jaking ~]# cobbler checkThe following are potential configuration items that you may want to fix: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/tftp4 : 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 systemctl6 : debmirror package is not installed, it will be required to manage debian deployments and repositories7 : The default passWord used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one8 : 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.

以上问题我们需要逐步解决。

问题 1:修改 server 地址为 192.168.1.7

[root@Jaking ~]# vim /etc/cobbler/settings改:390 server: 127.0.1为:390 server: 192.168.1.7

问题 2:修改 next_server 地址为 192.168.1.7

[root@Jaking ~]# vim /etc/cobbler/settings改:278 next_server: 127.0.1为:278 next_server: 192.168.1.7

问题 3:修改 tftp 服务被 xinetd 服务管理

[root@Jaking ~]# vim /etc/xinetd.d/tftp改:14 disable = yes为:14 disable = no顺便修改 xinetd 和 tftpd 服务开机启动[root@Jaking ~]# systemctl start xinetd tftp && systemctl enable xinetd tftp

问题 4:下载操作系统引导文件

[root@Jaking ~]# cobbler get-loaderstask started: 2020-01-04_031204_get_loaderstask started (id=Download Bootloader Content, time=Sat Jan  4 03:12:04 2020)downloading https://cobbler.GitHub.io/loaders/README to /var/lib/cobbler/loaders/READMEdownloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilodownloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yabootdownloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinuxdownloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efidownloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yabootdownloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efidownloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi*** TASK COMPLETE ***

问题 5:修改 rsyncd 服务为开机自启动状态并启用它。

[root@Jaking ~]# systemctl start rsyncd && systemctl enable rsyncd

问题 6:关于 debian 相关部署管理配置,忽略。

debmirror package is not installed, it will be required to manage debiandeployments and repositories # debmirror 包尚未安装,需要它来管理 debian 部署和存储库

问题 7:修改操作系统默认密码

[root@Jaking ~]# openssl passwd -1 -salt 'root' '123456'$1$root$j0bp.KLPyr.u9kgQ428D10[root@Jaking ~]# vim /etc/cobbler/settings改:101 default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac."为:101 default_password_crypted: "$1$root$j0bp.KLPyr.u9kgQ428D10"注:root 为用户描述,123456 为密码

问题 8:电源管理相关服务,忽略。

fencing tools were not found, and are required to use the (optional) powermanagement features. install cman or fence-agents to use them

修改完以上配置就可以检查 DHCP 配置了,由于 Cobbler 自动管理 DHCP 服务,我们只需要修改 Cobbler 中的模板配置文件即可。

[root@Jaking ~]# vim /etc/cobbler/dhcp.template改:22 option routers 192.168.1.5; #修改默认网关地址为:22 option routers 192.168.1.1; #以实际的网关为准改:23 option domain-name-servers 192.168.1.1; #修改 DNS 地址为:23 option domain-name-servers 114.114.114.114;如下:21 subnet 192.168.1.0 netmask 255.255.255.0 {22      option routers             192.168.1.1;23      option domain-name-servers 114.114.114.114;24      option subnet-mask         255.255.255.0;25      range dynamic-bootp        192.168.1.100 192.168.1.254;26      default-lease-time         21600;27      max-lease-time             43200;28      next-server                $next_server;

注:配置默认为 192.168.1.0 网段,具体要看你的装机 vlan 划分,现在是实验环境所以保持配不变。 注:默认网关地址为 192.168.1.5,这里需要改成你自己局域网中的网关。 $next_server 为变量值为我们前面修改的主配置文件中的地址 192.168.1.7

修改 Cobbler 管理 dhcp 服务

[root@Jaking ~]# vim /etc/cobbler/settings改:242 manage_dhcp: 0为:242 manage_dhcp: 1

同步配置文件,需要先重启 Cobblerd

[root@Jaking ~]# systemctl restart cobblerd[root@Jaking ~]# cobbler synctask started: 2020-01-04_032552_synctask started (id=Sync, time=Sat Jan  4 03:25:52 2020)running pre-sync triggerscleaning treesremoving: /var/lib/tftpboot/grub/imagescopying bootloaderstrying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboottrying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisktrying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efitrying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.eficopying distros to tftpbootcopying imagesgenerating PXE configuration filesgenerating PXE menu structurerendering DHCP filesgenerating /etc/dhcp/dhcpd.confrendering TFTPD filesgenerating /etc/xinetd.d/tftpcleaning link cachesrunning post-sync triggersrunning Python triggers from /var/lib/cobbler/triggers/sync/post/*running python trigger cobbler.modules.sync_post_restart_servicesrunning: dhcpd -t -qreceived on stdout:received on stderr:running: service dhcpd restartreceived on stdout:received on stderr: Redirecting to /bin/systemctl restart dhcpd.servicerunning shell triggers from /var/lib/cobbler/triggers/sync/post/*running python triggers from /var/lib/cobbler/triggers/change/*running python trigger cobbler.modules.manage_gendersrunning python trigger cobbler.modules.scm_trackrunning shell triggers from /var/lib/cobbler/triggers/change/**** TASK COMPLETE ***

注意观察 DHCP 服务是否启动。

重新检查,剩下 2 个可以忽略的问题。

[root@Jaking ~]# cobbler checkThe following are potential configuration items that you may want to fix:1 : debmirror package is not installed, it will be required to manage debian deployments and repositories2 : 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.

导入镜像以及配置

添加镜像

Linux系统中如何安装Cobbler自动化部署
搭建 Cobbler 无人值守安装服务器搭建 Cobbler 无人值守安装服务器
Linux系统中如何安装Cobbler自动化部署

挂载光驱

[root@Jaking ~]# mount /dev/sr0 /mnt

导入镜像(时间较长)

[root@Jaking ~]# cobbler import --path=/mnt/ --name=CentOS-7.6 --arch=x86_64task started: 2020-01-04_033346_importtask started (id=Media import, time=Sat Jan 4 03:33:46 2020)Found a candidate signature: breed=redhat, version=rhel6Found a matching signature: breed=redhat, version=rhel6Adding distros from path /var/www/cobbler/ks_mirror/CentOS-7.6-x86_64:creating new distro: CentOS-7.6-x86_64trying symlink: /var/www/cobbler/ks_mirror/CentOS-7.6-x86_64 -> /var/www/cobbler/links/CentOS-7.6-x86_64creating new profile: CentOS-7.6-x86_64associating reposchecking for rsync repo(s)checking for rhn repo(s)checking for yum repo(s)starting descent into /var/www/cobbler/ks_mirror/CentOS-7.6-x86_64 for CentOS-7.6-x86_64processing repo at : /var/www/cobbler/ks_mirror/CentOS-7.6-x86_64need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-7.6-x86_64looking for /var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/repodata/*comps*.xmlKeeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/repodata*** TASK COMPLETE ***

查看镜像,上面是镜像名称,下面是启动菜单。

[root@Jaking ~]# cobbler listdistros:CentOS-7.6-x86_64profiles:CentOS-7.6-x86_64

同步 Cobbler 配置

[root@Jaking ~]# systemctl restart cobblerd[root@Jaking ~]# cobbler sync

关于“Linux系统中如何安装Cobbler自动化部署”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

--结束END--

本文标题: Linux系统中如何安装Cobbler自动化部署

本文链接: https://www.lsjlt.com/news/311915.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Linux系统中如何安装Cobbler自动化部署
    这篇文章将为大家详细讲解有关Linux系统中如何安装Cobbler自动化部署,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装...
    99+
    2023-06-27
  • Linux系统如何部署Cobbler服务
    小编给大家分享一下Linux系统如何部署Cobbler服务,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!Cobbler是一个Linux系统安装的服务,可以通过网络...
    99+
    2023-06-28
  • PXEkickstart自动化部署系统安装
    目录准备环境第一步:安装DHCP服务第二步:安装tftp服务第三步:安装Apache网站服务第四步:编写ks文件第五步:创建客户机,测试安装准备环境 系统:centos7.4.170...
    99+
    2022-11-13
  • 基于cobbler 实现自动安装linux系统
    1.安装个组件 yum install epel-rpm-macros.noarch -y #安装epel源 yum install -y cobbler cobbler-web dhcp tftp-server p...
    99+
    2022-06-04
    cobbler 安装linux linux系统安装
  • PXE kickstart自动化部署系统安装
    目录准备环境第一步:安装DHCP服务第二步:安装tftp服务第三步:安装Apache网站服务第四步:编写ks文件第五步:创建客户机,测试安装准备环境 系统:centos7.4.1708 ip地址:eth0:192.168...
    99+
    2022-06-05
    PXEkickstart自动化部署 PXEkickstart安装
  • Ubuntu系统下如何安装自动化部署工具puppet
    本篇内容介绍了“Ubuntu系统下如何安装自动化部署工具puppet”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!1.设置主机文件在本教程里...
    99+
    2023-06-13
  • MySQL如何自动化安装部署
    这篇文章给大家分享的是有关MySQL如何自动化安装部署的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。1、制作符合自己需求的RPM包我们要根据MySQL的源码编译符合企业需求的RP...
    99+
    2022-10-18
  • PXE kickstart自动化部署系统安装的方法
    本文小编为大家详细介绍“PXE kickstart自动化部署系统安装的方法”,内容详细,步骤清晰,细节处理妥当,希望这篇“PXE kickstart自动化部署系统安装的方法”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢...
    99+
    2023-06-29
  • PXE如何实现自动化部署Linux系统介绍
    目录背景说明配置DHCP编辑DHCP文件(动态主机配置协议)tftp配置syslinux配置配置httpd配置无人值守背景说明 在数据中心,一次几十台甚至几百台服务器上线,系统安装将变得非常麻烦,系统安装好了,还会涉及很...
    99+
    2022-06-04
    PXE方式自动化部署安装Linux
  • linux系统Ansible自动化运维部署方法
    ansible是新出现的 自动化 运维工具 , 基于python研发 。 整合了众多老牌运维工具的优点实现了批量操作系统配置、批量程序的部署、批量运行命令等功能,下面就看...
    99+
    2022-06-04
    linux Ansible 自动化
  • PXE怎么实现自动化部署Linux系统
    本篇内容主要讲解“PXE怎么实现自动化部署Linux系统”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“PXE怎么实现自动化部署Linux系统”吧!背景说明在数据中心,一次几十台甚至几百台服务器上...
    99+
    2023-06-22
  • 如何在Linux中安装部署模块化系统监控工具Hegemon
    如何在Linux中安装部署模块化系统监控工具Hegemon,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。Linux系统中有top,htop,atop等命令用来监控系统,它们提供...
    99+
    2023-06-28
  • linux中如何部署安装mongodb
    这篇文章给大家分享的是有关linux中如何部署安装mongodb的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。文档目的在Linux系统中安装Mongodb应用程序,并设置基本的安...
    99+
    2022-10-19
  • Linux中如何部署自动化运维工具ansible
    小编给大家分享一下Linux中如何部署自动化运维工具ansible,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!ansible是新出现的自动化运维工具,基于Pyt...
    99+
    2023-06-27
  • Linux系统中如何部署thinkphp
    这篇文章将为大家详细讲解有关Linux系统中如何部署thinkphp,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。ThinkPHP是为了简化企业级应用开发和敏捷WEB应用开发而诞生国产PHP开发框架,下面...
    99+
    2023-06-28
  • Linux系统中如何部署Docker
    这篇文章给大家分享的是有关Linux系统中如何部署Docker的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。Docker 是一个开源的应用容器引擎,可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中...
    99+
    2023-06-28
  • 如何安装和配置pm2实现自动化部署node项目
    小编给大家分享一下如何安装和配置pm2实现自动化部署node项目,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!1、pm2简介pm2(process manager)是一个进程管理工具,维护...
    99+
    2022-10-19
  • Linux下如何使用jenkins进行自动化部署
    这篇文章主要介绍Linux下如何使用jenkins进行自动化部署,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!Jenkins是用Java语言编写的主要用于持续、自动的构建/测试软件项目、监控外部任务的运行(这个比较抽...
    99+
    2023-06-28
  • 如何实现半自动化安装CentOS系统
    这篇文章主要介绍了如何实现半自动化安装CentOS系统,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。先看一下拓扑图吧!简单的解释一下拓扑图,先在服务器端开启http服务,在h...
    99+
    2023-06-10
  • 云服务器如何部署自动交易系统
    云服务器自动交易系统是指将多个服务器组合成一个系统,以便在云服务器上执行自动化交易。 创建服务器集群: 可以使用虚拟主机创建一个专属的云服务器集群,这个集群可以包含多个云服务器,如Amazon Web Services(AWS),Mic...
    99+
    2023-10-26
    交易系统 服务器
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作