cobbler --- 安装配置的简单介绍

1、安装 cobbler

1.1、安装前的准备
  • 安装epel源,在centos下,直接执行
]# yum install epel-release
  • 安装 cobbler 所需的配合软件:DHCP、TFTP、Apache

注:

cobbler 支持管理两种DHCP,ISC DHCP 和 dnsmasq ,通过以下命令,默认安装的是 ISC DHCP

]# yum install dhcp tftp-server httpd
  • 安装cobbler
]# yum install cobbler

注1:

实验机的配置请参考《VMware --- CentOS6.x 实验机的安装配置》

注2:

实验机所使用的操作系统版本为:CentOS release 6.6 (Final)

注3:

实验机本机 IP 为:192.168.80.20


2、配置 cobbler

2.1 执行 cobbler check
  • 启动 cobbler 和 http
]# /etc/init.d/cobblerd start
]# /etc/init.d/httpd start
]# chkconfig cobblerd on
]# chkconfig httpd on
  • 开启 cobbler 的动态配置
]# cp /etc/cobbler/settings /etc/cobbler/settings.`date +%y%m%d`.bak

]# vim /etc/cobbler/settings
allow_dynamic_settings: 0 --> 1

]# /etc/init.d/cobblerd restart
  • 检查 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 : change 'disable' to 'no' in /etc/xinetd.d/rsync
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : ksvalidator was not found, install pykickstart
8 : 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
9 : 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:

]# cobbler setting report --name=server

解决:

]# cobbler setting edit --name=server --value=192.168.80.20

问题2:

]# cobbler setting report --name=next_server

解决:

]# cobbler setting edit --name=next_server --value=192.168.80.20

问题3:

解决:

]# vim /etc/xinetd.d/tftp
disable = yes --> no

问题4: 下载网络引导文件,下载后的引导文件会存放在 /var/lib/cobbler/loaders 目录下

解决:

]# cobbler get-loaders
task started: 2015-08-19_153812_get_loaders
task started (id=Download Bootloader Content, time=Wed Aug 19 15:38:12 2015)
downloading http://cobbler.github.com/loaders/README to /var/lib/cobbler/loaders/README
downloading http://cobbler.github.com/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading http://cobbler.github.com/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading http://cobbler.github.com/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading http://cobbler.github.com/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading http://cobbler.github.com/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading http://cobbler.github.com/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
downloading http://cobbler.github.com/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading http://cobbler.github.com/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading http://cobbler.github.com/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***

问题5:

解决:

]# vim /etc/xinetd.d/rsync
disable = yes --> no

问题6: 安装 debmirror(如果没有 Debian 主机,该项为可选项)

解决:

]# yum install debmirror

# 并且在 /etc/debmirror.conf 中注释这两个项目:'dists'、'arches'
]# vim /etc/debmirror.conf 
#@dists="sid";
#@arches="i386";

问题7: 安装 pykickstart

解决:

]# yum install pykickstart

问题8: 生成新的root密码,并在 /etc/cobbler/settings 文件中对 default_password_crypted 的值进行替换

解决:

# syntax:
openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'

]# openssl passwd -1 -salt 'yue' 'Emc20160'
$1$yue$wzTcBFUcp8u6BayioJRUy0
]# cobbler setting edit --name=default_password_crypted --value='$1$yue$wzTcBFUcp8u6BayioJRUy0'

问题9: 安装 cman 或 fence-agents,我这边选择安装 cman

解决:

]# yum install cman
  • 设置 cobbler 管理 dhcp

当通过 cobbler 来管理 DHCP 时,使用的 DHCP 配置文件为 /etc/cobbler/dhcp.template

]# cobbler setting edit --name=manage_dhcp --value=1
  • 配置 /etc/cobbler/dhcp.template
]# vim /etc/cobbler/dhcp.template
# 根据规划,修改如下:
......
subnet 192.168.80.0 netmask 255.255.255.0 {
     option routers             192.168.80.2;
     option domain-name-servers 192.168.80.2;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.80.21 192.168.80.30;
......
  • 设置 pxe_just_once

选项 pxe_just_once 预防将机器中的安装循环配置为始终从网络引导。激活此选项时,机器告诉 Cobbler 安装已完成。Cobbler 将系统对象的 netboot 标志更改为 false,这会强制机器从本地磁盘引导。

]# cobbler setting edit --name=pxe_just_once --value=1
  • 重启cobbler、xinetd
]# /etc/init.d/cobblerd restart
]# /etc/init.d/xinetd restart
  • 再次检查 cobbler
]# cobbler sync
]# cobbler check
No configuration problems found.  All systems go.

至此,已完成 cobbler 的安装、配置

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,937评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,503评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,712评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,668评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,677评论 5 366
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,601评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,975评论 3 396
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,637评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,881评论 1 298
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,621评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,710评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,387评论 4 319
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,971评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,947评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,189评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,805评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,449评论 2 342

推荐阅读更多精彩内容