linux装机利器cobbler安装配置-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 6315150
  • 博文数量: 162
  • 博客积分: 3600
  • 博客等级: 中校
  • 技术积分: 10366
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-19 11:23
个人简介

专注系统运维、网络架构,研究技术凯发app官方网站的解决方案,记录我的思想轨迹、工作学习、生活和关注的领域

文章分类
文章存档

2014年(2)

2013年(16)

2012年(27)

2011年(117)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: linux

2011-05-27 15:31:05

一、安装环境
centos 5.4
关掉iptables 关掉 selinux selinux 导致tftp的目录无法访问 pxe停止在引导界面

二、cobbler使用目录及文件
cobbler相关配置文件 /etc/cobbler
cobbler数据存储目录 /var/www/cobbler
dhcp配置文件 /etc/dhcpd.conf
dhcp租期缓存文件 /var/lib/dhcpd/dhcpd.leases
pxe配置文件 /tftpboot/pxelinux.cfg/default

三、安装cobbler
# rpm -ivh
# rpm -ivh
# yum -y install tftp-server httpd dhcp yum-utils
# yum -y install cobbler
# yum -y install cman 
yum-utils  编译安装  make && make install


四、修改配置文件

1.修改cobbler配置文件
# vi /etc/cobbler/settings
[code]
server: '192.168.1.3'        #cobbler服务器地址
next_server: '192.168.1.3'   
manage_dhcp: 1
[/code]

2.更改tftp启动方式
# vi /etc/xinetd.d/tftp
[code]
disable = no                #默认开启tftp
[/code]

3.编辑dhcp配置模板
# vi /etc/cobbler/dhcp.template 改为相应的网段和ip
subnet 192.168.2.0 netmask 255.255.255.0 {
     option routers             192.168.2.5;
     option domain-name-servers 192.168.2.1;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.2.100 192.168.2.254;
     filename                   "/pxelinux.0";
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                $next_server;
}


五、导入centos 光盘映像文件
# mkdir /home/centos
# mount /home/src/centos-5.2-i386-bin-dvd.iso /home/centos/ -o loop
# cobbler import --mirror=/home/centos --name=centos-5.2
# cobbler sync    应用配置模板



六、cobbler check 根据提示解决问题 
例如:
#2: must enable selinux boolean to enable apache and web services components, run: setsebool -p httpd_can_network_connect true
nice to see that it has good instructions for selinux
#3: you need to set some selinux content rules to ensure cobbler works correctly in your selinux environment, run the following: /usr/sbin/semanage fcontext -a -t public_content_t "/var/lib/tftpboot/.*" && /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*"
detailed command to enable http server to reed content from /var/www/cobbler and have tfpboot find its files
#4: service cobblerd is not running
obviously this isn't running because we did not start it yet
#5: change 'disable' to 'no' in /etc/xinetd.d/tftp
#6: service httpd is not running
#7: since iptables may be running, ensure 69 (dhcp), 80(http), 25150(cobbler api), and 25151(cobbler api r/w) are unblocked 关闭防火墙
#8: reposync is not installed, need for cobbler reposync, install/upgrade yum-utils?
easy to solve with:  yum install yum-utils
#9: yumdownloader is not installed, needed for cobbler repo add with --rpm-list parameter, install/upgrade yum-utils? 安装yum-utils
#10: fencing tools were not found, and are required to use the (optional) power management features. install cman to use them 安装cman
七、启动cobbler服务
service dhcpd start
service httpd start
service xinetd restart
service cobbler start





八、kickstart配置文件实例
# vi /etc/cobbler/sample.ks

#platform=x86, amd64, or intel em64t
# system authorization information
auth --useshadow --enablemd5
# system bootloader configuration
bootloader --location=mbr
# partition clearing information
clearpart --all --initlabel
# use text mode install
text
# firewall configuration
firewall --disable
# run the setup agent on first boot
firstboot --enabled
# system keyboard
keyboard us
# system language
lang en_us
# use network installation
url --url=$tree
# if any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza

# network information
network --bootproto=dhcp --device=eth0 --onboot=on
# reboot after installation
reboot

#root password
rootpw --iscrypted $1$65xojkdk$sa2j.kvlitz6v1gahfl/z1
# selinux configuration
selinux --disabled
# do not configure the x window system
skipx
# system timezone
timezone asia/shanghai
# install os instead of upgrade
install
# clear the master boot record
zerombr

# magically figure out how to partition this thing
#snippet::main_partition_select
part / --asprimary --bytes-per-inode=4096 --fstype="ext3" --grow --size=1
part swap --asprimary --bytes-per-inode=4096 --fstype="swap" --size=2048
part /boot --asprimary --bytes-per-inode=4096 --fstype="ext3" --size=100

%pre
$kickstart_start
#snippet::pre_partition_select

%packages
@server-cfg
@development-tools
@base
@development-libs
@system-tools
@admin-tools
certmaster
func

%post
chkconfig networkmanager off
chkconfig networkmanagerdispatcher off
chkconfig acpid off
chkconfig anacron off
chkconfig atd off
chkconfig autofs off
chkconfig avahi-daemon off
chkconfig avahi-dnsconfd off
chkconfig bluetooth off
chkconfig conman off
chkconfig cups off
chkconfig dhcdbd off
chkconfig dund off
chkconfig firstboot off
chkconfig funcd on
chkconfig gpm off
chkconfig haldaemon off
chkconfig hidd off
chkconfig httpd off
chkconfig ibmasm off
chkconfig ip6tables off
chkconfig ipmi off
chkconfig iptables off
chkconfig irda off
chkconfig irqbalance off
chkconfig kdump off
chkconfig kudzu off
chkconfig lvm2-monitor off
chkconfig mcstrans off
chkconfig mdmpd off
chkconfig microcode_ctl off
chkconfig multipathd off
chkconfig netconsole off
chkconfig netfs off
chkconfig netplugd off
chkconfig nfs off
chkconfig nfslock off
chkconfig nscd off
chkconfig ntpd off
chkconfig oddjobd off
chkconfig pand off
chkconfig pcscd off
chkconfig portmap off
chkconfig psacct off
chkconfig rdisc off
chkconfig restorecond off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig rpcsvcgssd off
chkconfig saslauthd off
chkconfig sendmail off
chkconfig setroubleshoot off
chkconfig winbind off
chkconfig wpa_supplicant off
chkconfig xfs off
chkconfig ypbind off
chkconfig yum-updatesd off

chkconfig certmaster on
chkconfig funcd on

cat >> eofm > /etc/func/minion.conf
[main]
log_level = info
acl_dir = /etc/func/minion-acl.d
eofm

cat >> eocm > /etc/certmaster/minion.conf
[main]
certmaster = node3.le8le.com
log_level = debug
cert_dir = /etc/pki/certmaster
eocm

cat >> eodm > /etc/hosts
192.168.1.3 node3.le8le.com
eodm

$yum_config_stanza
snippet::post_install_kernel_options
$kickstart_done
[/code]

九、利用cobbler重装系统
# rpm -uhv koan-1.2.5-1.el5.noarch.rpm
# koan -server=192.168.1.3 -list-profiles
# koan -replace-self -server=192.168.1.3 -profile=centos_5.2-i386
# reboot
阅读(19054) | 评论(0) | 转发(3) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图