首頁 > 軟體

CentOS 6上安裝Cobbler及常見引數詳解

2020-06-16 17:28:43

前言
Cobbler是一個自動化和簡化系統安裝的工具,通過使用網路引導來控制和啟動安裝。Cobbler的特性包括儲存庫映象、Kickstart模板和連線電源管理系統。使用Cobbler之前需要先了解下PXE和Kickstart的基本原理,文章包含了Cobbler工作原理和Cobbler部署實踐兩部分內容,交叉關聯性的內容還是蠻多的,遇到報錯也不要怕,都會一步一步解決的。
使用Cobbler輕鬆設定和管理網路安裝環境
Cobbler工作原理
Cobbler由Python語言開發,是對PXE和Kickstart以及DHCP的封裝。融合很多特性,提供了CLI和Web的管理形式。更加方便的實行網路安裝。同時,Cobbler也提供了API介面,使用其它語言也很容易做擴充套件。它不緊可以安裝物理機,同時也支援kvm、xen虛擬化、Guest OS的安裝。更多的是它還能結合Puppet等集中化管理軟體,實現自動化的管理。
Cobbler 支援眾多的發行版:Red HatFedoraCentOS、Debian、UbuntuSUSE。當新增一個作業系統(通常通過使用 ISO 檔案)時,Cobbler 知道如何解壓縮合適的檔案並調整網路服務,以正確引導機器。Cobbler 使用命令列方式管理,也提供了基於Web的圖形化設定管理工具(cobbler-web)。通過設定cobbler自動部署DHCP、TFTP、HTTP,在安裝過程中載入kiskstart無人值守安裝應答檔案實現無人值守。從用戶端使用PXE引導啟動安裝。

--------------------------------------------------------------------------------

Server端
第一步,啟動Cobbler服務
第二步,進行Cobbler錯誤檢查,執行cobbler check命令
第三步,進行設定同步,執行cobbler sync命令
第四步,複製相關啟動檔案檔案到TFTP目錄中
第五步,啟動DHCP服務,提供地址分配
第六步,DHCP服務分配IP地址
第七步,TFTP傳輸啟動檔案
第八步,Server端接收安裝資訊
第九步,Server端傳送ISO映象與Kickstart檔案

--------------------------------------------------------------------------------

Client端
第一步,用戶端以PXE模式啟動
第二步,用戶端獲取IP地址
第三步,通過TFTP伺服器獲取啟動檔案
第四步,進入Cobbler安裝選擇介面
第五步,用戶端確定載入資訊
第六步,根據設定資訊準備安裝系統
第七步,載入Kickstart檔案
第八步,傳輸系統安裝的其它檔案
第九步,進行安裝系統
Cobbler部署實踐
設定YUM源
cd /etc/yum.repo.d/
vi epel.repo

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priority
enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
baseurl=
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearchfailovermethod=priority
enabled=0gpgkey=
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
baseurl=
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearchfailovermethod=priority
enabled=0gpgkey=
#匯入GPG keysudo rpm --import 
#修改repo檔案新增CentOS 6.X的YUM源cd /etc/yum.repos.d/
cp rhel-source.repo rhel-source.repo.bak
vi rhel-source.repo

[base]
name=CentOS-$releasever-Base
baseurl=http://centos.ustc.edu.cn/centos/6/os/x86_64/
gpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6[updates]
name=CentOS-$releasever-Updates
baseurl=http://centos.ustc.edu.cn/centos/6/os/x86_64/
gpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6[extras]
name=CentOS-$releasever-Extras
baseurl=http://centos.ustc.edu.cn/centos/6/os/x86_64/
gpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6[centosplus]
name=CentOS-$releasever-Plus
baseurl=http://centos.ustc.edu.cn/centos/6/os/x86_64/
gpgcheck=1清除快取檢視是否生效
yum clean all
yum makecache
yum repolist直接cobbler關聯依賴包
yum install cobbler
cobbler-web
httpd
rsync
tftp-server
 xinetd
 dhcp         
python-ctypes
debmirror
pykickstart
cman
fence-agents
dnsmasq

#使用yum-plugin-downloadonly外掛yum install -y yum-plugin-downloadonly
yum install
--downloadonly
--downloaddir=/tmp/cobbler
cobbler
cobbler-web
httpd rsync
tftp-server
xinetd
dhcp
 python-ctypes
 debmirror
pykickstart
cman
fence-agents
 dnsmasq必要服務
