一.简介

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

二.安装环境以及资源

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

三.安装步骤

  1. 安装epel源:

    [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(这些都是所需要的,如果有则不需要安装。)
    [root@cobbler ~]# yum -y install dhcp tftp rsync xinetd httpd pykickstart fence-agents
  3. 安装cobbler
    [root@cobbler ~]# yum install cobbler -y
  4. 安装cobbler完成后,重启cobblerd。还暂时不能使用,我们可以运行一下这个命令,检查一下。可以看到的错误信息
    [root@cobbler ~]# cobbler check
    The following are potential configuration items that you may want to fix: : 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.
    : 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.
    : change 'disable' to 'no' in /etc/xinetd.d/tftp
    : 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.
    : change 'disable' to 'no' in /etc/xinetd.d/rsync
    : comment out 'dists' on /etc/debmirror.conf for proper debian support
    : comment out 'arches' on /etc/debmirror.conf for proper debian support
    : 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 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.找到

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

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

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

    [root@cobbler ~]# vim /etc/cobbler/settings
    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
    [root@cobbler ~]# vim /etc/debmirror.conf
    #@dists="sid";
    #@arches="i386";

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

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

    之后导入安装镜像。

    [root@cobbler ~]# cobbler import --path=/cobbler/ISO/ --name=CentOS-.5_86x64
    task started: --26_181805_import
    task started (id=Media import, time=Wed Aug :: )
    Found a candidate signature: breed=redhat, version=rhel6
    Found a matching signature: breed=redhat, version=rhel6
    Adding distros from path /var/www/cobbler/ks_mirror/CentOS-.5_86x64:
    creating new distro: CentOS-.5_86x64-x86_64
    trying symlink: /var/www/cobbler/ks_mirror/CentOS-.5_86x64 -> /var/www/cobbler/links/CentOS-.5_86x64-x86_64
    creating new profile: CentOS-.5_86x64-x86_64
    associating repos
    checking for rsync repo(s)
    checking for rhn repo(s)
    checking for yum repo(s)
    starting descent into /var/www/cobbler/ks_mirror/CentOS-.5_86x64 for CentOS-.5_86x64-x86_64
    processing repo at : /var/www/cobbler/ks_mirror/CentOS-.5_86x64
    need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS-.5_86x64
    looking for /var/www/cobbler/ks_mirror/CentOS-.5_86x64/repodata/*comps*.xml
    Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS-6.5_86x64/repodata
    *** TASK COMPLETE ***
  • 11: 现在同步cobbler
    [root@cobbler ~]# cobbler sync
    task started: --26_182224_sync
    task started (id=Sync, time=Wed Aug :: )
    running pre-sync triggers
    cleaning trees
    removing: /var/www/cobbler/images/CentOS-.5_86x64-x86_64
    removing: /var/lib/tftpboot/pxelinux.cfg/default
    removing: /var/lib/tftpboot/grub/efidefault
    removing: /var/lib/tftpboot/grub/images
    removing: /var/lib/tftpboot/images/CentOS-.5_86x64-x86_64
    removing: /var/lib/tftpboot/s390x/profile_list
    copying bootloaders
    trying hardlink /var/lib/cobbler/loaders/pxelinux. -> /var/lib/tftpboot/pxelinux.
    trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/lib/tftpboot/menu.c32
    trying hardlink /var/lib/cobbler/loaders/yaboot -> /var/lib/tftpboot/yaboot
    trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
    trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
    copying distros to tftpboot
    copying files for distro: CentOS-.5_86x64-x86_64
    trying hardlink /var/www/cobbler/ks_mirror/CentOS-.5_86x64/images/pxeboot/vmlinuz -> /var/lib/tftpboot/images/CentOS-.5_86x64-x86_64/vmlinuz
    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
    copying images
    generating PXE configuration files
    generating PXE menu structure
    copying files for distro: CentOS-.5_86x64-x86_64
    trying hardlink /var/www/cobbler/ks_mirror/CentOS-.5_86x64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/CentOS-.5_86x64-x86_64/vmlinuz
    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
    Writing template files for CentOS-.5_86x64-x86_64
    rendering TFTPD files
    generating /etc/xinetd.d/tftp
    processing boot_files for distro: CentOS-.5_86x64-x86_64
    cleaning link caches
    running post-sync triggers
    running python triggers from /var/lib/cobbler/triggers/sync/post/*
    running python trigger cobbler.modules.sync_post_restart_services
    running shell triggers from /var/lib/cobbler/triggers/sync/post/*
    running python triggers from /var/lib/cobbler/triggers/change/*
    running python trigger cobbler.modules.scm_track
    running shell triggers from /var/lib/cobbler/triggers/change/*
    *** TASK COMPLETE ***

    重启一下

  • [root@cobbler cobbler]# /etc/init.d/xinetd restart
    Stopping xinetd: [ OK ]
    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. CUDA Samples: Julia

    以下CUDA sample是分别用C++和CUDA实现的绘制Julia集曲线,并对其中使用到的CUDA函数进行了解说,code参考了<GPU高性能编程CUDA实战>一书的第四章,各个文件内 ...

  2. 深入理解Hystrix之文档翻译

    转载请标明出处: http://blog.csdn.net/forezp/article/details/75333088 本文出自方志朋的博客 什么是Hystrix 在分布式系统中,服务与服务之间依 ...

  3. Iphone 消息通知(APNS)的3种方式 -- C# 和 nodejs

    发送 APNS 使用 p12 文件(C#) public static bool PushWithP12(string apnToken, string message) { _log.DebugFo ...

  4. postgres访问外网控制

    1. sudo apt-get install postgresql #安装psql 2. su passwd postgres #设置postgres账户的密码 3. postgresql.conf ...

  5. Spring 学习笔记(一)

    # IOC, DI # ApplicationContext.xml 描述类之间的依赖注入关系 # 初始化Bean工厂的两种方式 ## ClassPathXmlApplicationContext # ...

  6. java面试题08

    1.short s1 = 1; s1 = s1 + 1;有什么错? short s1 = 1; s1 += 1;有什么错? short s1 = 1; s1 = s1 + 1;编译时错误.对于shor ...

  7. flask第二十篇——模板【3】

    请关注公众号:自动化测试实战 现在我们通过查询字符串的方式给render_template传参,我们就要用到flask库的flask.request.args.get()函数先获取参数,在index. ...

  8. 船长带你看书——《selenium2 python 自动化测试实战》(1)

    有很多selenium的教程,你没有从头看,当你看的时候已经很难跟上作者的节奏了.现在,你有机会再从头学一次了.从今天开始,船长会从最基本的知识开始,和大家一起学selenium.能不能跟着一起就看大 ...

  9. 异常处理过程和异常处理的执行顺序(针对try{}catch{}finally{}而言)

    1.异常的处理方式有两种分别为:try{}catch{}finally{}和throws下面简单说一下这两者的区别和联系. 2.出现异常之后如果没有进行捕获处理系统就会直接将这个异常栈的跟踪信息直接打 ...

  10. ft,dtft,dft的关系(转载)

    很多同学学习了数字信号处理之后,被里面的几个名词搞的晕头转向,比如DFT,DTFT,DFS,FFT,FT,FS等,FT和FS属于信号与系统课程的内容,是对连续时间信号的处理,这里就不过多讨论,只解释一 ...