自动化运维之Cobbler部署系统(2)

cobbler可以手动编译安装,也可以基于yum源的安装,如果使用yum源安装,则需要配置epel源epel源可以通过下载官网的epel源的目录来实现https://fedoraproject.org/wiki/EPEL

1 # yum -y install cobbler cobbler-web pykickstart debmirror

2、检查配置文件,需要在启动cobblerd和httpd服务的前提下检查

[root@c3 ~]# service httpd start
[root@c3 ~]# service cobblerd start
[root@c3 ~]# 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 : 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.
4 : change 'disable' to 'no' in /etc/xinetd.d/rsync
5 : comment out 'dists' on /etc/debmirror.conf for proper debian support
6 : comment out '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.

以上8个问题的解决方法

1.修改/etc/cobbler/settings文件中的server参数的值为提供cobbler服务的主机对应的ip地址

server: 192.168.13.8

2.修改/etc/cobbler/settings文件的next_server参数的值为提供PXE服务的主机的ip

next_server: 192.168.13.8

3.如果当前节点可以访问互联网,执行“cobbler get-loaders”命令下载pxelinux.0,menu.c32,elibo.efi,yaboot文件,否则则需要安装syslinux程序包,复制/usr/share/syslinux/中的pxelinux.0,menu.c32等文件至/var/lib/cobbler/loaders目录中

4.将/etc/xinetd.d/rsync 中的disable改为no,或者执行 chkconfig rsync on

5.注释/etc/debmirror.conf文件中的“@dists="sid";”一行

6.注释/etc/debmirror.conf文件中的“@arches="i386";”一行

7.执行“openssl passwd -1 -salt `pensshl rand -hex 4`”生成密码,并将密码串替换掉/etc/cobbler/settings中的default_password_crypted

default_password_crypted: "$1$6a385fbf$iOHgbfJ0BJRQh78yAMA2L1"

8.安装cam和fence-agents来实现电源管理

同步数据

[root@c3 cobbler]# cobbler sync
task started: 2014-04-06_224909_sync
task started (id=Sync, time=Sun Apr  6 22:49:09 2014)
running pre-sync triggers
cleaning trees
mkdir: /var/lib/tftpboot/pxelinux.cfg
mkdir: /var/lib/tftpboot/grub
mkdir: /var/lib/tftpboot/s390x
mkdir: /var/lib/tftpboot/ppc
mkdir: /var/lib/tftpboot/etc
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
trying hardlink /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7bb170524d5ef048f5da222eb7d9b4cb.html