(1)cobbler (cobbler的核心)
(2)httpd (提供cobbler的web介面)
(3)dhcpd (為自動安裝系統分配IP地址)
(4)epel-release (為之提供yum源)
(5)rsync (cobbler需要同步資訊)
(6)cobbler-web (cobbler的一個web外掛)
(7)xinetd (為rsync和tftp的守護行程)
(8)tftp (傳送安裝的一些檔案的類似ftp)
檢查cobbler設定,常見錯誤如下
cobbler check1 : 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.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.3 : change 'disable' to 'no' in /etc/xinetd.d/tftp4 : 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.5 : change 'disable' to 'no' in /etc/xinetd.d/rsync6 : file /etc/xinetd.d/rsync does not exist7 : debmirror package is not installed, it will be required to manage debian
deployments and repositories8 : ksvalidator was not found, install pykickstart9 : 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 one10 : fencing tools were not found, and are required to use the (optional)
power management features. install cman or fence-agents to use them1.編輯/etc/cobbler/settings檔案,找到 server選項,修改為本機IP即可
2.編輯/etc/cobbler/settings檔案,找到 next_server選項,修改為本機IP即可
3.SELinux的設定, 如果上面已經關閉了SELinux就不用管了
4.執行 cobbler get-loaders,系統將自動下載loader程式,完成提示4的修復工作。
5.編輯/etc/xinetd.d/tftp檔案,將檔案中的disable欄位的設定由yes改為no
6.編輯/etc/xinetd.d/rsync檔案,將檔案中的disable欄位的設定由yes改為no
7.在iptables中將69,80,25151埠開啟。如果僅僅只是在內部環境中使用,建議直接將防火牆關掉
8.提示說debmirror沒安裝。如果不是安裝 debian之類的系統,此提示可以忽略
9.修改cobbler使用者的預設密碼,可以使用如下命令生成密碼,並使用生成後的密碼替換/etc/cobbler/settings中的密碼。生成密碼命令:openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'其中“random-phrase-here”為任意字元
10.安裝cman或者fence-agents
關閉selinux/iptables
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
setenforce 0
chkconfig iptables off
service iptables stop
設定tftp服務和rsync服務
sed -i '/disable/ctdisablettt= no' /etc/xinetd.d/tftp
sed -i -e 's/= yes/= no/g' /etc/xinetd.d/rsync
設定DHCP server的IP
sed -i 's/next_server: 127.0.0.1/next_server: 172.28.70.245/g' /etc/cobbler/settings
設定cobbler的IP
sed -i 's/server: 127.0.0.1/server: 172.28.70.245/g' /etc/cobbler/settings
設定Cobbler管理rsync
sed -i 's/manage_rsync: 0/manage_rsync: 1/g' /etc/cobbler/settings
設定Cobbler管理DHCP
sed -i 's/manage_dhcp: 0/manage_dhcp: 1/g' /etc/cobbler/settings
設定Cobbler一次安裝開關(可選)
sed -i 's/pxe_just_once: 0/pxe_just_once: 1/g' /etc/cobbler/settings
設定Cobbler管理DNS(可選)
sed -i 's/manage_dns: 0/manage_dns: 1/g' /etc/cobbler/settings
開啟動態更新(可選)
sed -i 's/allow_dynamic_settings: 0/allow_dynamic_settings: 1/g' /etc/cobbler/settings
設定debmirror
sed -i -e 's/@dists=/#@dists=/g' /etc/debmirror.conf
sed -i -e 's/@arches=/#@arches=/g' /etc/debmirror.conf
編輯dnsmasq.template中dhcp-range部分
#vi /etc/cobbler/dnsmasq.templatevi /etc/dnsmasq.conf# Cobbler generated configuration file for dnsmasq# $date## resolve.conf .. ?#no-poll#enable-dbusread-ethers
addn-hosts = /var/lib/cobbler/cobbler_hosts

dhcp-range=172.28.70.246,172.28.70.250dhcp-option=3,$next_serverdhcp-lease-max=1000dhcp-authoritative
dhcp-boot=pxelinux.0dhcp-boot=net:normalarch,pxelinux.0dhcp-boot=net:ia64,$elilo
#重新啟動dnsmasq/etc/init.d/dnsmasq restart#編輯dhcp.templatecp /etc/cobbler/dhcp.template /etc/cobbler/dhcp.template.bak
vi /etc/cobbler/dhcp.template
# ******************************************************************
# Cobbler managed dhcpd.conf file#
# generated from cobbler dhcp.conf template ($date)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************
#ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;set vendorclass = option vendor-class-identifier;

