免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1586 | 回复: 1
打印 上一主题 下一主题

Cobbler 的使用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-05-02 14:10 |只看该作者 |倒序浏览
一个简短的关于 cobbler 的介绍,点击这里。

母机环境为 CentOS-5.6-x86_64。google 看 cobbler,夸赞他的人很多,大致就是将网络环境安装的难度降低到 ”cobbler“ 的水平了,虽说夸张了些,但是跟 pxe 等一系列工具组合使用对比来看 ,在配置难度上略微降低。

使用 epel 源安装 cobbler:

# rpm -ivh http://download.fedora.redhat.co ... ease-5-4.noarch.rpm
# yum install cobbler httpd tftp-server dhcp xinetd

修改 tftp:

# sed '/disable/s/no/yes/g' /etc/xinetd.d/tftp
# sed '/disable/s/no/yes/g' /etc/xinetd.d/rsync
# /etc/init.d/xinetd restart

修改 cobbler 的配置:

# vi /etc/cobbler/settings

将 server 段即本机的地址;next_server 段表示的是 dhcp 的地址,将二者都设置成本机的 ip;将 manage_dhcp 置为 1。

default_kickstart 字段默认是 /var/lib/cobbler/kickstarts/default.ks。而该文件默认为空,需要自己配置。

在做了任何有关 cobbler 的修改后,需要执行:

# cobbler sync

修改 cobbler 中的 dhcp 模版,通过该模版会生成 /etc/dhcpd.conf 文件:

# vi /etc/cobbler/dhcp.template

ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

subnet 10.18.101.0 netmask 255.255.255.0 {
option routers             10.18.101.254;
option domain-name-servers 8.8.4.4;
option subnet-mask         255.255.255.0;
range dynamic-bootp        10.18.101.240 10.18.101.250;
filename                   "/pxelinux.0";
default-lease-time         21600;
max-lease-time             43200;
next-server                $next_server;
}

检查 cobbler 的配置,根据出现的提示进行接下来的步骤:

# cobbler check
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 : since iptables may be running, ensure 69, 80, and 25151 are unblocked
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.

挂载 iso 镜像,制作 cobbler 源:

# mount -o loop CentOS-5.6-x86_64.iso /mnt
# cobbler import –path=/mnt  –name=CentOS-5-x86_64

注意:cobbler 默认是在 /var/www/cobbler 下建立源,所以 /var 需要足够大。

kickstart 文件默认在 /var/liv/cobbler/kickstarts/ 目录中,该步骤可以参考前面的 kickstart 配置。可以在下面的链接中看到写的 kickstart 文件:

http://10.18.101.252/cblr/svc/op/ks/system/xen-215

注意:将原来的 nfs 方式换成 http:

url –url=http://10.18.101.252/cobbler/ks_mirror/CentOS-5-x86_64

重启 cobbler,生效:

# /etc/init.d/cobblerd restart

建立相应的 profiles,systems:
# cobbler profile add –name=xen-215 –distro=CentOS-5-x86_64 –kickstart=/var/lib/cobbler/kickstarts/xen-215.ks
# cobbler system add –name=xen-215 –mac=00:00:22:22:33:33 –profile=xen-215

列出 cobbler 的所有元素:

# cobbler list
distros:
  CentOS-5-x86_64
  CentOS-5-xen-x86_64

profiles:
CentOS-5-x86_64
CentOS-5-xen-x86_64
webserver
xen-215

systems:
webserver1
xen-215

repos:
centos-5.6-x86_64

images:

在原系统上安装安装 koan 这个客户来完成一些诸如重装系统等的事情:

# yum install koan

列出服务器上的 profiles:

# koan –server=10.18.101.252 –list=profiles

重新安装系统:

# koan –replace-self –server=10.18.101.252 –profile=xen-215
可以安装 cobbler-web,功能很强大,”数形结合“有助理解:

# yum install cobbler-web

添加新用户以及登陆密码:

# htdigest /etc/cobbler/users.digest "Cobbler" jaseywang

修改认证方式:

# vi /etc/cobbler/modules.conf
[authentication]  
module = authn_configfile  
[authorization]  
module = authz_allowall   

这里是一篇如何使用 cobbler 安装 CentOS 6 的教程。

参考:
http://mdehaan.fedorapeople.org/screencasts/cobbler.htm

http://jaseywang.me/2011/08/16/c ... %E4%BD%BF%E7%94%A8/

论坛徽章:
0
2 [报告]
发表于 2012-05-02 15:21 |只看该作者
楼主辛苦了,谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP