Cobbler:是一个快速网络安装Linux的工具,使用简单的命令即可完成PXE网络安装环境的配置,同时还可以管理DHCP,DNS,以及yum包镜像。Cobbler支持命令行管理,web界面管理
主要由Repository,Distribution,Profile:各部分组成分别是
Repository:mirror url
Distribution:kernek ,initrd
Profile:distribution,kickstart file ,repositories
实验内容:
1.1安装实验所需要的程序
[root@node1 ~]# yum install cobbler pykickstart debmirror
在安装cobbler时会自动安装httpd程序
1.2安装完成后启动
[root@node1 ~]# service httpd start
Starting httpd:
[root@node1 ~]# service cobblerd start
Starting cobbler daemon:
1.3检测cobbler存在哪些错误
[root@node1 ~]# cobbler check
1 : The 'server' field in /etc/cobbler/settings must be set to something other than loc alhost, or kickstarting features will not work. This should be a resolvable hostname o r 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 th e PXE network.
3 : some network boot- loaders are missing from /var/lib/cobbler/loaders, you may ru n '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.
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 (def ault_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 manageme nt 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地址或主机名和next_server参数的值为PXE服务的主机相应的IP地址
server=172.16.18.1
next_server=172.16.18.1
2,生成密码,替换默认密码
[root@node1 ~]# openssl passwd -1 -salt $(openssl rand -hex 4)”
Password: $1$d69ce09e$UNrtVcVkT.Rd5E6bSVxx8/
default_password_crypted: " $1$d69ce09e$UNrtVcVkT.Rd5E6bSVxx8/"
3,复制/usr/share/syslinux/*所有文件去/var/lib/cobbler/loaders/目录中
[root@node1 ~]# cp -r /usr/share/syslinux/* /var/lib/cobbler/loaders/
4,注释/etc/debmirror.conf中的两个参数
#@dists="sid";
#@arches="i386";
5,安装相应的程序包
yum install cman fence-agents
6,chkconfig rsync on
7,启动,检测
[root@node1 ~]# service cobblerd start
8,cobbler check 检测是否还有错误
The following are potential configuration items that you may want to fix:
1 : some network boot- loaders are missing from /var/lib/cobbler/loaders, you may ru n '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.
Restart cobblerd and then run 'cobbler sync' to apply changes.
此错误可以忽略了,我们已经将所需要的文件都复制过去了。
此时环境就算配置好了
2.1下来需要配置pxe所需要的服务。DHCP TFTP RSYNC DNS,其中dhcp tftp rsync为必须
[root@node1 ~]# yum install dhcp
[root@node1 ~]# service dhcpd start Starting dhcpd: [ OK ]
复制/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample到/etc/dhcp/dhcpd.conf覆盖原有文件,编辑