The previous article introduced how to use Kickstart to deploy redhat in batches, but this method is troublesome to configure. Now we have a better choice. That is: Cobbler. We recommend that you first check the following content: Kickstart batch deploy redhat. System environment: Find the default Repository in CentOS5CentOS5.4
The previous article introduced how to use Kickstart to deploy redhat in batches, but this method is troublesome to configure. Now we have a better choice. That is: Cobbler. We recommend that you first check the following content: Kickstart batch deploy redhat.
System environment: CentOS 5
Cobbler cannot be found in the default Repository of CentOS5.4. install rpmforce Repository first. Very powerful, nearly 10000 software packages.
Java code
#32-bit:
Wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
Rpm-ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
#64-bit:
Wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
Rpm-ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
#32-bit:
Wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
Rpm-ivh rpmforge-release-0.5.1-1.el5.rf.i386.rpm
#64-bit:
Wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
Rpm-ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
1. install related software:
Java code
Yum-y install cobbler dhcp httpd xinetd tftp-server
Yum-y install cobbler dhcp httpd xinetd tftp-server
# The cobbler configuration file is in/var/lib/cobbler/and/etc/cobbler (different versions may be different)
# Xinetd tftp-server is used as a tftp server, which is required for pxe startup.
# The httpd server stores ks files and installation CDs. Note that the/var/www/cobbler directory must have sufficient space for Linux installation files (move and create soft links)
2. check the cobbler configuration:
Java code
Cobbler check
Cobbler check
#0: The server field in/var/lib/cobbler/settings must be set to something other than localhost, or kickstarting features will not work. this shoshould be a resolvable hostname or IP for the boot server as reachable by all machines that will use it.
#1: For PXE to be functional, the next_server field in/var/lib/cobbler/settings must be set to something other than 127.0.0.1, and shoshould match the IP of the boot server on the PXE network.
#2: change disable to no in/etc/xinetd. d/tftp
# Follow the prompts to solve the problem. set the server and next_server in/var/lib/cobbler/settings to the IP address of the server,/etc/xinetd. in d/tftp, disable = yes and manage_dhcp are set to 1 to facilitate DHCP management.
3. import the file in CentOS 5 installation dvd iso:
Java code
Mount-o loop home/sapling/CentOS-5.4-x86_64-bin-DVD.iso/mnt/redhatISO
Cobbler import -- mirror =/mnt/redhatISO -- name = CentOS-5-4-x86-64
# Import all the installation files from the/mnt/redhatISO directory named CentOS-5-4-x86-64
Cobbler list
# View the import result, which should contain an xen
Mount-o loop home/sapling/CentOS-5.4-x86_64-bin-DVD.iso/mnt/redhatISO
Cobbler import -- mirror =/mnt/redhatISO -- name = CentOS-5-4-x86-64
# Import all the installation files from the/mnt/redhatISO directory named CentOS-5-4-x86-64
Cobbler list
# View the import result, which should contain an xen
4. modify the DHCP and Kickstart configuration templates:
Java code
Vi/etc/cobbler/dhcp. template
# DHCP configuration template. Note that the IP address of your server must be in a CIDR block with the subnet IP address configured by dhcp. Otherwise, the startup will fail.
Vi/etc/cobbler/default. ks
# Kickstart configuration template, you can use system-config-kickstart (recommended) generation, you can also install the system in the/root/anaconda-ks.cfg to get the configuration of your installed system.
Vi/etc/cobbler/dhcp. template
# DHCP configuration template. Note that the IP address of your server must be in a CIDR block with the subnet IP address configured by dhcp. Otherwise, the startup will fail.
Vi/etc/cobbler/default. ks
# Kickstart configuration template, you can use system-config-kickstart (recommended) generation, you can also install the system in the/root/anaconda-ks.cfg to get the configuration of your installed system.
5. Generate and synchronize all configurations:
Java code
Cobbler sync
Cobbler sync
6. start related services:
Java code
Service xinetd start
Service dhcpd start
Service cobblerd start
# Set startup of related services
Ntsysv
Service xinetd start
Service dhcpd start
Service cobblerd start
# Set startup of related services
Ntsysv
7. install the server:
Start another new server and start it through PXE. when "boot:" Is prompted, enter "menu" to go to the Blue Cobbler installation interface. select the installation item to complete the installation in one breath in a few minutes, automatically complete system installation.
8. reinstall the system:
Java code
# Install koan on the machine to be reinstalled
Yum install koan
# Check the cobbler server installation disks
Koan -- list-profiles -- server = 192.168.1.2
# Select the system to be reinstalled and restart
Koan -- replace-self -- server = 192.168.1.2 -- profile = CentOS-5-4-x86-64
Reboot
# Install koan on the machine to be reinstalled
Yum install koan
# Check the cobbler server installation disks
Koan -- list-profiles -- server = 192.168.1.2
# Select the system to be reinstalled and restart
Koan -- replace-self -- server = 192.168.1.2 -- profile = CentOS-5-4-x86-64
Reboot
9. others:
References: html "> http://hutuworm.blogspot.com/2008/08/cobblerlinux.html