分享

在CentOS5.4上使用Cobbler

 brevity 2010-10-20

刚和xiong说到了,Cobbler是很有趣的东西。他可以干嘛呢?如果你有N台机器需要安装Linux的系统,那么Cobbler就是一个很好的候选方案;如果你需要远程给虚拟机安装系统,那么Cobbler也是很好的选择。

如下,我尝试使用Cobbler给N台机器最快速的安装CentOS。当然,首先我已有了一台作为安装服务器的机器,这是一个安装了CentOS的PC,安装时候选择的Server Installation,并且他在一个网络里,这个安装服务器的IP是192.168.56.103/255.255.255.0。

  1. CentOS5.4默认的Repository里找不到Cobbler,先安装rpmforce这个Repository。
    rpm -ivh http://apt./redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
  2.  然后就可以yum install cobbler,有很多依赖的包也被一起安装了。
  3. 运行cobbler check,他会提示哪些配置文件需要修改。修改/var/lib/cobbler/settings,把127.0.0.1都改成这个安装服务器的地址,在我的机器就是192.168.56.103;把manage_dhcp : 0 改成1。修改了之后,记得再运行一次cobbler check来确认没有问题。
    [root@localhost cobbler]# cobbler check
        The following potential problems were detected:
        #0: The 'server' field in /var/lib/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.
        #1: For PXE to be functional, the 'next_server' field in /var/lib/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.
        #2: change 'disable' to 'no' in /etc/xinetd.d/tftp
        
  4. 启动tftp服务和dhcp服务,service xinetd start; service dhcpd start。同时,因为cobbler需要http服务,也是需要启动的。cobbler会生成kickstart文件的,会放在/var/www/cobbler/kickstarts, 记得修改这里的文件,至少需要把安装服务器的地址从127.0.0.1改成192.168.56.103(这个是我安装服务器的地址)。当然,也可以使用自己做的kickstart文件。我一般是先手动安装一个系统,然后用自动生成的anaconda-ks.cfg文件。
  5. 我下载的CentOS的DVD安装镜像放在/inst下边。
    mkdir /inst/cd
        mount -o loop /inst/CentOS-5.4-i386-bin-DVD.iso /inst/cd
        
  6.  用cobbler的import命令来导入这些安装文件。
    cobbler import --mirror=/inst/cd --name=centos54
  7.  这之后就一切OK了。启动需要安装系统的机器,选择网络启动,在提示boot的时候,输入menu,这时候就能看到cobbler生成的选项了。我的是包括两个,一个是普通的另一个是包含xen的。选择你要安装的,回车,然后就等着结束好了。

如果再把cobbler的repository做成跟centos官方站的rsync,这样不就可以一劳永逸了,哈哈哈。


参考文献:https:///cobbler/wiki/UsingCobblerImport

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多