cobbler系统安装
1、安装
系统环境为centos ,仓库源为epel。
yum install cobbler
Total download size: 3.1 M
Installed size: 14 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): PyYAML-3.10-3.el6.x86_64.rpm | 157 kB 00:00
(2/9): cobbler-2.4.0-1.el6.noarch.rpm | 664 kB 00:00
(3/9): libyaml-0.1.3-1.el6.x86_64.rpm | 52 kB 00:00
(4/9): mod_wsgi-3.2-3.el6.x86_64.rpm | 66 kB 00:00
(5/9): python-cheetah-2.4.1-1.el6.x86_64.rpm | 365 kB 00:00
(6/9): python-markdown-2.0.1-3.1.el6.noarch.rpm | 118 kB 00:00
(7/9): python-netaddr-0.7.5-4.el6.noarch.rpm | 1.0 MB 00:00
(8/9): python-pygments-1.1.1-1.el6.noarch.rpm | 562 kB 00:00
(9/9): python-simplejson-2.0.9-3.1.el6.x86_64.rpm | 126 kB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s | 3.1 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mod_wsgi-3.2-3.el6.x86_64 1/9
Installing : python-simplejson-2.0.9-3.1.el6.x86_64 2/9
Installing : libyaml-0.1.3-1.el6.x86_64 3/9
Installing : PyYAML-3.10-3.el6.x86_64 4/9
Installing : python-markdown-2.0.1-3.1.el6.noarch 5/9
Installing : python-netaddr-0.7.5-4.el6.noarch 6/9
Installing : python-pygments-1.1.1-1.el6.noarch 7/9
Installing : python-cheetah-2.4.1-1.el6.x86_64 8/9
Installing : cobbler-2.4.0-1.el6.noarch 9/9
Installed:
cobbler.noarch 0:2.4.0-1.el6
Dependency Installed:
PyYAML.x86_64 0:3.10-3.el6 libyaml.x86_64 0:0.1.3-1.el6 mod_wsgi.x86_64 0:3.2-3.el6
python-cheetah.x86_64 0:2.4.1-1.el6 python-markdown.noarch 0:2.0.1-3.1.el6 python-netaddr.noarch 0:0.7.5-4.el6
python-pygments.noarch 0:1.1.1-1.el6 python-simplejson.x86_64 0:2.0.9-3.1.el6
Complete!
2、启动
service cobblerd start
3、开机自起
chkconfig cobblerd on
5、重启httpd
service httpd restart
6、登录查看
7、检查
cobbler check
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.
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 : 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.
4 : change 'disable' to 'no' in /etc/xinetd.d/rsync
5 : since iptables may be running, ensure 69, 80/443, and 25151 are unblocked
6 : debmirror package is not installed, it will be required to manage debian deployments and repositories
7 : 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
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
7.1 修改server、next_server字段
vi setting 修改如下
next_server: 192.168.1.210
server: 192.168.1.210
manage_dhcp: 1
default_password_crypted: "$1$random-p$YizZiZO2TwuspIFgitb/f0" # $1$random-p$YizZiZO2TwuspIFgitb/f0 为
重启 service cobblerd restart
7.2 下载引导程序
cobbler get-loaders
task started: 2013-12-17_173850_get_loaders
task started (id=Download Bootloader Content, time=Tue Dec 17 17:38:50 2013)
downloading to /var/lib/cobbler/loaders/README
downloading to /var/lib/cobbler/loaders/COPYING.elilo
downloading to /var/lib/cobbler/loaders/COPYING.yaboot
downloading to /var/lib/cobbler/loaders/COPYING.syslinux
downloading to /var/lib/cobbler/loaders/elilo-ia64.efi
downloading to /var/lib/cobbler/loaders/yaboot
downloading to /var/lib/cobbler/loaders/pxelinux.0
downloading to /var/lib/cobbler/loaders/menu.c32
downloading to /var/lib/cobbler/loaders/grub-x86.efi
downloading to /var/lib/cobbler/loaders/grub-x86_64.efi
*** TASK COMPLETE ***
7.3 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 # yes 修改为 no
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
8、应用改变
cobbler sync
task started: 2013-12-17_174248_sync
task started (id=Sync, time=Tue Dec 17 17:42:48 2013)
running pre-sync triggers
cleaning trees
mkdir: /var/lib/tftpboot/pxelinux.cfg
mkdir: /var/lib/tftpboot/grub
mkdir: /var/lib/tftpboot/s390x
mkdir: /var/lib/tftpboot/ppc
mkdir: /var/lib/tftpboot/etc
removing: /var/lib/tftpboot/grub/images
copying bootloaders
trying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> /var/lib/tftpboot/pxelinux.0
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 /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 TFTPD files
generating /etc/xinetd.d/tftp
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 ***
9、重启 cobblerd
10、导入安装文件
mkdir -p /var/iso/Linux/Centos/x86_64/6.4
mount -o loop /root/CentOS-6.4-x86_64-bin-DVD1.iso /var/iso/Linux/Centos/x86_64/6.4
cobbler import --path=/var/iso/Linux/Centos/x86_64/6.4 --name CentOS_6.4_X86_64
task started: 2013-12-18_134530_import
task started (id=Media import, time=Wed Dec 18 13:45:30 2013)
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_6.4_X86_64:
creating new distro: CentOS_6.4_X86_64-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS_6.4_X86_64 -> /var/www/cobbler/links/CentOS_6.4_X86_64-x86_64
creating new profile: CentOS_6.4_X86_64-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_6.4_X86_64 for CentOS_6.4_X86_64-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS_6.4_X86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS_6.4_X86_64
looking for /var/www/cobbler/ks_mirror/CentOS_6.4_X86_64/repodata/*comps*.xml
running: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_mirror/CentOS_6.4_X86_64/repodata/2727fcb43fbe4c1a3588992af8c19e4d97167aee2f6088959221fc285cab6f72-c6-x86_64-comps.xml /var/www/cobbler/ks_mirror/CentOS_6.4_X86_64
2661/3955 - Packages/expat-devel-2.0.1-11.el6_2.x86_64.rpm
iso-8859-1 encoding on Ville Skyttille.skytta@iki.fi> - 2.8.2-2
3955/3955 - Packages/libini_config-0.6.1-9.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
received on stderr:
*** TASK COMPLETE ***
导入fedora20安装(暂时cobbler不支持)
mkdir -p /var/iso/Linux/Fedora/x86_64/20
mount -o loop /opt/tiros-ci/Fedora-20-x86_64-DVD.iso /var/iso/Linux/Fedora/x86_64/20/
cobbler import --path=/var/iso/Linux/Fedora/x86_64/20 --name Fedora-20-x86_64
cobbler profile add --name=Fedora-20-x86_64 --kickstart=/var/lib/cobbler/kickstarts/fedora20.ks
导入fedora19安装
mkdir -p /var/iso/Linux/Fedora/x86_64/19
mount -o loop /opt/tiros-ci/Fedora-19-x86_64-DVD.iso /var/iso/Linux/Fedora/x86_64/19
cobbler import --path=/var/iso/Linux/Fedora/x86_64/19 --name Fedora-19-x86_64
修改ks模版
cobbler profile edit --name=Fedora-19-x86_64 --kickstart=/var/lib/cobbler/kickstarts/fedora19.ks
为一个distro增加多个profile
# centos 6.4 增加一个server的安装ks模版
cobbler profile add CentOS_6.4_X86_64-Server --name=CentOS_6.4_X86_64-Server --distro=CentOS_6.4_X86_64-x86_64 --kickstart=/var/lib/cobbler/kickstarts/server.ks
fedora 20 的问题解决
cobbler profile add Fedora-20-X86_64 --name=Fedora-20-X86_64_Desktop --distro=Fedora-20-X86_64
11、检查
cobbler list
distros:
CentOS_6.4_X86_64-x86_64
profiles:
CentOS_6.4_X86_64-x86_64
systems:
repos:
images:
mgmtclasses:
packages:
files:
12、安装cobbler前端
yum -y install cobbler-web
13、重启cobbler和httpd
service cobblerd restart ;service httpd restart
14、通过cobbler_web进行管理
htdigest /etc/cobbler/users.digest "Cobbler" cobbler
设置为tiros
15、设置root初始密码
openssl passwd -1 -salt 'random-phrase-here' 'somePassword' #自行定义密码
16、设置dhcp
cp /etc/cobbler/dhcp.template /etc/cobbler/dhcp.template.$(date +%F)
vi dhcp.template
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 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option domain-name-servers 202.106.0.20;
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.1.248 192.168.1.249;
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";
}
}
启动 service dhcpd start
17、解决dhcp安装冲突
yum update dhclient
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.neusoft.edu.cn
* epel: mirrors.neusoft.edu.cn
* extras: mirrors.neusoft.edu.cn
* updates: mirrors.stuhome.net
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package dhclient.x86_64 12:4.1.1-38.P1.el6.centos set to be updated
--> Processing Dependency: dhcp-common = 12:4.1.1-38.P1.el6.centos for package: 12:dhclient-4.1.1-38.P1.el6.centos.x86_64
--> Running transaction check
---> Package dhcp-common.x86_64 12:4.1.1-38.P1.el6.centos set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================
Updating:
dhclient x86_64 12:4.1.1-38.P1.el6.centos base 317 k
Installing for dependencies:
dhcp-common x86_64 12:4.1.1-38.P1.el6.centos base 142 k
Transaction Summary
===========================================================================================================================================
Install 1 Package(s)
Upgrade 1 Package(s)
Total size: 459 k
Total download size: 317 k
Is this ok [y/N]: y
Downloading Packages:
dhclient-4.1.1-38.P1.el6.centos.x86_64.rpm | 317 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 12:dhcp-common-4.1.1-38.P1.el6.centos.x86_64 1/3
Updating : 12:dhclient-4.1.1-38.P1.el6.centos.x86_64 2/3
Cleanup : 12:dhclient-4.1.1-12.P1.el6.x86_64 3/3
Dependency Installed:
dhcp-common.x86_64 12:4.1.1-38.P1.el6.centos
Updated:
dhclient.x86_64 12:4.1.1-38.P1.el6.centos
Complete!
[root@h210 cobbler]# yum install dhcp
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.neusoft.edu.cn
* epel: mirrors.neusoft.edu.cn
* extras: mirrors.neusoft.edu.cn
* updates: mirrors.stuhome.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package dhcp.x86_64 12:4.1.1-38.P1.el6.centos set to be updated
--> Processing Dependency: portreserve for package: 12:dhcp-4.1.1-38.P1.el6.centos.x86_64
--> Running transaction check
---> Package portreserve.x86_64 0:0.0.4-9.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================================================
Package Arch Version Repository Size
===========================================================================================================================================
Installing:
dhcp x86_64 12:4.1.1-38.P1.el6.centos base 817 k
Installing for dependencies:
portreserve x86_64 0.0.4-9.el6 base 23 k
Transaction Summary
===========================================================================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)
Total size: 840 k
Installed size: 1.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : portreserve-0.0.4-9.el6.x86_64 1/2
Installing : 12:dhcp-4.1.1-38.P1.el6.centos.x86_64 2/2
Installed:
dhcp.x86_64 12:4.1.1-38.P1.el6.centos
Dependency Installed:
portreserve.x86_64 0:0.0.4-9.el6
Complete!
18、导入centos7安装
#更新cobbler
yum update cobbler
# 更新cobbler 签名库
cobbler signature update
task started: 2014-08-15_103044_sigupdate
task started (id=Updating Signatures, time=Fri Aug 15 10:30:44 2014)
Successfully got file from
*** TASK COMPLETE ***
# 挂载centos7的iso
mount -o loop /opt/tiros-ci/CentOS-7.0-1406-x86_64-DVD.iso /var/iso/Linux/Centos/x86_64/7
#导入centos7到cobbler内
cobbler import --path=/var/iso/Linux/Centos/x86_64/7 --name CentOS_7_x86_64
task started: 2014-08-15_163941_import
task started (id=Media import, time=Fri Aug 15 16:39:41 2014)
Found a candidate signature: breed=redhat, version=rhel6
Found a candidate signature: breed=redhat, version=rhel7
Found a matching signature: breed=redhat, version=rhel7
Adding distros from path /var/www/cobbler/ks_mirror/CentOS_7_x86_64:
creating new distro: CentOS_7-x86_64
trying symlink: /var/www/cobbler/ks_mirror/CentOS_7_x86_64 -> /var/www/cobbler/links/CentOS_7-x86_64
creating new profile: CentOS_7-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_7_x86_64 for CentOS_7-x86_64
processing repo at : /var/www/cobbler/ks_mirror/CentOS_7_x86_64
need to process repo/comps: /var/www/cobbler/ks_mirror/CentOS_7_x86_64
looking for /var/www/cobbler/ks_mirror/CentOS_7_x86_64/repodata/*comps*.xml
Keeping repodata as-is :/var/www/cobbler/ks_mirror/CentOS_7_x86_64/repodata
*** TASK COMPLETE ***
阅读(3786) | 评论(0) | 转发(0) |