Cobbler批量部署RedHat
前面一篇介绍了使用Kickstart批量部署redhat,但是这种方法配置起来比较麻烦。现在,我们有了更好的选择。那就是:Cobbler。在看以下内容时最好先看下:Kickstart批量部署redhat。
系统环境:CentOS 5
CentOS5.4默认的Repository里找不到Cobbler,先安装rpmforce这个Repository。很全很强大,近10000个软件包。
#32位:wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpmrpm -ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm#64位:wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpmrpm -ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
yum -y install cobbler dhcp httpd xinetd tftp-server
cobbler check
mount -o loop home/sapling/CentOS-5.4-x86_64-bin-DVD.iso /mnt/redhatISOcobbler import --mirror=/mnt/redhatISO --name=CentOS-5-4-x86-64 # 从 /mnt/redhatISO 目录导入所有安装文件,命名为 CentOS-5-4-x86-64cobbler list# 查看导入结果,应包含一个xen的
vi /etc/cobbler/dhcp.template# DHCP 配置模板,注意你本服务器的 IP 地址要和dhcp配置的subnet一个网段,否则会启动失败。vi /etc/cobbler/default.ks# Kickstart 配置模板,可以用system-config-kickstart(建议)生成,也可以安装系统后在/root/anaconda-ks.cfg得到你所安装系统的配置。
cobbler sync
service xinetd startservice dhcpd startservice cobblerd start#设置相关服务开机启动ntsysv
# 在要重装的机器安装koanyum install koan#查看cobbler服务器有哪些安装盘koan --list-profiles --server=192.168.1.2#选择要重装的系统并重启koan --replace-self --server=192.168.1.2 --profile=CentOS-5-4-x86-64reboot