option pxe-system-type code 93 = unsigned integer 16;

subnet 172.28.70.0 netmask 255.255.255.0 {
    option routers            172.28.70.254;
    option domain-name-servers 172.28.70.254;
    option subnet-mask        255.255.255.0;
    range dynamic-bootp        172.28.70.246 172.28.70.250;
    default-lease-time        21600;
    max-lease-time            43200;
    next-server                $next_server;
    class "pxeclients" {
          match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";       
          if option pxe-system-type = 00:02 {
                  filename "ia64/elilo.efi";
          } else if option pxe-system-type = 00:06 {
                  filename "grub/grub-x86.efi";
          } else if option pxe-system-type = 00:07 {
                  filename "grub/grub-x86_64.efi";
          } else {
                  filename "pxelinux.0";
          }
    }

}#for dhcp_tag in $dhcp_tags.keys():
    ## group could be subnet if your dhcp tags line up with your subnets
    ## or really any valid dhcpd.conf construct ... if you only use the
    ## default dhcp tag in cobbler, the group block can be deleted for a
    ## flat configuration# group for Cobbler DHCP tag: $dhcp_taggroup {     
    #for mac in $dhcp_tags[$dhcp_tag].keys():
            #set iface = $dhcp_tags[$dhcp_tag][$mac]
    host $iface.name {
        hardware ethernet $mac;        #if $iface.ip_address:
        fixed-address $iface.ip_address;        #end if
        #if $iface.hostname:
        option host-name "$iface.hostname";        #end if
        #if $iface.netmask:
        option subnet-mask $iface.netmask;        #end if
        #if $iface.gateway:
        option routers $iface.gateway;        #end if
        #if $iface.enable_gpxe:
        if exists user-class and option user-class = "gPXE" {
            filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
        } else if exists user-class and option user-class = "iPXE" {
            filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
        } else {
            filename "undionly.kpxe";
        }        #else
        filename "$iface.filename";        #end if
        ## Cobbler defaults to $next_server, but some users
        ## may like to use $iface.system.server for proxied setups
        next-server $next_server;        ## next-server $iface.next_server;
    }        #end for}#end for#將dns和dhcp的管理引擎都設定為dnsmasq,
    修改/etc/cobbler/modules.confvi /etc/cobbler/modules.conf

[authentication]
module = authn_configfile
[dns]
module = manage_dnsmasq
[dhcp]
module = manage_dnsmasq#修改httpd設定並啟動vi /etc/httpd/conf/httpd.conf

ServerName 127.0.0.1:80/etc/init.d/httpd restart設定目標系統root密碼,這個設定只對CentOS/RHEL有效
PASSWORD="echo "admin123" | openssl passwd -1 -salt 'root' –stdin"
sed -i s@"^default_password_crypted.*$"@"default_password_crypted: "$PASSWORD""@g /etc/cobbler/settings

--------------------------------------------------------------------------------
default_password_crypted: "$1$cobbler$k/5ITeQUOffuOujzEvhjY."

--------------------------------------------------------------------------------

下載啟動選單,啟動報錯請嘗試service cobblerd restart
cobbler get-loaders

cobbler@root#cobbler get-loaderstask started: 2016-04-11_092911_get_loaders
task started (id=Download Bootloader Content, time=Mon Apr 11 09:29:11 2016)
downloading http://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README
downloading http://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
downloading http://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
downloading http://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
downloading http://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading http://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot
downloading http://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0downloading
http://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
downloading http://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
downloading http://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***#重新啟動相關服務並設定自動啟動chkconfig cobblerd on 
chkconfig httpd on
chkconfig xinetd on
chkconfig dnsmasq on

service httpd restart 
service xinetd restart 
service dnsmasq restart
service cobblerd restart 


#檢查並同步cobbler設定,如果有如下報錯確認檔案存在可以忽略cobbler@ZJ/etc/cobbler#cobbler checkThe following are potential configuration items that you may want to fix:1 : file /etc/xinetd.d/rsync does not exist

Restart cobblerd and then run 'cobbler sync' to apply changes.

cobbler@ZJ/etc/cobbler#cobbler synctask started: 2016-04-11_170138_sync
task started (id=Sync, time=Mon Apr 11 17:01:38 2016)
running pre-sync triggers
cleaning trees
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 ->
 /var/lib/tftpboot/pxelinux.0trying 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 /usr/share/syslinux/memdisk -> /var/lib/tftpboot/memdisk
