# yum install cobbler cobbler-web pykickstart debmirror
# service httpd start
# service cobblerd start
执行“cobbler check 命令检查存的问题,而后逐一按提示解决之。常见的问题如下所示:
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 : 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 m essage 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.
4 : change 'disable' to 'no' in /etc/xinetd.d/rsync
5 : comment 'dists' on /etc/debmirror.conf for proper debian support
6 : comment 'arches' on /etc/debmirror.conf for proper debian support
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 地址或主机名,如172.16.100.15;
2、修改/etc/cobbler/settings 文件中的next_server 参数的值为提供PXE 服务的主机相应的IP 地址,如172.16.100.16;
3、如果当前节点可以访问互联网,执行“cobbler get-loaders”命令即可;否则,需要安装syslinux 程序包,而后复制/usr/share/syslinux/{pxelinux.0,memu.c32}等文件/var/lib/cobbler/loaders/目录中;
4、执行“chkconfig rsync on”命令即可;
5、注释/etc/debmirror.conf 文件中的“@dists="sid";”一行;
6、注释/etc/debmirror.conf 文件中的“@arches="i386";”一行;
7、执行“openssl passwd -1 -salt $(openssl rand -hex 4)”生成密码,并用其替换/etc/cobbler/settings 文件中default_password_crypted 参数的值;
8、执行“yum install cman fence-agents”命令安装相应的程序包即可;接着重启cobblerd,而后执行“cobbler sync”同步新的配置至cobbler。
二、配置及启动cobbler 所依赖的各服务
cobbler 的运行依赖于dhcp、tftp、rsync 及dns 服务。其中dhcp 可由dhcpd(isc)提供,也可由dnsmasq 提供;tftp 可由tftp-server 程序包提供,也可由cobbler 自带的tftp 功能提供;rsync 由rsync 程序包提供;dns 可由bind 提供,也可由dnsmasq 提供。cobbler 可自行管理这些服务中的部分甚至是全部,但需要配置/etc/cobbler/settings 文件中的“manage_dhcp”、“manage_tftpd”、“manage_rsync”和“manage_dns”分别进行定义。另外,由于每种服务都有着不同的实现方式,如若需要进行自定义,需要通过/etc/cobbler/modules.conf 配置文件中各服务的模块参数的值来实现。
本文采用了独立管理的方式,即不通过cobbler 来管理这些服务。
2.1 配置dhcp 服务
定义好所需的“subnet”及其它参数或选项,而后启动dhcpd 守护进程即可。本示例中所用的dhcpd 的配置如下所示:
# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.120 192.168.1.140;
option routers 192.168.1.114;
}
next-server 192.168.1.114;
filename="pxelinux.0";
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.