Linux operation and maintenance Automation Cobbler automatic installation of CentOS management and use of detailed

Source: Internet
Author: User
Tags rsync

Brief introduction:

Cobbler can be used to quickly establish a Linux network installation environment, it has installed the Linux network Technology threshold, from the college level of education, success down to junior high school, even the shoemaker can learn.

Network installation Server suite Cobbler (cobbler) Once upon a time, we have been working as a promising career for migrant workers. Since Red Hat launched Kickstart a few years ago, we circumnavigated worth more. No longer need to carve a CD a platform to install Linux, as long as the PXE, DHCP, TFTP, and the full screen of the dazzling Kickstart script, we can like Harry Potter, Light magic wand, instantly installed hundreds of servers. This pile of gaudy things can not be the average person can understand, no college education, pass English level four, do not want to play around. In a word, this is a very promising, how technical content of the job ah. Unfortunately, Red Hat's latest (Cobbler project was first released around 2008) released the network installation Server suite Cobbler (cobbler), it has installed the Linux network technology threshold, from the college level of education, success down to junior high school, even the shoemaker can learn. For those of us who have been immersed in the field for many years, experienced, Laojifuli, Costraint migrant brothers, it is a bolt from the blue.

First, install the software

1, installation Cobbler

[email protected] ~]# yum install cobbler Pykickstart debmirror

2. Installation of other services

Additional services are required for DHCP Tftp,rsync,xinetd,httpd,syslinux. So if you install the system, if these packages are not installed, please install them manually.

Second, start the service and detect cobbler

1. Start httpd and Cobblerd services

[Email protected] ~]#/etc/init.d/httpd startstarting httpd:httpd:apr_sockaddr_info_get () failed for Node1 [OK][[emai L protected] ~]#/etc/init.d/cobblerd startstarting Cobbler daemon: [OK]

2, the implementation of "Cobbler Check command checks the problem, each prompt to solve:

[[email protected] ~]# 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 : 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. 4 : change  ' disable '  to  ' no '  in /etc/xinetd.d/rsync 5 : comment out  ' dists '  on /etc/debmirror.conf for proper  debian support 6 : comment out  ' arches '  on /etc/debmirror.conf  for proper debian support 7 : 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 8 :  Fencing tools were not found, and are required to use the   (optional)  power management features. install cman or fence-agents  to use themrestart cobblerd and then run  ' Cobbler sync '  to apply changes.  The solutions to the above problems are as follows:  1, modifying the/etc/cobbler/settings file, server: 172.16.22.6; 2, modifying the/etc/cobbler/settings file, Next_server: 172.16.22.6; 3, if the current node can access the Internet, execute the "cobbler get-loaders" command, otherwise, you need to install the Syslinux package, execute:  [[email protected] ~]# cp /usr/share/syslinux/{pxelinux.0,menu.c32} /var/lib/ cobbler/loaders/ 4, execution [[Email protected] ~]# chkconfig rsync on 5, annotation/etc/ "@dists =" Sid "in the debmirror.conf file;" The "@arches =" i386 "in the  6./etc/debmirror.conf file;  7, execute "openssl passwd -1 -salt  ' random-phrase-here '   ' your-password-here '" to generate a password, and replace the value of the default_password_crypted parameter in the/etc/cobbler/settings file, such as default_password_crypted:  "$1$random-p$ Aow9rdiwqm6tfuo9ediu/0 ";  8, execute" yum -y install cman fence-agents "command to install the corresponding package;

3. Restart the Cobblerd service, synchronize the new configuration to cobbler, and re-detect

[[Email protected] ~]# /etc/init.d/cobblerd restartstopping cobbler daemon:  [ ok ]starting cobbler daemon: [ ok ][[email protected] ~]#  cobbler synctask started: 2014-10-05_172520_synctask started  (id=sync,  time=sun oct 5 17:25:20 2014) Running pre-sync triggerscleaning treesmkdir:  /var/lib/tftpboot/pxelinux.cfgmkdir: /var/lib/tftpboot/grubmkdir: /var/lib/tftpboot/s390xmkdir :  /var/lib/tftpboot/ppcmkdir: /var/lib/tftpboot/etcremoving: /var/lib/tftpboot/grub/ imagescopying bootloaderstrying hardlink /var/lib/cobbler/loaders/pxelinux.0 -> / var/lib/tftpboot/pxelinux.0trying hardlink /var/lib/cobbler/loaders/menu.c32 -> /var/ lib/tftpboot/menu.c32copying: /usr/share/syslinux/memdisk -> /var/lib/tftpboot/ Memdiskcopying distros to tftpbootcopying imagesgenerating pxe configuration filesgenerating pxe menu  structurerendering tftpd filesgenerating /etc/xinetd.d/tftpcleaning link  cachesrunning post-sync triggersrunning python triggers from /var/lib/cobbler/ Triggers/sync/post/*running python trigger cobbler.modules.sync_post_restart_servicesrunning  shell triggers from /var/lib/cobbler/triggers/sync/post/*running python  triggers from /var/lib/cobbler/triggers/change/*running python trigger  cobbler.modules.scm_trackrunning shell triggers from /var/lib/cobbler/triggers/change/****  task complete ***[[email protected] ~]# cobbler check

