====== cobbler配置安装 ======
一、关闭防火墙和selinux
二、安装相关软件
# yum -y install cobbler dhcp httpd xinetd tftp-server
如果没有cobbler包是因为默认的Repository里找不到Cobbler,先安装rpmforce这个Repository。很全很强大,近10000个软件包。
# rpm -Uvh http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
三、检查配置文件
1检查: cobbler check
2.根据提示修改
把 /var/lib/cobbler/settings 中的 server 和 next_server 设为本服务器的 IP 地址,
manage_dhcp 设为 **1**,以便管理 DHCP
/etc/**xinetd.d**/tftp中disable = yes 改为=**no**
cobbler自检,如果没有错误则会有如下提示,否则按照提示修改相关配置。
[root@SVN01 ~]#cobbler check
Manual review and editing of /var/lib/cobbler/settings is recommended to tailor cobbler to your particular configuration.
Good luck.
四、修改DHCP配置文件
[root@SVN01 ~]#cp –a /etc/cobbler/dhcp.template /etc/dhcpd.conf
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Tue Jul 26 16:58:54 2011)
# ******************************************************************
ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;
set vendorclass = option vendor-class-identifier;
subnet 192.168.40.0 netmask 255.255.255.0 { /子网范围
option routers 192.168.40.1; /网关地址
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.40.75 192.168.40.80; /池大小
filename "/pxelinux.0"; /启动文件
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.40.2; /下一跳地址,TFTP服务器地址
}
五、导入安装文件
1.拷贝安装光盘iso文件到/home目录里下
2.把iso文件挂载到系统里,
#mount -o loop /home/CentOS-5-5.iso /mnt/
(-o 主要用来描述设备或档案的挂接方式.loop:用来把一个文件当成硬盘分区挂接上系统)
3.#cobbler import --mirror=/mnt/ --name=CentOS-5-4-x86-64
从 /mnt/CentOS 目录导入所有安装文件,命名为 CentOS-5-4-x86-64
4.检查导入结果
#cobbler distro list
显示如下
CentOS-5.5-bin-DVD-i386
CentOS-5.5-bin-DVD-xen-i386 (注意xen)
六、修改Kickstart 配置模板
#vi /etc/cobbler/default.ks
Kickstart 配置模板,可以用system-config-kickstart(建议)生成,也可以安装系统后在/root/anaconda-ks.cfg得到你所安装系统的配置。 使用生成
七、生成并同步所有配置
[root@SVN01 ~]#cobbler sync
sync distro: CentOS6.0-i386
sync profile: CentOS6.0-i386
Shutting down dhcpd: [ OK ]
Starting dhcpd: [ OK ]
八、启动相关服务
#chkconfig --level 345 httpd on
#chkconfig --level 345 dhcpd on
#chkconfig --level 345 xinetd on
#chkconfig --level 345 cobblerd on
#service xinetd restart
#service httpd restart
#service dhcpd restart
#service cobblerd stop
#service cobblerd start
九、检查是否正常
http://192.168.40.2/cblr/
显示目录及文件
十、客户端设置从pxe网卡启动,出现boot后:输入menu
扩展:
1、启动菜单,将local有关信息注释
#vi /tftpboot/pxelinux.cfg/default
DEFAULT local
PROMPT 1
MENU TITLE Cobbler | http://cobbler.et.redhat.com
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
#LABEL local
# MENU LABEL (local)
# MENU DEFAULT
# LOCALBOOT 0
LABEL local
kernel /images/CentOS_5.6-i386/vmlinuz
MENU LABEL CentOS_5.6-i386
……
2、安装选项
# vi /var/www/cobbler/kickstarts/CentOS_5.6-i386
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information 格式化整个磁盘
clearpart --all
# Use text mode install 文本安装无界面
text
# Firewall configuration防火墙
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard 键盘
keyboard us
# System language 语言
lang en_US
# Use network installation 使用网络安装
url --url=http:// 192.168.40.2/cblr/links/CentOS_5.6-i386
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$1I2ZyS2z$mxnO61QoBDI95yYsm3nLY1 密码
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone America/Shanghai 时区
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Magically figure out how to partition this thing
%include /tmp/partinfo
%pre
# Determine how many drives we have
set $(list-harddrives)
let numd=$#/2
d1=$1
d2 = $3
cat << EOF >> [[/tmp/partinfo]] **磁盘分区**
part /boot --fstype ext3 --size=100 --ondisk=$d1 --asprimary
part / --fstype ext3 --size=102400 --grow --ondisk=$d1 --asprimary
part swap --size=2048 --ondisk=$d1 --asprimary
#EOF
%packages 软件包
@base
@core
@development-tools
@dialup
@editors
@gnome-desktop
@graphical-internet
@graphics
@printing
@sound-and-video
@text-internet
@base-x
keyutils
iscsi-initiator-utils
trousers
fipscheck
device-mapper-multipath
imake
libsane-hpaio
xorg-x11-server-Xnest
xorg-x11-server-Xvfb
%post
$yum_config_stanza
$kickstart_done
wget http://192.168.40.2/cblr/watcher.py?profile_done=CentOS_5.6-i386 -b
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。