Linux运维自动化之Cobbler安装部署RHEL7.0

一、简介

Cobbler 可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会。

网络安装服务器套件 Cobbler(补鞋匠)从前,我们一直在做装机民工这份很有前途的职业。自打若干年前 Red Hat 推出了 Kickstart,此后我们顿觉身价倍增。不再需要刻了光盘一台一台地安装 Linux,只要搞定 PXE、DHCP、TFTP,还有那满屏眼花缭乱不知所云的 Kickstart 脚本,我们就可以像哈里波特一样,轻点魔棒,瞬间安装上百台服务器。这一堆花里胡哨的东西可不是一般人都能整明白的,没有大专以上学历,通不过英语四级, 根本别想玩转。总而言之,这是一份多么有前途,多么有技术含量的工作啊。

很不幸,Red Hat 最新(Cobbler项目最初在2008年左右发布)发布了网络安装服务器套件 Cobbler(补鞋匠),它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会。对于我们这些在装机领域浸淫多年,经验丰富,老骥伏枥,志在千里的民工兄弟们来说,不啻为一个晴天霹雳。

——————————————–分割线——————————————————

系统环境

实验环境:VMware Workstation 11

系统平台:RHEL7

网络模式:NAT(使用本地DHCP)

Cobbler版本:2.6.9.

网段:192.168.27.0

本机IP:192.168.27.131

防火墙已关闭/iptables: Firewall is not running.

SELINUX=disabled

——————————————–分割线——————————————————

前期准备

所需要用到的服务:EPEL、DHCP、TFTP、HTTP、VSFTP

注:EPEL (Extra Packages for Enterprise Linux,企业版Linux的额外软件包) 是Fedora小组维护的一个软件仓库项目,为RHEL/CentOS提供他们默认不提供的软件包。这个源兼容RHEL及像CentOS和Scientific Linux这样的衍生版本。

1.配置本地yum仓库,挂载光盘镜像

[root@linuxidc 桌面]#vim /etc/yum.repos.d/rhel7.repo

[rhel7]

name=rhel7

basurel=file:///mnt

enabled=1

gpgcheck=0

将光盘挂载到/mnt中

[root@linuxidc 桌面]#mount /dev/cdrom /mnt

2.安装EPEL

要想安装EPEL,我们先要下载EPEL的rpm安装包。

CentOS7/RHEL7的下载页面如下,版本不用担心一般都能用,不一定非要用我这个版本,根据你们不同版本的操作系统选择自己合适的包。

通过以下命令安装EPEL 软件包

[root@linuxidc 桌面]#rpm -ivh epel-release-6-8.noarch.rpm

安装好EPEL 源后,用yum 命令来检查是否添加到源列表

[root@linuxidc 桌面]# yum repolist已加载插件:langpacks, product-id, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.源标识 源名称 状态epel/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 8,477rhel7 rhel7 4,305repolist: 12,782

——————————————–分割线——————————————————

安装Cobbler-Web 界面和DHCP

Cobbler 提供了一个很有用的 Web 界面,您可以通过该界面实现此目的。要使用这个界面,首先需要安装它的程序包:

[root@linuxidc 桌面]#yum -y install cobbler-web

上面这个步骤可能会出现依赖包问题,解决方案见文章底下的解决方案。

安装完成后系统会给你安装以下所有的包,如果有的包没有安装上,还请手动安装

已安装:

cobbler-web.noarch 0:2.6.9-1.el7

作为依赖被安装:

[root@linuxidc 桌面]# yum -y install dhcp

——————————————–分割线——————————————————

命令配置Cobbler

一、重启cobbler服务

[root@linuxidc 桌面]#systemctl enable cobblerd.service

[root@linuxidc 桌面]#systemctl start cobblerd.service

[root@linuxidc 桌面]#systemctl enable httpd

[root@linuxidc 桌面]#systemctl start httpd

——————————————————————————————————–

二、检查cobbler配置

执行检查配置命令

[root@linuxidc 桌面]#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 : file /etc/xinetd.d/rsync does not exist

6 : debmirror package is not installed, it will be required to manage debian deployments and repositories

每天告诉自己一次,『我真的很不错』

Linux运维自动化之Cobbler安装部署RHEL7.0

相关文章:

你感兴趣的文章:

标签云: