Cobbler无人值守安装centos7.7

Cobbler简介

Cobbler是通过将DHCP、TFTP、DNS、HTTP等服务进行集成,创建一个中央管理节点,其可以实现的功能有配置服务,创建存储库,解压缩操作系统媒介,代理或集成一个配置管理系统,控制电源管理等。 Cobbler的最终目的是实现无需进行人工干预即可安装机器。在进行进一步的操作之前,我们有必要先了解下pxe和kickstart 。

Cobbler是一个快速网络安装linux的服务,而且在经过调整也可以支持网络安装windows。该工具使用python开发,小巧轻便(才15k行python代码),使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP、DNS、TFTP、RSYNC以及yum仓库、构造系统ISO镜像。 Cobbler支持命令行管理,web界面管理,还提供了API接口,可以方便二次开发使用。 Cobbler客户端Koan支持虚拟机安装和操作系统重新安装,同时支持服务器的电源管理,使重装系统更便捷。更多内容可以查看cobbler官方网站!

cobbler官方网站

Cobbler功能:
pxe支持
dhcp管理
dns服务管理(bind,dnsmasq)
电源管理
kickstart支持
yum仓库管理
tftp(pxe启动时需要)
apache,提供ks得安装源,并提供定制化得ks配置,同时,它和apache做了深度整合,通过cobbler,可以使redhat/centos/fedora系统得快速部署,同时也支持suse、debian(ubuntu)系统,通过配置开可以支持windows

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

Client端
客户端以PXE模式启动
客户端获取IP地址
通过TFTP服务器获取启动文件
进入Cobbler安装选择界面
根据配置信息准备安装系统
加载Kickstart文件
传输系统安装的其它文件
进行安装系统

collber命令帮助
cobbler check 核对当前设置是否有问题
cobbler list 列出所有的cobbler元素
cobbler report 列出元素的详细信息
cobbler sync 同步配置到数据目录,更改配置最好都执行一下
cobbler reposync 同步yum仓库
cobbler distro 查看导入的发行版系统信息
cobbler system 查看添加的系统信息
cobbler profile 查看配置信息
在这里插入图片描述

安装

[root@ c7-43 ~]# yum -y install cobbler cobbler-web tftp-server pykickstart httpd dhcp xinetd debmirror

cobbler        #cobbler程序包
cobbler-web     #cobbler的web服务包
pykickstart    #cobbler检查kickstart语法错误
httpd      	#Apache web服务
dhcp       #Dhcp服务
tftp      #tftp服务
xinetd  #诸多服务的超级守护进程

[root@ c7-43 ~]# systemctl start httpd cobblerd		#启动
[root@ c7-43 ~]# systemctl status httpd cobblerd	#查看状态
[root@ c7-43 ~]# systemctl enable httpd cobblerd	¥设置开机自启

配置cobbler

检查cobbler的配置,如果没有下面的结果,请重启尝试

[root@ c7-43 ~]# cobbler check
The 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/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 set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
9 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Restart cobblerd and then run 'cobbler sync' to apply changes.

出现上面的问题,请一一解决,先进行设置为动态设置,也可以直接更改配置文件

[root@ c7-43 ~]# sed -ri '/allow_dynamic_settings:/c\allow_dynamic_settings: 1' /etc/cobbler/settings
[root@ c7-43 ~]# grep allow_dynamic_settings /etc/cobbler/settings
allow_dynamic_settings: 1
[root@ c7-43 ~]# systemctl restart cobblerd
[root@ c7-43 ~]# systemctl status cobblerd

逐个解决上面的问题
1、配置server地址

[root@ c7-43 ~]# cobbler setting edit --name=server --value=10.0.0.43

2、配置next_server地址

[root@ c7-43 ~]# cobbler setting edit --name=
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值