trying hardlink /var/lib/cobbler/loaders/grub-x86_64.efi -> /var/lib/tftpboot/grub/grub-x86_64.efi
trying hardlink /var/lib/cobbler/loaders/grub-x86.efi -> /var/lib/tftpboot/grub/grub-x86.efi
copying distros to tftpboot
copying images
generating PXE configuration files
generating PXE menu structure
rendering DHCP files
rendering DNS files
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
rendering Rsync files
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: service dnsmasq restart
received on stdout: Shutting down dnsmasq: [  OK  ]
Starting dnsmasq: [  OK  ]

received on stderr:
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 ***#開啟動態編輯後的效果cobbler setting report
cobbler setting report [--name=option]

allow_duplicate_hostnames              : 0allow_duplicate_ips                    : 0allow_duplicate_macs                    : 0allow_dynamic_settings                  : 1always_write_dhcp_entries              : 0anamon_enabled                          : 0auth_token_expiration                  : 3600authn_pam_service                      : loginbind_chroot_path                        :
bind_master                            : 127.0.0.1build_reporting_email                  : ['root@localhost']
build_reporting_enabled                : 0build_reporting_ignorelist              : ['']
build_reporting_sender                  :
build_reporting_smtp_server            : localhost
build_reporting_subject                :
build_reporting_to_address              :
buildisodir                            : /var/cache/cobbler/buildiso
cheetah_import_whitelist                : ['random', 're', 'time']
client_use_https                        : 0client_use_localhost                    : 0cobbler_master                          :
consoles                                : /var/consoles
createrepo_flags                        : -c cache -s sha
default_deployment_method              : ssh
default_kickstart                      : /var/lib/cobbler/kickstarts/default.ks
default_name_servers                    : []
default_name_servers_search            : []
default_ownership                      : ['admin']
default_password_crypted                : $1$root$JX8M6OcOn.pjk0pHdnG0y0
default_template_type                  : cheetah
default_virt_bridge                    : xenbr0
default_virt_disk_driver                : raw
default_virt_file_size                  : 5default_virt_ram                        : 512default_virt_type                      : xenpvenable_gpxe                            : 0enable_menu                            : 1func_auto_setup                        : 0func_master                            : overlord.example.org
http_port                              : 80isc_set_host_name                      : 0iso_template_dir                        : /etc/cobbler/iso
kerberos_realm                          : EXAMPLE.COM
kernel_options                          : {'ksdevice': 'bootif', 'lang': ' ', 'text': '~'}
kernel_options_s390x                    : {'vnc': '~', 'ip': False, 'RUNKS': 1,
'ramdisk_size': 40000, 'ro': '~', 'root': '/dev/ram0'}
ldap_anonymous_bind                    : 1ldap_base_dn                            : DC=example,DC=com
ldap_management_default_type            : authconfig
ldap_port                              : 389ldap_search_bind_dn                    :
ldap_search_passwd                      :
ldap_search_prefix                      : uid=
ldap_server                            : ldap.example.com
ldap_tls                                : 1ldap_tls_cacertfile                    :
ldap_tls_certfile                      :
ldap_tls_keyfile                        :
manage_dhcp                            : 1manage_dns                              : 1manage_forward_zones                    : []
manage_reverse_zones                    : []
manage_rsync                            : 1manage_tftp                            : 1manage_tftpd                            : 1mgmt_classes                            : []
mgmt_parameters                        : {'from_cobbler': 1}
next_server                            : 172.28.70.245power_management_default_type          : ipmitool
power_template_dir                      : /etc/cobbler/power
proxy_url_ext                          :
proxy_url_int                          :
puppet_auto_setup                      : 0puppet_parameterized_classes            : 1puppet_server                          : puppet
puppet_version                          : 2puppetca_path                          : /usr/bin/puppet
pxe_just_once                          : 1pxe_template_dir                        : /etc/cobbler/pxe
RedHat_management_key                  :
redhat_management_permissive            : 0redhat_management_server                : xmlrpc.rhn.redhat.com
redhat_management_type                  : off
register_new_installs                  : 0remove_old_puppet_certs_automatically  : 0replicate_repo_rsync_options            : -avzH
replicate_rsync_options                : -avzH
reposync_flags                          : -l -n -drestart_dhcp                            : 1restart_dns                            : 1restart_xinetd                          : 1run_install_triggers                    : 1scm_track_enabled                      : 0scm_track_mode                          : git
serializer_pretty_json                  : 0server                                  : 172.28.70.245sign_puppet_certs_automatically        : 0signature_path                          : /var/lib/cobbler/distro_signatures.json
signature_url                          : http://cobbler.github.io/signatures/2.6.x/latest.json
snippetsdir                            : /var/lib/cobbler/snippets
template_remote_kickstarts              : 0virt_auto_boot                          : 1webdir                                  : /var/www/cobbler
xmlrpc_port                            : 25151yum_distro_priority                    : 1yum_post_install_mirror                : 1yumdownloader_flags                    : --resolve#修改seting檔案cobbler登陸伺服器地址cobbler setting edit --name=server --value=172.28.0.1#ks指令碼關閉pxe,這樣就不會重複安裝cobbler setting edit --name=pxe_just_once --value=1#TFTP伺服器 IP地址cobbler setting edit --name=next_server --value=172.28.0.1#cobbler管理rsync,dhcp,dnscobbler setting edit --name=manage_rsync --value=1cobbler setting edit --name=manage_dhcp --value=1cobbler setting edit --name=manage_dns --value=1cobbler匯入映象#使用映象檔案mount -o loop /tmp/rhel-server-6.3-x86_64-dvd.iso /mnt/rhel63#使用光碟mount /dev/sr0 /mnt/rhel63#執行映象匯入,並關聯自定義的自動安裝設定ks指令碼,這個地方我們可以為不同的系統版本指定不同的自動安裝ks指令碼(這個過程實際比較長,cobbler
會把軟體整個複製一份到本地,在這之前,務必確認硬碟空間足夠裝下鏡
像)
cobbler import --path=/tmp/rhel63 --name=rhel63 --kickstart=/var/lib/cobbler/kickstarts/rhel63.cfg

