linux下配置cobbler批量安裝系統

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的名字。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章