部署cobbler1——未进入系统之前配置

本文档详细介绍了在cobbler部署过程中需要注意的步骤,包括安装必要的包,配置cobbler服务,设置next_server,启用xinetd服务,下载加载器,启用rsyncd服务,安装pykickstart,修改默认密码,安装fencing工具,以及管理dhcp。在配置完成后,通过cobbler sync应用更改。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下对cobbler部署的操作,只是提供一个启动模型,还没进入系统

部署环境:防火墙关闭,selinx关闭,有epel源

装包:epel-release cobbler cobbler-web tftp-server dhcp httpd xinetd

启服务:[root@localhost ~]# systemctl start httpd cobblerd.service
[root@localhost ~]# cobbler check                                    //可以看到有9条需要配置
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.

需配置:

[root@localhost ~]# sed -ri '/allow_dynamic_settings:/c\allow_dynamic_settings: 1' /etc/cobbler/settings   //针对server需要先将动态设为1
[root@localhost ~]# cobbler setting edit --name=server --value=192.168.122.139          //可以使用cobbler,也可以用sed改,本机ip为192.168.122.139


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.

需配置:[root@localhost ~]# cobbler setting edit --name=next_server --value=192.168.122.139


3 : change 'disable' to 'no' in /etc/xinetd.d/tftp

需配置:

[root@localhost ~]# sed -r '/disable/c\disable = no' /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.

需配置:

[root@localhost ~]# cobbler get-loaders                //需要下载文件

[root@localhost ~]# ls /var/lib/cobbler/loaders/
COPYING.elilo     COPYING.yaboot  grub-x86_64.efi  menu.c32    README
COPYING.syslinux  elilo-ia64.efi  grub-x86.efi     pxelinux.0  yaboot                          //下载后会看到这写文件

5 : enable and start rsyncd.service with systemctl

需配置:

[root@localhost ~]# systemctl enable rsyncd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/rsyncd.service to /usr/lib/systemd/system/rsyncd.service.
[root@localhost ~]# systemctl start rsyncd.service

6 : debmirror package is not installed, it will be required to manage debian deployments and repositories

需配置:因为不是debian系统,这个可以不安装


7 : ksvalidator was not found, install pykickstart

需配置:[root@localhost ~]# yum -y install pykickstart


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

需配置:[root@localhost ~]# openssl passwd -1 -salt 'mima' 'kailey'          
$1$mima$A1tJFAnGOOPOV2YIFiQiC/                                                  //用提示的命令生成一个密令,将它放在需要的地方,salt 是为密码指定一个岩,只要岩不同(密码可相同),密令就不同

或者可以随即生成一个岩

[root@localhost ~]# openssl passwd -1 -salt `openssl rand -hex 4` 'kailey'
$1$73f90ef9$TgPhLZakjYkr4NMB.AD7n/

[root@localhost ~]# cobbler setting edit --name=default_password_crypted --value='$1$mima$A1tJFAnGOOPOV2YIFiQiC/'


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

需配置:[root@localhost ~]# yum -y install fence-agents              //安装哪个都可以

配置先不要重启,还有一项cobbler中没有配置:

manage_dhcp:
cobbler setting edit --name=manage_dhcp --value=1          //当然这个也可以暂时不设定

修改dhcp文件,一下是我的做法:

[root@localhost ~]# cat /etc/cobbler/dhcp.template

subnet 192.168.122.0 netmask 255.255.255.0 {
     #option routers             192.168.1.5;                         //我是将前两项注释掉了,将涉及网段的改为我主机所在网段,也可以不改,但后面可能会有错误
     #option domain-name-servers 192.168.1.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.122.100 192.168.122.254;
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;

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

按照命令重启cobblerd 并运行cobbler sync 进行同步

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值