task started: 2016-04-12_090326_import
task started (id=Media import, time=Tue Apr 12 09:03:26 2016)
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/rhel63:
creating new distro: rhel63-x86_64
trying symlink: /var/www/cobbler/ks_mirror/rhel63 -> /var/www/cobbler/links/rhel63-x86_64
creating new profile: rhel63-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/rhel63 for rhel63-x86_64
processing repo at : /var/www/cobbler/ks_mirror/rhel63
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel63
looking for /var/www/cobbler/ks_mirror/rhel63/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel63/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel63/HighAvailability
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel63/HighAvailability
looking for /var/www/cobbler/ks_mirror/rhel63/HighAvailability/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel63/HighAvailability/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel63/Server
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel63/Server
looking for /var/www/cobbler/ks_mirror/rhel63/Server/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel63/Server/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel63/LoadBalancer
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel63/LoadBalancer
looking for /var/www/cobbler/ks_mirror/rhel63/LoadBalancer/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel63/LoadBalancer/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel63/ScalableFileSystem
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel63/ScalableFileSystem
looking for /var/www/cobbler/ks_mirror/rhel63/ScalableFileSystem/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel63/ScalableFileSystem/repodata
processing repo at : /var/www/cobbler/ks_mirror/rhel63/ResilientStorage
need to process repo/comps: /var/www/cobbler/ks_mirror/rhel63/ResilientStorage
looking for /var/www/cobbler/ks_mirror/rhel63/ResilientStorage/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/rhel63/ResilientStorage/repodata
*** TASK COMPLETE ***
#檢視cobbler匯入結果cobbler distro list cobbler report
#驗證ks有效性,剩下的就是PXE引導測試了cobbler validateks
cobbler-web#設定Web登入,cobbler 2.6以上版本已經無需修改sed -i 's/module = authn_denyall/module = authn_configfile/g' /etc/cobbler/modules.conf
#設定Cobbler Web登入使用者登入密碼htdigest /etc/cobbler/users.digest "Cobbler" cobbler
Changing password for user cobbler in realm Cobbler
New password:cobbler
Re-type new password:cobbler#cobbler_web登入地址,推薦使用命令列管理http://{IP}/cobbler_web
Cobbler相關選項說明#Cobbler 常用命令詳解cobbler check
#檢查cobbler設定 cobbler sync
 #同步設定到dhcp/pxe和資料目錄 cobbler list
 #列出所有的cobbler元素 cobbler import
#匯入安裝的系統映象 cobbler report
 #列出各元素的詳細資訊 cobbler distro
