歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 6上安裝Cobbler及常見參數詳解

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

日期:2017/2/28 13:47:11   编辑:Linux教程

前言
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 Hat、Fedora、CentOS、Debian、Ubuntu 和 SUSE。當添加一個操作系統(通常通過使用 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/c\tdisable\t\t\t= 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

Copyright © Linux教程網 All Rights Reserved