cobbler安装过程

 

               Cobbler服务器安装
1、确保EPEL仓库可用,如果不可用先安装epel包:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
2、安装cobbler server需要的的所有包
   yum install cobbler httpd rsync tftp-server xinetd dhcp
  这里yum安装的cobbler版本有问题,最好是再进行一步yum remove cobbler后,下载cobbler的rpm包安装,之前yum安装已经将依赖包装好了,可以直接安装cobbler
   cobbler-1.6.2-1.el5.kb.noarch.rpm
下载地址
     wget http://rpm.pbone.net/index.php3/stat/26/dist/55/size/663669/name/cobbler-1.6.2-1.el5.kb.src.rpm
  安装好后将httpd,cobblerd服务开启
3、检查cobbler相关配置
   cobbler check
   The following are potential configuration items that you may want to fix:
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 : 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 "/tftpboot/.*" && \ /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*"
4 : 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/tftp
6 : change 'disable' to 'no' in /etc/xinetd.d/rsync
7 : since iptables may be running, ensure 69, 80, and 25151 are unblocked
8 : debmirror package is not installed, it will be required to manage debian deployments and repositories
9 : 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
 
Restart cobblerd and then run 'cobbler sync' to apply changes.
只需要改关键几点
1)、vi /etc/cobbler/settings
server: 192.168.0.2   #设置cobbler server的IP地址
next-server: 192.168.0.2  #设置PXE server的IP地址
manage_dhcp: 1   #开启管理DHCP服务
2)、启动tftp和rsync
vi /etc/xinetd.d/tftp
将disable                 = yes改为:disable                 = no
vi /etc/xinetd.d/rsync(这里如果没有rsync,直接yum install rsync安装)
将disable                 = yes改为:disable                 = no
3)、修改DHCP模板,确保DHCP分配的地址和Cobbler在同一网段
 vi  /etc/cobbler/dhcp.template
主要修改下面这段
subnet 192.168.0.0 netmask 255.255.255.0 {
     option routers             192.168.0.1;
     # option domain-name-servers 192.168.0.2;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.0.100 192.168.0.200;
确保在在一个网段就行了。
4、同步cobbler配置,使修改生效
   cobbler sync
5、挂载Linux安装盘,生成安装镜像
mount /dev/cdrom /mnt/
cobbler import --path=/mnt/ --name=centos5.6
6、自动安装配置
vim /var/lib/cobbler/kickstarts/default.ks
将下面内容复制进去就可以了
lang zh_CN.UTF-8
langsupport zh_CN.UTF-8 en_US --default=en_US
keyboard us
mouse
timezone Asia/Shanghai
rootpw 8812345
reboot
install
url --url=http://192.168.24.75/cobbler/ks_mirror/centos5.6
text
bootloader --location=mbr
zerombr yes
clearpart --drives hdb --initlabel
part /boot --fstype ext3 --size=200
part /var --fstype ext3 --size=2048
part swap --size=1024
part / --fstype ext3 --size=100 --grow
#part /data --fstype ext3 --size=100 --grow
auth --useshadow --enablemd5
network --bootproto=dhcp --device=eth0 --nameserver=202.101.172.35
firewall --disabled
selinux --disabled
skipx
%packages       --excludedocs –nobase(最小安装)
7、开启服务
 Service xinetd start
 Service cobblerd start
 Cobbler sync
8、安装系统
   将机器连接交换机设置网卡启动,之后进入选择界面,选择centos-5.6,回车,
   之后就会全部自动安装。
 
~注: 如果设置都没有问题而客户端安装失败,显示无法连接,看防火墙和selinux                                      
Could not find files matching /usr/share/syslinux/pxelinux.0
安装syslinux,yum install syslinux
 
重装系统
在有cobbler服务器的网段重装系统,
1)先安装epel: rpm -Uvh
http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
 2)安装koan
   Yum install –y koan
 3)查看可安装的系统
   koan --server=192.168.25.237 --list=profiles
 
 4)重装系统
   koan --replace-self --server=192.168.25.237 --profile=centos5.6-x86_64
   运行后会一段字幕出现最后需要reboot

你可能感兴趣的:(职场,休闲,自动安装,无人值守,自动重装)