本文共 3172 字,大约阅读时间需要 10 分钟。
CentOS下部署cobbler
à接<CentOS下kickstart实验笔记>
1. 下载cobbler的源地址
wget
rpm –ivh rpmforge-release-0.5.2-2.e15.rf.i386.rpm
yum httpd cobbler
2. 启动相关httpd和 cobbler
Vi /etc/httpd/conf.d/cobbler.conf
;/ 注释掉
#WSGIScriptAliasMatch ^/cblr/svc/([^/]*) /var/www/cobbler/svc/services.py
/etc/init.d/cobblerd start
/etc/init.d/httpd start
Chkconfig cobblerd on
Chkconfig httpd on
3. cobbler check
一堆错误,逐个修正
3.1 vi /etc/cobbler/settings
Server: 192.168.254.21
Next server: 192.168.254.21
Vi /etc/hosts
192.168.254.21 localhost localhost.localdomain
3.2 cobbler get-loaders
3.3 开启rsync服务
Vi /etc/xinetd.d/rsync
Disable=no
3.4 安装cman和cman依赖软件
Yum –y install cman
3.5 设置密码
openssl passwd -1 -salt '123456' '123456'
$1$123456$wOSEtcyiP2N/IfIl15W6Z0
Vi /etc/cobbler/settings
default_password_crypted: "$1$123456$wOSEtcyiP2N/IfIl15W6Z0"
3.6重启服务检查
/etc/init.d/cobblerd restart
Cobbler check
The following are potential configuration items that you may want to fix:
1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
Restart cobblerd and then run 'cobbler sync' to apply changes.
不用管它
4. 导入安装文件
这里,我安装光盘预先拷贝到/share/admins/centos52/, ks文件在
/share/admins/centos52/ks.cfg位置;
我们先看下cobbler import介绍
usage: cobbler [options]
options:
-h, --helpshow this help message and exit
--arch=ARCHOS architecture being imported
--breed=BREEDthe breed being imported
--os-version=OS_VERSION
the version being imported
--path=PATHlocal path or rsync location
--name=NAMEname, ex 'RHEL-5'
--available-as=AVAILABLE_AS
tree is here, don't mirror
--kickstart=KICKSTART_FILE
assign this kickstart file
--rsync-flags=RSYNC_FLAGS
pass additional flags to rsync
cobblerimport–path=/share/admins/centos52--name=CentOS5.2–kickstart=/share\
/admins/centos52/ks.cfg
;/ 其实指定了KS文件也没用,等下还是需要修改的
等待…… , 时间视文件大小而定
完成后会有*** TASK COMPLETE ***字样
5. DHCP指定管理设置(这步可以不做!)
Vi /etc/cobbler/settings
Manage_dhcp: 1
Vi /etc/cobbler/dhcp.template
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.254.0 netmask 255.255.255.0 {
option routers192.168.254.2;
option domain-name-servers 192.168.254.2;
option subnet-mask255.255.255.0;
range dynamic-bootp192.168.254.81 192.168.254.90;
filename"/pxelinux.0";
default-lease-time21600;
max-lease-time43200;
next-server$next_server;
}
其实很简单将,上篇中DHCP拷贝过来就可以了。
6. 修改default菜单
Vi /tftpboot/pxelinux.cfg/default
EFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://fedorahosted.org/cobbler
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
LABEL local
MENU LABEL (local)
MENU DEFAULT
LOCALBOOT -1
LABEL CentOS5.2-i386
kernel /images/CentOS5.2-i386/vmlinuz
MENU LABEL CentOS5.2-i386
append initrd=/images/CentOS5.2-i386/initrd.img ksdevice=bootif lang=kssendmac textks=http://192.168.254.21/cobbler/ks_mirror/CentOS5.2/ks.cfg
ipappend 2
MENU end
只要修改红色部分就可以了,不知道是否支持http以外的协议
7. 重启相关服务
/etc/init.d/cobblerdrestart
/etc/init.d/dhcp restart
/etc/init.d/httpd restart
/etc/init.d/xinetdrestart
8. 测试,开一台虚拟机,设置PXE启动
9. cobbler 和 kickstart比较
感觉没太大优势,就是多了个默认从硬盘启动选项,可以预防重启误安装,这个完全可以学习以后在kickstart中配置,个人觉得kickstart部署要自由的多!