Iii. Configuring and starting the services on which cobbler relies

The operation of the cobbler relies on DHCP, TFTP, rsync, and DNS services. Cobbler can manage some or all of these services on its own, but need to configure the "Manage_dhcp", "manage_tftpd", "Manage_rsync", and "Manage_" in the/etc/cobbler/settings file DNS "is defined separately. Also, because each service has a different implementation, if you need to customize it, you need to modify the values of the module parameters for each service in the/etc/cobbler/modules.conf configuration file.

This article uses an independent management approach that does not manage these services through cobbler.

1. Configure DHCP Service

[Email protected] syslinux]# cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.confcp:overwrite '/etc/ Dhcp/dhcpd.conf '? Y[[email protected] syslinux]# vim/etc/dhcp/dhcpd.confoption domain-name "whb.com"; option Domain-name-servers 172.16.22.1;default-lease-time 43200;max-lease-time 86400;log-facility local7;subnet 172.16.0.0 netmask 255.255.0.0 { Range 172.16.22.20 172.16.22.25;option routers 172.16.22.1;next-server 172.16.22.6;filename= "pxelinux.0";}

Check the configuration file and restart the service

[Email protected] ~]#/ETC/INIT.D/DHCPD configtestsyntax:ok[[email protected] ~]#/ETC/INIT.D/DHCPD restartshutting Down dhcpd: [OK]starting dhcpd: [OK]

2. Configuring the TFTP service

[[email protected] ~]# chkconfig tftp on[[email protected] ~]# service xinetd restartstopping xinetd: [failed]starting Xin ETD: [OK]

Iv. Configuration Cobbler

1. Management distro

Mount the ISO image and define the distro, which can be implemented by specifying the external installation boot kernel and the RAMDisk file. If you already have a complete system installation tree (such as an installation image of CentOS6), it is recommended that import be imported directly. This article is for direct import

[[email protected] ~]# mount /dev/cdrom /mnt/mount: block device /dev/ Sr0 is write-protected, mounting read-only[[email protected] ~]# cobbler  import --name=centos-6.5-x86_64 --path=/mnt/task started: 2014-10-05_181334_ importtask started  (id=media import, time=sun oct 5 18:13:34 2014) Found a candidate signature: breed=redhat, version=rhel6found a matching  signature: breed=redhat, version=rhel6adding distros from path /var/www/ Cobbler/ks_mirror/centos-6.5-x86_64:creating new distro: centos-6.5-x86_64trying symlink:  /var/www/cobbler/ks_mirror/centos-6.5-x86_64 -> /var/www/cobbler/links/centos-6.5-x86_ 64creating new profile: centos-6.5-x86_64associating reposchecking for rsync  repo (s) checking for rhn&Nbsp;repo (s) checking for yum repo (s) starting descent into /var/www/cobbler/ks_ mirror/centos-6.5-x86_64 for centos-6.5-x86_64processing repo at : /var/www/ cobbler/ks_mirror/centos-6.5-x86_64need to process repo/comps: /var/www/cobbler/ks_mirror/ centos-6.5-x86_64looking for /var/www/cobbler/ks_mirror/centos-6.5-x86_64/repodata/*comps*. Xmlrunning: createrepo -c cache -s sha --groupfile /var/www/cobbler/ks_ mirror/centos-6.5-x86_64/repodata/0dae8d32824acd9dbdf7ed72f628152dd00b85e4bd802e6b46e4d7b78c1042a3-c6-x86_64- comps.xml /var/www/cobbler/ks_mirror/centos-6.5-x86_64received on stdout: spawning  worker 0 with 3887 pkgsworkers finishedgathering worker resultssaving  primary metadatasaving file lists metadatasaving other metadatagenerating  Sqlite dbssqlite dbs completereceived on stderr:*** task complete ***  List all the distro:[[email  Protected] ~]# cobbler distro listcentos-6.5-x86_64

2. Management profile

Cobbler uses profile to provide the required installation configuration for a specific requirement category, which is to generate a specific system installation configuration by providing kickstart files on distro basis. Distro profile can appear in the PXE boot menu as one of the options for installation.

Therefore, if you need to provide a bootable installation entry for the centos-6.5-x86_64 created earlier, the kickstart file used is/tmp/centos-6.5-x86_64.cfg (only the most basic package is available). You can do this with the following command.

[Email protected] ~]# Cobbler profile add--name=centos-6.5-x86_64-basic--distro=centos-6.5-x86_64--kickstart=/tmp/ Centos6.x86_64.cfg list all profile:[[email protected] tmp]# Cobbler profile listcentos-6.5-x86_64centos-6.5-x86_64- Basic

V. Testing

New virtual machine, network boot

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/BA/wKiom1QxQp3ydCpmAACfB5u_unc393.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1qxqp3ydcpmaacfb5u_unc393.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/BC/wKioL1QxQtHCocreAAEcf0aO0yQ645.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1qxqthcocreaaecf0ao0yq645.jpg "/>

See this picture and you're done!!!!!

This article is from the "Gentoo" blog, be sure to keep this source http://linuxgentoo.blog.51cto.com/7678232/1560728

Linux operation and maintenance Automation Cobbler automatic installation of CentOS management and use of detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.