使用cobbler批量安装操作系统(基于Centos7.x )

1.1 cobbler简介

  Cobbler是一个Linux服务器安装的服务,可以通过网络启动(PXE)的方式来快速安装、重装物理服务器和虚拟机,同时还可以管理DHCP,DNS等。

  Cobbler可以使用命令行方式管理,也提供了基于Web的界面管理工具(cobbler-web),还提供了API接口,可以方便二次开发使用。

  Cobbler是较早前的kickstart的升级版,优点是比较容易配置,还自带web界面比较易于管理。

  Cobbler内置了一个轻量级配置管理系统,但它也支持和其它配置管理系统集成,如Puppet,暂时不支持SaltStack。

  Cobbler官网http://cobbler.github.io

  在使用cobbler之前需要了解kickstart的使用: http://www.cnblogs.com/clsn/p/7833333.html

1.1.1 cobbler集成的服务

    PXE服务支持

    DHCP服务管理

    DNS服务管理(可选bind,dnsmasq)

    电源管理

    Kickstart服务支持

    YUM仓库管理

    TFTP(PXE启动时需要)

    Apache(提供kickstart的安装源,并提供定制化的kickstart配置)

1.2 安装cobbler

1.2.1 环境说明

[root@Cobbler ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

[root@Cobbler ~]# uname -r
3.10.0-693.el7.x86_64

[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)

[root@Cobbler ~]# hostname -I
10.0.0.202 172.16.1.202

yum源说明:

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

1.2.2 使用yum安装cobbler

yum -y install cobbler cobbler-web dhcp tftp-server pykickstart httpd

   说明:cobbler是依赖与epel源下载

1.2.3 cobbler语法检查前先启动http与cobbler

systemctl start httpd.service
systemctl start cobblerd.service
cobbler check

1.2.4 进行语法检查

[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.

1.2.5 解决当中的报错

命令集

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值