当前位置: > CentOS > CentOS服务器 > 环境配置 >

利用Cobbler批量快速网络安装CentOS(2)

时间:2014-11-29 15:15来源:www.it.net.cn 作者:IT网


第2条 不安装debian系统就不用修复
安装的话,下载debmirror这个对应版本的包进行安装
 
修复第3条:
 
  1. [root@server1 ~]# openssl passwd -1 -salt 'thinkpad' '123456' 
  2. $1$thinkpad$NIq68XbeN51UgdtXiSOAE. 
# thinkpad 这个是随机的数字或字母用来干扰以免被人看到 123456为root密码
然后再次编辑/etc/cobbler/settings,把以上生成的密码替换原有的密码(下面红色部分)
 
  1. default_password_crypted: "$1$thinkpad$NIq68XbeN51UgdtXiSOAE."
9.导入镜像文件
镜像文件会存在/var/www/cobbler/ks_mirror/ 这个目录下
 
  1. [root@server1 log]# mkdir /mnt/CentOS5.6 
  2. [root@server1 log]# mount /dev/cdrom /mnt/centos5.6/ 
  3. mount: block device /dev/cdrom is write-protected, mounting read-only 
  4. [root@server1 log]# cobbler import --path=/mnt/centos5.6/ --name=centos5.6-i386 这个进行的时间比较长 
  5. task started: 2012-12-09_064244_import 
  6. task started (id=Media import, time=Sun Dec 9 06:42:44 2012) 
  7. Found a RedHat compatible signature: CentOS 
  8. adding distros 
  9. creating new distro: centos5.6-xen-i386 
  10. creating new profile: centos5.6-xen-i386 
  11. creating new distro: centos5.6-i386 
  12. creating new profile: centos5.6-i386 
  13. associating repos 
  14. traversing distro centos5.6-xen-i386 
  15. descent into /var/www/cobbler/ks_mirror/centos5.6-i386 
  16. processing repo at : /var/www/cobbler/ks_mirror/centos5.6-i386 
  17. need to process repo/comps: /var/www/cobbler/ks_mirror/centos5.6-i386 
  18. looking for /var/www/cobbler/ks_mirror/centos5.6-i386/repodata/*comps*.xml 
  19. running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/centos5.6-i386/repodata/comps.xml /var/www/cobbler/ks_mirror/centos5.6-i386 
  20. 2644/2644 - CentOS/boost-doc-1.33.1-10.el5.i386.rpm pm86.rpm 
  21. Saving Primary metadata 
  22. Saving file lists metadata 
  23. Saving other metadata 
  24.  
  25. received on stderr: This option is deprecated 
  26.  
  27. traversing distro centos5.6-i386 
  28. descent into /var/www/cobbler/ks_mirror/centos5.6-i386 
  29. processing repo at : /var/www/cobbler/ks_mirror/centos5.6-i386 
  30. need to process repo/comps: /var/www/cobbler/ks_mirror/centos5.6-i386 
  31. looking for /var/www/cobbler/ks_mirror/centos5.6-i386/repodata/*comps*.xml 
  32. running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/centos5.6-i386/repodata/comps.xml /var/www/cobbler/ks_mirror/centos5.6-i386 
  33. 2644/2644 - CentOS/boost-doc-1.33.1-10.el5.i386.rpm pm86.rpm 
  34. Saving Primary metadata 
  35. Saving file lists metadata 
  36. Saving other metadata 
  37.  
  38. received on stderr: This option is deprecated 
  39.  
  40. associating kickstarts 
  41. *** TASK COMPLETE ***  <-看到这就代表成功完成 
10.修复之后重启cobblerd ,然后做文件同步
 
  1. [root@server1 ~]# service cobblerd restart 
  2. Stopping cobbler daemon: [确定] 
  3. Starting cobbler daemon: [确定] 
  4. [root@server1 ~]# cobbler sync 
  5. task started: 2012-12-09_070816_sync 
  6. task started (id=Sync, time=Sun Dec 9 07:08:16 2012) 
  7. running pre-sync triggers 
  8. cleaning trees 
  9. removing: /var/www/cobbler/images/centos5.6-i386 
  10. removing: /var/www/cobbler/images/centos5.6-xen-i386 
  11. removing: /tftpboot/pxelinux.cfg/default 
  12. removing: /tftpboot/grub/efidefault 
  13. removing: /tftpboot/grub/grub-x86_64.efi 
  14. removing: /tftpboot/grub/images 
  15. removing: /tftpboot/grub/grub-x86.efi 
  16. removing: /tftpboot/s390x/profile_list 
  17. copying bootloaders 
  18. trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /tftpboot/grub/grub-x86_64.efi 
  19. trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /tftpboot/grub/grub-x86.efi 
  20. copying distros to tftpboot 
  21. copying files for distro: centos5.6-xen-i386 
  22. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/xen/vmlinuz -> /tftpboot/images/centos5.6-xen-i386/vmlinuz 
  23. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/xen/initrd.img -> /tftpboot/images/centos5.6-xen-i386/initrd.img 
  24. copying files for distro: centos5.6-i386 
  25. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/pxeboot/vmlinuz -> /tftpboot/images/centos5.6-i386/vmlinuz 
  26. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/pxeboot/initrd.img -> /tftpboot/images/centos5.6-i386/initrd.img 
  27. copying images 
  28. generating PXE configuration files 
  29. generating PXE menu structure 
  30. copying files for distro: centos5.6-xen-i386 
  31. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/xen/vmlinuz -> /var/www/cobbler/images/centos5.6-xen-i386/vmlinuz 
  32. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/xen/initrd.img -> /var/www/cobbler/images/centos5.6-xen-i386/initrd.img 
  33. copying files for distro: centos5.6-i386 
  34. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/pxeboot/vmlinuz -> /var/www/cobbler/images/centos5.6-i386/vmlinuz 
  35. trying hardlink /var/www/cobbler/ks_mirror/centos5.6-i386/images/pxeboot/initrd.img -> /var/www/cobbler/images/centos5.6-i386/initrd.img 
  36. rendering DHCP files 
  37. generating /etc/dhcpd.conf 
  38. rendering TFTPD files 
  39. generating /etc/xinetd.d/tftp 
  40. cleaning link caches 
  41. rendering Rsync files 
  42. running post-sync triggers 
  43. running python triggers from /var/lib/cobbler/triggers/sync/post/* 
  44. running python trigger cobbler.modules.sync_post_restart_services 
  45. running: dhcpd -t -q 
  46. received on stdout: 
  47. received on stderr: 
  48. running: service dhcpd restart 
  49. received on stdout: 关闭 dhcpd:[确定] 
  50. 启动 dhcpd:[确定] 
  51.  
  52. received on stderr: 
  53. running shell triggers from /var/lib/cobbler/triggers/sync/post/* 
  54. running python triggers from /var/lib/cobbler/triggers/change/* 
  55. running python trigger cobbler.modules.scm_track 
  56. running shell triggers from /var/lib/cobbler/triggers/change/* 
  57. *** TASK COMPLETE ***  <-看到这就代表成功完成 
查看导入结果:
[root@server1 ~]# cobbler distro list
centos5.6-i386 <- 这是刚刚导入的镜像的名字
centos5.6-xen-i386

11.启动xinetd服务
[root@server1 ~]# service xinetd start
 
12.先使用默认的kickstart配置文件来新建虚拟机测试
/var/lib/cobbler/kickstarts/sample.ks 这个是默认的,如果不为每个导入的镜像设置单独的配置,那么就默认会使用这个

利用Cobbler批量快速网络安装CentOS

 

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS

利用Cobbler批量快速网络安装CentOS
 

安装完成之后会自动重启,重启后系统安装好了。
默认是:
计算机名未设置
IP地址自动获取
iptables 默认是开启状态,而且是有一一些规则在里面
selinux 默认是禁用的
默认分区方式:/boot 100M 剩余的做LVM,全部分给/
 
默认安装的软件包组;
Installed Groups:
Yum Utilities
拨号联网支持
系统工具
网络服务器
邮件服务器
gcc 未安装
(责任编辑:IT)
------分隔线----------------------------