一.简介

Cobbler 可以用来快速建立 Linux 网络安装环境,它已将 Linux 网络安装的技术门槛,从大专以上文化水平,成功降低到初中以下,连补鞋匠都能学会。(~..~)

二.安装环境以及资源

  1. 系统:centos 6.5   IP:192.168.30.158/24
  2. 自动安装镜像:CentOS-6.5-x86_64-bin-DVD1.iso

三.安装步骤

  1. 安装epel源:

    1. [root@cobbler ~]# rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  2. 安装DHCP、tftp,rsync,xinetd,httpd(这些都是所需要的,如果有则不需要安装。)
    1. [root@cobbler ~]# yum -y install dhcp tftp rsync xinetd httpd pykickstart fence-agents
  3. 安装cobbler
    1. [root@cobbler ~]# yum install cobbler -y
  4. 安装cobbler完成后,重启cobblerd。还暂时不能使用,我们可以运行一下这个命令,检查一下。可以看到的错误信息
    1. [root@cobbler ~]# cobbler check
    2. The following are potential configuration items that you may want to fix:
    3.  
    4. : 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.
    5. : 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. : change 'disable' to 'no' in /etc/xinetd.d/tftp
    7. : 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., menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
    8. : change 'disable' to 'no' in /etc/xinetd.d/rsync
    9. : comment out 'dists' on /etc/debmirror.conf for proper debian support
    10. : comment out 'arches' on /etc/debmirror.conf for proper debian support
    11. : 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
    12.  
    13. Restart cobblerd and then run 'cobbler sync' to apply changes.
  5. 现在就一个一个的来解决以上的错误条目。
  • 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.
    上面提示需要修改cobbler服务器的ip地址。配置文件是/etc/cobbler/settings.找到

    1. [root@cobbler ~]# vim /etc/cobbler/settings
    2. server: 192.168.30.158
    3. next_server: 192.168.30.158
  • 2 : change 'disable' to 'no' in /etc/xinetd.d/tftp  修改disable 为 no

    1. [root@cobbler ~]# vi /etc/xinetd.d/tftp
    2. # default: off
    3. # description: The tftp server serves files using the trivial file transfer \
    4. # protocol. The tftp protocol is often used to boot diskless \
    5. # workstations, download configuration files to network-aware printers, \
    6. # and to start the installation process for some operating systems.
    7. service tftp
    8. {
    9. socket_type = dgram
    10. protocol = udp
    11. wait = yes
    12. user = root
    13. server = /usr/sbin/in.tftpd
    14. server_args = -s /var/lib/tftpboot
    15. disable = no
    16. per_source =
    17. cps =
    18. flags = IPv4
    19. }
  • 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.
    1. [root@cobbler ~]# cobbler get-loaders
    2. task started: --26_161520_get_loaders
    3. task started (id=Download Bootloader Content, time=Wed Aug :: )
    4. downloading http://cobbler.github.com/loaders/README to /var/lib/cobbler/loaders/README
    5. downloading http://cobbler.github.com/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
    6. downloading http://cobbler.github.com/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
    7. downloading http://cobbler.github.com/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
    8. downloading http://cobbler.github.com/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
    9. downloading http://cobbler.github.com/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
    10. downloading http://cobbler.github.com/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
    11. downloading http://cobbler.github.com/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
    12. downloading http://cobbler.github.com/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
    13. downloading http://cobbler.github.com/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
    14. *** TASK COMPLETE ***
  • 4 : 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
    1. [root@cobbler ~]# openssl passwd - -salt '' ''
    2. $$$D38AxheCTHf/nVAzlN0.z0

    此处按提示操作,最后一个生成的“999999”密码,是cobbler客户端安装完系统后的root密码。生成后的密码$1$222222$D38AxheCTHf/nVAzlN0.z0需要写入下面的文件内:/etc/cobbler/settings内

    1. [root@cobbler ~]# vim /etc/cobbler/settings
    2. default_password_crypted: "$1$222222$D38AxheCTHf/nVAzlN0.z0"
  • 5 : comment out 'dists' on /etc/debmirror.conf for proper debian support;comment out 'arches' on /etc/debmirror.conf for proper debian support
    1. [root@cobbler ~]# vim /etc/debmirror.conf
    2. #@dists="sid";
    3. #@arches="i386";

    找到以上两行,并注释掉这两句。

  • 6 : change 'disable' to 'no' in /etc/xinetd.d/rsync  修改disable 为 no
    1. [root@cobbler ~]# vi /etc/xinetd.d/rsync
    2. # default: off
    3. # description: The rsync server is a good addition to an ftp server, as it \
    4. # allows crc checksumming etc.
    5. service rsync
    6. {
    7. disable = no
    8. flags = IPv6
    9. socket_type = stream
    10. wait = no
    11. user = root
    12. server = /usr/bin/rsync
    13. server_args = --daemon
    14. log_on_failure += USERID
    15. }
  • 7:将上述错误修改完毕后,重启下cobblerd服务,再次运行cobbler check检查,出现以下便表示前面几条的提示已经被解决了。
    1. [root@cobbler ~]# service cobblerd restart
    2. Stopping cobbler daemon: [ OK ]
    3. Starting cobbler daemon: [ OK ]
    4. [root@cobbler ~]# cobbler check
    5. No configuration problems found. All systems go.
  • 8:修改cobbler配置文件,让cobbler来接管DHCP的目的
    1. [root@cobbler ~]# vi /etc/cobbler/settings
    2. manage_dhcp:
  • 9:修改DHCP配置模板,修改成如下配置(根据自己的网络环境配置)
    1. [root@cobbler ~]# vi /etc/cobbler/dhcp.template
    2. subnet 192.168.30.0 netmask 255.255.255.0 {
    3. option routers 192.168.30.1;
    4. option domain-name-servers 192.168.30.1;
    5. option subnet-mask 255.255.255.0;
    6. range dynamic-bootp 192.168.30.100 192.168.30.254;
    7. default-lease-time ;
    8. max-lease-time ;
    9. next-server $next_server;
  • 10:安装光盘已经放在光驱里了,现在需要创建文件,然后挂载到电脑上。
    1. [root@cobbler ~]# mkdir -p /cobbler/ISO
    2. [root@cobbler /]# mount /dev/cdrom /cobbler/ISO/
    3. mount: block device /dev/sr0 is write-protected, mounting read-only

    之后导入安装镜像。

    1. [root@cobbler ~]# cobbler import --path=/cobbler/ISO/ --name=CentOS-.5_86x64
    2. task started: --26_181805_import
    3. task started (id=Media import, time=Wed Aug :: )
    4. Found a candidate signature: breed=redhat, version=rhel6
    5. Found a matching signature: breed=redhat, version=rhel6
    6. Adding distros from path /var/www/cobbler/ks_mirror/CentOS-.5_86x64:
    7. creating new distro: CentOS-.5_86x64-x86_64
    8. trying symlink: /var/www/cobbler/ks_mirror/CentOS-.5_86x64 -> /var/www/cobbler/links/CentOS-.5_86x64-x86_64
    9. creating new profile: CentOS-.5_86x64-x86_64
    10. associating repos
    11. checking for rsync repo(s)
    12. checking for rhn repo(s)
    13. checking for yum repo(s)
    14. starting descent into /var/www/cobbler/ks_mirror/CentOS-.5_86x64 for CentOS-.5_86x64-x86_64
    15. processing repo at : /var/www/cobbler/ks_mirror/CentOS-.5_86x64
    16. need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-.5_86x64
    17. looking for /var/www/cobbler/ks_mirror/CentOS-.5_86x64/repodata/*comps*.xml
    18. Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS-6.5_86x64/repodata
    19. *** TASK COMPLETE ***
  • 11: 现在同步cobbler
    1. [root@cobbler ~]# cobbler sync
    2. task started: --26_182224_sync
    3. task started (id=Sync, time=Wed Aug :: )
    4. running pre-sync triggers
    5. cleaning trees
    6. removing: /var/www/cobbler/images/CentOS-.5_86x64-x86_64
    7. removing: /var/lib/tftpboot/pxelinux.cfg/default
    8. removing: /var/lib/tftpboot/grub/efidefault
    9. removing: /var/lib/tftpboot/grub/images
    10. removing: /var/lib/tftpboot/images/CentOS-.5_86x64-x86_64
    11. removing: /var/lib/tftpboot/s390x/profile_list
    12. copying bootloaders
    13. trying hardlink /var/lib/cobbler/loaders/pxelinux. -> /var/lib/tftpboot/pxelinux.
    14. trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
    15. trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
    16. trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
    17. trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
    18. copying distros to tftpboot
    19. copying files for distro: CentOS-.5_86x64-x86_64
    20. trying hardlink /var/www/cobbler/ks_mirror/CentOS-.5_86x64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/CentOS-.5_86x64-x86_64/vmlinuz
    21. trying hardlink /var/www/cobbler/ks_mirror/CentOS-.5_86x64/images/pxeboot/initrd.img -> /var/lib/tftpboot/images/CentOS-.5_86x64-x86_64/initrd.img
    22. copying images
    23. generating PXE configuration files
    24. generating PXE menu structure
    25. copying files for distro: CentOS-.5_86x64-x86_64
    26. trying hardlink /var/www/cobbler/ks_mirror/CentOS-.5_86x64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/CentOS-.5_86x64-x86_64/vmlinuz
    27. trying hardlink /var/www/cobbler/ks_mirror/CentOS-.5_86x64/images/pxeboot/initrd.img -> /var/www/cobbler/images/CentOS-.5_86x64-x86_64/initrd.img
    28. Writing template files for CentOS-.5_86x64-x86_64
    29. rendering TFTPD files
    30. generating /etc/xinetd.d/tftp
    31. processing boot_files for distro: CentOS-.5_86x64-x86_64
    32. cleaning link caches
    33. running post-sync triggers
    34. running python triggers from /var/lib/cobbler/triggers/sync/post/*
    35. running python trigger cobbler.modules.sync_post_restart_services
    36. running shell triggers from /var/lib/cobbler/triggers/sync/post/*
    37. running python triggers from /var/lib/cobbler/triggers/change/*
    38. running python trigger cobbler.modules.scm_track
    39. running shell triggers from /var/lib/cobbler/triggers/change/*
    40. *** TASK COMPLETE ***

    重启一下

    1. [root@cobbler cobbler]# /etc/init.d/xinetd restart
    2. Stopping xinetd: [ OK ]
    3. Starting xinetd: [ OK ]
  • 12:现在配置基本上已经完成了,可以达到自动装机的效果了。(可能生产环境中需要修改一些环境变量,或者预安装的软件包)

四.现在测试一下

  • 开机,选择网卡启动
  • 之后在出现的系统菜单中,选择所需要安装的系统
  • 选择Centos6.5后即可自动进行安装。

    文中可能有遗漏之处,还请提出,如果转载,还请注明源地址!谢谢....

Centos 部署Cobbler系统的更多相关文章

  1. Cobbler全自动批量安装部署Linux系统

    说明: Cobbler服务器系统:CentOS 5.10 64位 IP地址:192.168.21.128 需要安装部署的Linux系统: eth0(第一块网卡,用于外网)IP地址段:192.168.2 ...

  2. centos 7 linux系统默认ftp安装配置和部署(详细讲解)

    小生接触 Linux 系统时间不长,想解决linux系统ftp安装及部署问题,折腾了大半天,终于弄出来了,将各路高手的配置方法综合了一下,如有不对之处,欢迎各位看客指正,感谢! 一.声明: 本文采用操 ...

  3. Cobbler自动部署主机系统

    Cobbler自动部署主机系统 简介: Cobbler由python语言开发,是对PXE和 Kickstart以及DHCP的封装.融合很多特性,提供了CLI和Web的管理形式.更加方便的实行网络安装. ...

  4. CentOS和Ubuntu系统下安装vsftp(助推大数据部署搭建)

    不多说,直接上干货! 同时,声明,我这里安装的vsftp,仅仅只为我的大数据着想,关于网上的复杂安装,那是服务和运维那块.我不多牵扯,也不多赘述. 一.CentOS系统里安装vsftp 第一步:使用y ...

  5. linux项目-之系统安装部署-cobbler

    http://cobbler.github.io/manuals/2.6.0/1/1_-_Release_Notes.html http://www.osyunwei.com/archives/760 ...

  6. 【Linux】部署cobbler

    环境Centos 6.3,本地挂载镜像配置本地yum源 yum -y install dhcp httpd xinetd tftp-server http://dl.fedoraproject.org ...

  7. 部署cobbler服务器

    部署cobbler服务器 1.准备环境使用nat或者仅主机模式,不要使用桥接模式,方式获取的IP不是自己的 2. 配置yum源[epel]name=epelenabled=1gpgcheck=0bas ...

  8. 为什么使用centos部署服务器

    这个是实验室同学面试的时候,面试官问的一个问题? 为什么选择centos系统,为什么centos系统用的比较多呢? 首先我们说下redhat红帽公司,它是全球最大的linux服务提供商,它的服务是最好 ...

  9. 大数据集群Linux CentOS 7.6 系统调优篇

    大数据集群Linux CentOS 7.6 系统调优篇 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.设置主机hosts文件 1>.修改主机名 [root@node100 ...

随机推荐

  1. (转)MapReduce Design Patterns(chapter 6 (part 2))(十二)

    Chain Folding 这是对job 链的一种优化.基本上是一种大体规则:每条记录都会提交给多个mapper,或者给reducer然后给mapper.这种综合处理方法会节省很多读文件和传输数据的时 ...

  2. pdf 转图片,提取图片研究心得

    1.pdf 中的数据是有多种编码的,详情请看:http://www.cnblogs.com/zendu/p/7644465.html 2.我的工作场景比较特殊,pdf中全部是图片,所以pdf转图片就有 ...

  3. Scala函数式编程——近半年的痛并快乐着

    从9月初啃完那本让人痛不欲生却又欲罢不能的<七周七并发模型>,我差不多销声匿迹了整整4个月.这几个月里,除了忙着讨食,便是继续啃另一本"锯著"--<Scala函数 ...

  4. [IC]Lithograph(0)半导体制造的基本过程

    1. 晶圆片 Wafer 晶圆(Wafer)是指硅半导体集成电路制作所用的硅芯片,由于其形状为圆形,故称为晶圆.晶圆是生产集成电路所用的载体,一般意义晶圆多指单晶硅圆片. 半导体行业从图1到图2,是一 ...

  5. 音乐随想——德沃夏克《From The New World》

    第一乐章 前奏拖的很长,低音,再低音.突然转向,好像漂泊数月的水手看到了新大陆. 第二乐章 前奏很优美,到双簧管出现的时候宛若紫霞仙子撑船自芦苇荡中飘过. 之后又一段较前奏稍快的旋律,好像看到了梦寐的 ...

  6. Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?

  7. 使用pjax时点击浏览器刷新按钮仅加载内容页的解决办法

    pjax可以实现ajax的局部刷新功能,同时能改变地址栏的URL,因此支持浏览器的后退和前进功能. 但是,在使用中,若没有正确使用,仍然会出现一些问题. 比如,我们在使用pjax后,能够在不加载整个页 ...

  8. 【转载】分布式之redis复习精讲

    注: 本篇文章转自:分布式之redis复习精讲 引言 为什么写这篇文章? 博主的<分布式之消息队列复习精讲>得到了大家的好评,内心诚惶诚恐,想着再出一篇关于复习精讲的文章.但是还是要说明一 ...

  9. python 3.x 的装饰器笔记

    今天学到了python的装饰器,感觉这个东西还是稍微有些复杂,所以记录下来,方便以后的查找.虽然标题是python 3.x的装饰器,但是我也没有怎么用过python 2.x,感觉上应该是和python ...

  10. 接口测试基础——第6篇unittest模块(一)

    我们先来简单介绍一下unittest框架,先上代码,跟住了哦~~ 1.建立如下结构的文件夹: 注意,上面的文件夹都是package,也就是说你在new新建文件夹的时候不要选directory,而是要选 ...