Cobbler Introduction
Cobbler is a fast network-installed Linux service that is easy to install in a high-volume system environment.
Cobbler function
With Cobbler, you can install machines without manual intervention.
Cobbler supports numerous distributions: Red Hat, Fedora, CentOS, Debian, Ubuntu, and SuSE.
To assist with the management system, the Cobbler can be connected to a variety of power management environments via fence scripts.
First and foremost, cobbler needs Python, any version greater than 2.6; official website description (http://www.cobblerd.org/manuals/2.6.0/2/1_-_Prerequisites.html)
Cobbler also needs to install the following installation packages:
CREATEREPOHTTPD (apache2 for Debian/ubuntu) Mkisofsmod_wsgi (Libapache2-mod-wsgi for Debian/ubuntu) mod_ssl ( LIBAPACHE2-MOD-SSL) Python-cheetahpython-netaddrpython-simplejsonpython-urlgrabberpyyaml (Python-yaml for Debian/ Ubuntu) rsyncxinetd (system default installed) Syslinuxtftp-server (atftpd for Debian/ubuntu, though others could work) Yum-utils
First, install and modify the Cobbler related configuration
1. Installing Cobbler
Cobbler can be manually compiled or installed on a Yum source, and if required to be installed through a Yum source, the Epel source needs to be configured.
Epel source can be downloaded by downloading the official directory of the Epel source to implement the installation! Http://fedoraproject.org/wiki/EPEL
# RPM-UVH # yum Install cobbler-y
PS: The new Fedora installation system is stored in the "testing" repository for a period of time to check for bugs, and if you want to install the latest version of Cobbler through Epel (no bug is verified by the production environment), you can start-testing mode during installation or upgrade.
$ sudo yum install–enablerepo=epel-testing cobbler
# or
$ sudo yum update–enablerepo=epel-testing cobbler
2. Installing the DHCP service
Yum Install Dhcp-y
3. Start each service and set it to boot
Service httpd Start (cobblerd/xinetd start in turn)
Chkconfig httpd on (dhcpd/xinetd/tftp/cobblerd set)
4. Modify the Cobbler configuration:
# vim/etc/cobbler/setting ' next_server:127.0.0.1 ' replace native IP address (DHCP service address) ' server:127.0.0.1 ' replace native IP address (Cobbler service address) ' manage_dhcp:0 ' Replace with 1 (Cobbler management DHCP, later for synchronous update configuration information Cobbler sync) ' manage_rsync:0 ' replaced with 1 (Cobbler manage rsync feature)
5. Start the TFTP and rsync service
# vim/etc/xinetd.d/tftp
# Vim/etc/xinetd.d/rsync
Modify the Disable entry to: Disable = no
6. Modify the DHCP template to ensure that the DHCP-assigned address and cobbler are in the same network segment
# vim/etc/cobbler/dhcp.template
According to the actual situation, only modify the contents of subnet paragraph as follows:
Subnet 10.1.1.0 netmask 255.255.255.0 { option routers 10.1.1.1; option domain-name-servers 202.106.0.20; option subnet-mask 255.255.255.0; range dynamic-bootp 10.1.1.100 10.1.1.254;# filename "/pxelinux.0"; default-lease-time 21600; max-lease-time 43200; next-server 10.1.1.10; 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"; } }}
Note: Some of the information on the Internet has changed the above to the following format, I think the official method is better, it has the client type how to guide the judgment!
Subnet 192.168.0.0 netmask 255.255.255.0 {
#修改自己的路由
Option routers 192.168.0.1;
#域名服务器地址
Option Domain-name-servers 202.106.0.20;
#子网掩码
Option Subnet-mask 255.255.255.0;
#分配IP地址段
Range DYNAMIC-BOOTP 192.168.0.100 192.168.0.254;
FileName "/pxelinux.0″;
Default-lease-time 21600;
Max-lease-time 43200;
Next-server $next _server;
}
7. Check the configuration
# /etc/init.d/httpd start# /etc/init.d/cobblerd start # cobbler Checkthe following are potential configuration items that you may want to fix:1 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your selinux environment:2 : change ' disable ' to ' no ' in /etc/xinetd.d/rsync3 : since iptables may be running, ensure 69, 80/443, and 25151 are unblocked4 : debmirror package is not installed, it will be required to manage debian Deployments and repositories5 : ksvalidator was not found, install pykickstart6 : 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 one7 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
Then, according to the prompt, solve the above problems.
1. Disable SELinux
# Vim/etc/sysconfig/selinux
Selinux=disabled
Reboot the system to make it effective.
2. Edit the Rsync file
# Vim/etc/xinetd.d/rsync
Disable = no//modify here to change Yes to No
3. If a firewall is turned on, ensure that 69, 80/443, and 25151 ports are allowed to communicate
For convenience, close the firewall directly here
# Service Iptables Stop
4. If you are installing a system such as Debian, you need to install Debmirror (not to be ignored)
5. Installation of Pykickstart is required.
# yum Install debmirror pykickstart-y//4, 51 block processed.
6. Modify the default password for cobbler users
# OpenSSL passwd-1-salt ' Suibianxie ' Cobblerpass '
$1$suibianx$z76pifoeknpi2.whuujho.
# vim/etc/cobbler/settings
default_password_crypted: $1$suibianx$z76pifoeknpi2.whuujho. Modify here to write the encrypted string generated above.
7. Install Cman or fence-agents to start the power management function
# yum Install cman-y//Here I use Cman
Restart the service, check it out.
# service cobblerd restartstopping cobbler daemon: [ ok ]starting cobbler daemon: [ OK ]# cobbler checkThe following are potential configuration items that you may want to fix:1 : comment out ' dists ' on /etc/debmirror.conf for proper debian support2 : comment out ' arches ' on /etc/debmirror.conf for proper debian supportrestart cobblerd and then run ' Cobbler sync ' to apply changes.
Resolve the two tips above:
# vim/etc/debmirror.conf//Find and annotate the contents of the following two lines
# @dists = "Sid";
# @arches = "I386″;
Check to see if there is no problem after continuing the operation!
# Cobbler Check
No configuration problems found. All systems go.
# Cobbler Sync
Second, import ISO system files
1. Upload the image to the server
2. Create a mirrored Mount directory
3. Mount the image to the creation directory
4. Import the OS that the client will install from the ISO.
# cobbler import --path=/media/centos6.5/ --name=centos6.5 --arch=x86_64task started: 2015-04-29_111745_importtask started (ID=MEDIA IMPORT, TIME=WED APR  29 11:17:45 2015) found a candidate signature: breed=redhat, version= rhel6found a matching signature: breed=redhat, version=rhel6adding distros from path /var/www/cobbler/ks_mirror/centos6.5-x86_64:creating new distro: Centos6.5-x86_64trying symlink: /var/www/cobbler/ks_mirror/centos6.5-x86_64 -> /var/www /cobbler/links/centos6.5-x86_64creating new profile: centos6.5-x86_64associating Reposchecking for rsync repo (s) checking for rhn repo (s) checking for Yum repo (s) starting descent into /var/www/cobbler/ks_mirror/centos6.5-x86_64 for centos6.5-x86_64processing repo at : /var/www/cobbler/ks_mirror/centos6.5-x86_64need to process repo/comps: /var/www/cobbler/ks_mirror/centos6.5-x86_64looking for /var/www/cobbler/ks_mirror/centos6.5-x86_64/ repodata/*comps*.xmlkeeping repodata as-is :/var/www/cobbler/ks_mirror/centos6.5-x86_64/ repodata*** task complete ***
This process will take some time to see the/var/www/cobbler/ks_mirror/of the relevant directory files!
# Cobbler sync# Cobbler listdistros:centos6.5-x86_64profiles:centos6.5-x86_64systems:repos:images:mgmtclasses: Packages:files:
Third, the client deployment test
The client is in the same network segment as the server and is set to PXE boot! After starting to see the Cobbler boot interface, select the appropriate system entries can be successfully started without manual intervention installation system!
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/20/wKiom1VAWTWC6EFeAACdOf1i1Dk161.jpg "title=" 1.png " alt= "Wkiom1vawtwc6efeaacdof1i1dk161.jpg"/>
After completing the automated installation, log in with the root user account, and the password is the value previously written in the configuration file! (Cobblerpass in this article)
Problem BUG:
Configuration Check Error
# Cobbler Check
Traceback (most recent):
File "/usr/bin/cobbler", line $, in <module>
Sys.exit (App.main ())
File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line 655, in main
rc = Cli.run (SYS.ARGV)
File "/usr/lib/python2.6/site-packages/cobbler/cli.py", line +, in run
Self.token = Self.remote.login ("", Self.shared_secret)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
Return Self.__send (Self.__name, args)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
Verbose=self.__verbose
File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in Request
Return Self._parse_response (H.getfile (), sock)
File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
Return U.close ()
File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
Raise Fault (**self._stack[0])
Xmlrpclib. Fault: <fault 1: "<class ' Cobbler.cexceptions.CX ';: ' Login failed '" >
This is a gub, workaround:
# Service Cobblerd Restart
# Cobbler Get-loaders
This article is from the "you insist on _it blog" blog, please be sure to keep this source http://fdgui.blog.51cto.com/3484207/1640241
Operation and maintenance automation of the Cobbler:linux system batch Installation