linux下配置cobbler批量安装系统

时间:2015-02-11 02:05:23   收藏:0   阅读:3932

1、安装准备

yum install -y cobbler tftp dhcp httpd cman pykickstart debmirroryum install -y ed patch perl perl-Compress-Zlib perl-Digest-SHA1 perl-LockFile-Simple perl-libwww-perlyum install -y syslinux

2、启动httpd和cobbler

[root@node6 ~]# service httpd start    [root@node6 ~]# service cobblerd start

3、cobbler检查

[root@node6 ~]# cobbler checkTraceback (most recent call last):  File "/usr/bin/cobbler", line 36, in <module>    sys.exit(app.main())  File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 655, in main    rc = cli.run(sys.argv)  File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 270, in run    self.token         = self.remote.login("", self.shared_secret)  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__    return self.__send(self.__name, args)  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request    verbose=self.__verbose  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request    return self._parse_response(h.getfile(), sock)  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response    return u.close()  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close    raise Fault(**self._stack[0])xmlrpclib.Fault: <Fault 1: "<class ‘cobbler.cexceptions.CX‘>:‘login failed‘">

此处需要重新启动cobblerd服务,再次检查就会正常

  1. [root@node6 ~]# service cobblerd restart

  2. [root@node6 ~]# cobbler check


  3. The following are potential configuration items that you may want to fix:


  4. 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. 将/etc/cobbler/setting中的server改为cobbler主机的地址

  5. 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.

  6. ##将/etc/cobbler/setting中的next-server改为cobbler主机的地址

  7. 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.

  8. ##此处可通过命令cobbler get-loaders修复,需要联网下载

  9. 4 : change ‘disable‘ to ‘no‘ in /etc/xinetd.d/rsync 修改/etc/xinetd.d/rsync中的disable为no

  10. 5 : comment out ‘dists‘ on /etc/debmirror.conf for proper debian support

  11. 6 : comment out ‘arches‘ on /etc/debmirror.conf for proper debian support ##注释掉/etc/debmirror.conf中@distshearches开头的行

  12. 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 使用openssl passwd -1 -salt `openssl rand -hex 4` ‘你的密码‘,然后将生成的密码替换/etc/cobbler/setting文件中default_passwd_crypted后面的密码

技术分享

如果显示一下图片所示则表示一切正常

技术分享技术分享i

配置dncp服务器,此为最简单配置,172.16.30.6为本机地址

技术分享

启动dhcpd服务

sevice dhcpd start

导入光盘内容

[root@node5 ~]# mkdir /media/cdrom

[root@node5 ~]# mount /dev/cdrom1 /media/cdrom/

[root@node5 media]# cobbler import –path=/media/cdrom/ –name=’centos6.6′

同步

cobbler sync

新建虚拟机测试

技术分享

cobbler命令

cobbler distro list显示当前共有多少个发行版,每一个发行版可以有多个profile,可通过cobbler profile add添加profile,上图安装界面的名称便是profile的名字,可设置不同的kickstart来共用一个distro,每一个不同的 kickstart可实现不同用途的安装,可使用如下命令来通过不同的kickstart添加不同作用的profile

cobbler profile add –name=’centos-web’ –distro=’centos6.6-x86_64′ –kickstart=/root/kickstart.cfg  ##绝对路径

可通过命令cobbler distro list查看现有的distro的名字。


本文出自 “LINUXU” 博客,请务必保留此出处http://linuxu.blog.51cto.com/9471357/1613456

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!