#檢視匯入的發行版系統資訊 cobbler profile
#檢視設定資訊 cobbler system #檢視新增的系統資訊 cobbler reposync
#同步yum倉庫到本地#匯入映象檔案命令:
cobbler import --path=映象路徑 -- name=安裝引導名 --arch=32位元或64位元
引數:
path 是映象所掛載的目錄
name 是匯入到cobbler裡面顯示的名字
arch 是32位元系統還是64位元系統
#匯入kickstart檔案命令:cobbler profile add --name=list名 --distro=映象 --kickstart=路徑
引數:
name是表示新增的ks 的名字,用cobbler report可以看到這個名字
distro 是用哪個映象,list的distros裡面選擇一個,需要版本相對應
kickstart 是具體的 ks 檔案路徑#同步DHCP、HTTPD命令:cobbler sync
注,每次修改完dhcp.template之類的組態檔需要執行一次使其生效。
#檢視Cobbler列表命令:cobbler list
注,列出Cobbler所有的元素。
#刪除相關列表命令:cobbler distro/profile remove --name=要刪除的引導檔名
刪除指定 distro , 也就是映象
刪除指定的 profile 檔案,也就是 ks
#Cobbler安裝後目錄說明cobbler組態檔目錄/etc/cobbler:
/etc/cobbler/settings #cobbler主組態檔 /etc/cobbler/iso/
#iso模板組態檔 /etc/cobbler/pxe
#pxe模板檔案 /etc/cobbler/power
#電源的組態檔 /etc/cobbler/users.conf
#Web 服務授權組態檔 /etc/cobbler/users.digest
#用於web存取的使用者名稱密碼組態檔 /etc/cobbler/dhcp.template
#DHCP服務的設定模板 /etc/cobbler/dnsmasq.template
#DNS服務的設定模板 /etc/cobbler/tftpd.template
 #tftp服務的設定模板 /etc/cobbler/modules.conf
 #Cobbler模組組態檔cobbler資料目錄/var/lib/cobbler:
/var/lib/cobbler/config/ #用於存放distros、systems、profiles等資訊組態檔 /var/lib/cobbler/triggers
#用於存放使用者定義的cobbler 命令 /var/lib/cobbler/kickstarts/
#預設存放kickstart檔案 /var/lib/cobbler/loaders
#存放的各種載入程式映象資料目錄/var/www/cobbler:
/var/www/cobbler/ks_mirror/
#匯入的發行版系統的所有資料 /var/www/cobbler/images/
#匯入發行版的Kernel和initrd映象用於遠端網路啟動 /var/www/cobbler/repo_mirror/
#yum倉庫儲存目錄紀錄檔目錄 /var/log/cobbler/:
/var/log/cobbler/install.log
#用戶端的安裝系統紀錄檔 /var/log/cobbler/cobbler.log
 #cobbler紀錄檔常見問題
#多檢視錯誤紀錄檔less /var/log/cobbler/cobbler.log
#為cobbler-web重置使用者密碼htdigest /etc/cobbler/users.digest "Cobbler" cobbler
#新增新使用者htdigest /etc/cobbler/users.digest "Cobbler"  usernam
#DHCP多網絡卡環境可以指定網絡卡vi /etc/sysconfig/dhcpd
# Command line options hereDHCPDARGS=eth0

Linux運維自動化之Cobbler安裝部署RHEL7.0  http://www.linuxidc.com/Linux/2015-09/123326.htm

Cobbler自動批次部署CentOS 6和CentOS 7   http://www.linuxidc.com/Linux/2015-09/122945.htm

自動化安裝工具Cobbler簡易安裝設定 http://www.linuxidc.com/Linux/2015-09/122569.htm

Cobbler批次安裝Ubuntu/CentOS系統  http://www.linuxidc.com/Linux/2015-02/113167.htm

運維自動化之Cobbler安裝設定 http://www.linuxidc.com/Linux/2013-03/81575.htm

RHEL5.5下Cobbler的設定 http://www.linuxidc.com/Linux/2013-06/86115.htm

Cobbler自動化安裝部署Ubuntu和CentOS教學 http://www.linuxidc.com/Linux/2016-07/133574.htm

Cobbler批次部署Linux系統 http://www.linuxidc.com/Linux/2014-02/97259.htm

本文永久更新連結地址http://www.linuxidc.com/Linux/2016-11/137156.htm


IT145.com E-mail:sddin#qq.com