安装Cobbler
1,安装cobbler相关软件包
yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd xinetd
2,启动httpd和cobblerd服务并设置自动启动
systemctl start httpd
systemctl start cobblerd
systemctl enable httpd
systemctl enable cobblerd
3,运行cobbler check检查存在的问题
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 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : 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
8 : 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.
解决上述问题的方法如下: 问题1:修改/etc/cobbler/settings文件中的server参数的值为提供cobbler服务的主机相应的IP地址或 主机名 sed -i 's/server: 127.0.0.1/server: 172.16.60.2/' /etc/cobbler/settings 问题2:修改/etc/cobbler/settings文件中的next_server参数的值为提供PXE服务的主机相应的IP地址 sed -i 's/next_server: 127.0.0.1/next_server: 172.16.60.2/' /etc/cobbler/settings 问题3:修改/etc/xinetd.d/tftp文件中的disable参数修改为disable = no sed -i 's#yes#no#' /etc/xinetd.d/tftp 问题4:执行cobbler get-loaders命令即可;否则,需要安装syslinux程序包,而后复制/usr/share/sys linux/{pxelinux.0,memu.c32}等文件至/var/lib/cobbler/loaders/目录中 cobbler get-loaders 问题5:启动rsyncd服务并设置自动启动 systemctl start rsyncd systemctl enable rsyncd 问题6:如果不是部署debian系统,这一项可以忽略。如需解决,安装debmirror,然后注释掉下面两项, 否则会报错。 yum –y install debmirror comment out 'dists' on /etc/debmirror.conf for proper debian support
comment out 'arches' on /etc/debmirror.conf for proper debian support 问题7:生成新的密码来取代默认的密码,"random-phrase-here" = 随机的干扰码, "your-password-here" = 新密码, sed -ri "/default_password_crypted/s#(.*: ).*#\1\"`openssl passwd -1 -salt 'cobbleradmin' '123456'`\"#" /etc/cobbler/settings 问题8:安装cman fence-agents yum –y install cman fence-agents 完成以上操作后,执行以下操作: 1,重启cobblerd服务 systemctl restart cobblerd 2,执行cobbler sync 进行同步,否由配置不生效 cobbler sync 3,运行cobbler check检查存在的问题,如下提示配置正确 [root@cobbler ~]# cobbler check
No configuration problems found. All systems go.
[root@cobbler ~]#