您的位置:首页 > 运维架构 > Linux

CentOS下部署cobbler

2013-11-22 10:40 507 查看
CentOS下部署cobblerà接<CentOS下kickstart实验笔记>
1. 下载cobbler的源地址
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
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 startChkconfig cobblerd onChkconfig httpd on3. 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 restartCobbler checkThe 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 repositoriesRestart 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_VERSIONthe version being imported--path=PATHlocal path or rsync location--name=NAMEname, ex 'RHEL-5'--available-as=AVAILABLE_AStree is here, don't mirror--kickstart=KICKSTART_FILEassign this kickstart file--rsync-flags=RSYNC_FLAGSpass additional flags to rsynccobblerimport–path=/share/admins/centos52--name=CentOS5.2–kickstart=/share\/admins/centos52/ks.cfg;/ 其实指定了KS文件也没用,等下还是需要修改的等待…… , 时间视文件大小而定完成后会有*** TASK COMPLETE ***字样5. DHCP指定管理设置(这步可以不做!)Vi /etc/cobbler/settingsManage_dhcp: 1Vi /etc/cobbler/dhcp.templateallow 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 menuPROMPT 0MENU TITLE Cobbler | http://fedorahosted.org/cobblerTIMEOUT 200TOTALTIMEOUT 6000ONTIMEOUT localLABEL localMENU LABEL (local)MENU DEFAULTLOCALBOOT -1LABEL CentOS5.2-i386kernel /images/CentOS5.2-i386/vmlinuzMENU LABEL CentOS5.2-i386append initrd=/images/CentOS5.2-i386/initrd.img ksdevice=bootif lang=kssendmac textks=http://192.168.254.21/cobbler/ks_mirror/CentOS5.2/ks.cfgipappend 2MENU 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部署要自由的多!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Centos 自动 cobbler