Linux Ubuntu [[Cobbler]] Cobbler 安装与配置 Cobbler 介绍 Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等。
Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。
Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。
Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。
安装 以下操作,皆在 CentOS Linux release 7.7.1908 (Core) 实现。
检测基础环境 # 查看 selinux 和防火墙是否关闭 [root@Cobbler ~] getenforce Disabled [root@Cobbler ~] systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) 如果 getenfore 的结果不是 Disabled,那么根据 getenforce命令 去关闭 SELinux。
更新yum源 [root@Cobbler ~] curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo [root@Cobbler ~] curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo [root@Cobbler ~] yum clean all [root@Cobbler ~] yum makecache 安装 cobbler [root@Cobbler ~] yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd 启动服务 [root@Cobbler ~] systemctl start httpd.service [root@Cobbler ~] systemctl start cobblerd.service cobbler check [root@Cobbler ~] cobbler check 配置 cobbler 开机自启 $ chkconfig httpd on $ chkconfig cobblerd on $ chkconfig dhcpd on $ /etc/init.d/httpd restart $ /etc/init.d/cobblerd restart $ /etc/init.d/dhcpd restart 配置 cobbler [root@Cobbler ~] 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. 上面指出了八项问题,逐一解决。
...