Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use Cobbler system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install and use the Cobbler system, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

I. brief introduction

Cobbler is a fast network installation linux service, and can also be adjusted to support network installation of windows. The tool uses python development, small and light (only 15k lines of python code), you can use a simple command to complete the configuration of the PXE network installation environment, but also can manage DHCP, DNS, and yum warehouse, construct system ISO images.

Cobbler supports command line management, web interface management, and provides an API interface, which is convenient for secondary development.

The Cobbler client Koan supports virtual machine installation and operating system reinstallation, making it easier to reinstall the system.

II. Functions provided by cobbler

With Cobbler, you can install the machine without human intervention. Cobbler sets up a PXE boot environment (it can also use yaboot to support PowerPC) and controls all aspects related to installation, such as network boot services (DHCP and TFTP) and repository images. When you want to install a new machine, Cobbler can:

Configure the DHCP service using a previously defined template (if administrative DHCP is enabled)

Mirror a repository (yum or rsync) or extract a medium to register a new operating system

Create an entry in the DHCP configuration file for the machine that needs to be installed, and use the parameters you specify (IP and MAC address)

Create the appropriate PXE file under the TFTFP service directory

Restart the DHCP service to reflect the changes

Restart the machine to start the installation (if power management is enabled)

Cobbler supports many distributions: Red Hat, Fedora, CentOS, Debian, Ubuntu, and SuSE. When adding an operating system (usually by using ISO files), Cobbler knows how to extract the appropriate files and adjust the network service to boot the machine correctly.

Cobbler can use kickstart templates. Red Hat or Fedora-based systems use kickstart files to automate the installation process. By using templates, you have a basic kickstart template and then define how to replace the variables in it for a configuration file or machine configuration. For example, a template might contain two variables, $domain and $machine_name. In the Cobbler configuration, a configuration file specifies domain=mydomain.com, and each machine that uses the profile specifies its name in the machine_name variable. All machines in this configuration file are installed with the same kickstart and configured for domain=mydomain.com, but each machine has its own machine name. You can still use the kickstart template to install other machines in different domains and use different machine names.

To assist in managing the system, Cobbler can connect to various power management environments through fence scripts. Cobbler supports apc_snmp, bladecenter, bullpap, drac, ether_wake, ilo, integrity, ipmilan, ipmitool, lpar, rsa, virsh and wti. To reinstall a machine, run the reboot system foo command, and Cobbler will use the necessary credentials and information to run the appropriate fence scripts for you (such as the number of machine slots).

In addition to these features, a configuration management system (CMS) can be used. You have two choices: an internal system within the tool, or integrate an existing external CMS, such as Chef or Puppet. With the internal system, you can specify file templates that are processed according to configuration parameters (in the same way as kickstart templates), and then copied to the location you specify. This feature is useful if you must automatically deploy the configuration file to a specific machine.

Using the koan client, Cobbler can configure the virtual machine and reinstall the system from the client. I won't discuss configuration management and koan features because they are outside the scope of this article. However, they are useful features worth studying.

III. Installation and configuration

1. Installation mode

Cobbler can be compiled and installed manually or based on the yum source. If you need to install through the yum source, you need to configure the epel source. The Epel source can install https://fedoraproject.org/wiki/EPEL by downloading the directory of the official epel source.

[root@node1 ~] # yum install cobbler cobbler-web pykickstart debmirror-y

two。 Check the configuration file, which needs to be checked when cobblerd and httpd are started

[root@node1] # 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 them

For example, the solution to the previous problem is:

1. Modify the value of the server parameter of / etc/cobbler/settings file to the ip address of the host providing the cobbler service

two。 Modify the value of the next_server parameter of / etc/cobbler/settings file to the corresponding IP address of the host providing the PXE service

3. If the current node can access the Internet, execute the "cobbler get-loader" command to download the pxelinux.0,menu.c32,elilo.efi, or yaboot file, otherwise, you need to install the syslinux package, and then copy the pxelinux.0,menu.c32 and other files in / usr/share/syslinux/ to the / var/lib/cobbler/loaders directory. Change disable in / etc/xinetd.d/rsync to no, or execute "chkconfig rsync on"

5. Comment on "@ dists=" sid ";" line in / etc/dedmirror.conf file

6. Note "@ arches=" i386 ";" line in / etc/dedmirror.conf file

7. Execute "openssl passwd-1-salt $(openssl rand-hex 4)" to generate the password and replace the default_password_crypted parameter in the / etc/cobbler/settings file with it

8. Install cam and fance-agents for power management

Synchronize files through cobbler get-loaders:

[root@node1] # cobbler get-loaders task started: 2014-04-23_212251_get_loaders task started (id=Download Bootloader Content Time=Wed Apr 23 21:22:51 2014) downloading http://www.cobblerd.org/loaders/README to / var/lib/cobbler/loaders/README downloading http://www.cobblerd.org/loaders/COPYING.elilo to / var/lib/cobbler/loaders/COPYING.elilo downloading http://www.cobblerd.org/loaders/COPYING.yaboot to / var/lib/cobbler/loaders/COPYING.yaboot downloading http://www.cobblerd.org/loaders/COPYING.syslinux to / var/lib/cobbler/loaders/COPYING .syslinux downloading http://www.cobblerd.org/loaders/elilo-3.8-ia64.efi to / var/lib/cobbler/loaders/elilo-ia64.efi downloading http://www.cobblerd.org/loaders/yaboot-1.3.14-12 to / var/lib/cobbler/loaders/yaboot downloading http://www.cobblerd.org/loaders/pxelinux.0-3.86 to / var/lib/cobbler/loaders/pxelinux.0 downloading http://www.cobblerd.org/loaders/menu. C32-3.86 to / var/lib/cobbler/loaders/menu.c32 downloading http://www.cobblerd.org/loaders/grub-0.97-x86.efi to / var/lib/cobbler/loaders/grub-x86.efi downloading http://www.cobblerd.org/loaders/grub-0.97-x86_64.efi to / var/lib/cobbler/loaders/grub-x86_64.efi

Configure and start the services that cobbler depends on

The operation of cobbler depends on dhcp, tftp, rsync and dns services, in which dhcp can be provided by dhcpd (isc) or dnsmasq, tftp can be provided by tftp-server package or cobbler function, rsync can be provided by rsync package, dns can be provided by bind or dnsmasq

Cobbler can manage some or even all of these services on its own, but it needs to be defined separately by configuring "manange_dhcp", "manager_tftpd", "manager_rsync" and "manager_dns" in the / etc/cobbler/settings file. In addition, because various services have different implementation methods, if you need to customize them, you need to modify the values of the module parameters of each service in the / etc/cobbler/modules.conf configuration file.

The department is managed independently. That is, these services are not managed through cobbler.

1. Configure the dhcp service

Define the required "subnet" and other parameters, and the configuration is as follows:

[root@node1 ~] # cp/ usr/share/doc/dhcp*/dhcpd.conf.sample / etc/dhcp/dhcpd.conf Edit configuration file option domain-name "wangfeng7399"; option domain-name-servers 192.168.1.201; default-lease-time 43200; max-lease-time 86400; log-facility local7 Subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.210 192.168.1.230 option routers 192.168.1.253} next-server 192.168.1.210; filename= "pxelinux.0"

two。 Configure the tftpd service

[root@node1 ~] # chkconfig tftp on

5. Configure cobbler

The relationship between the major components of cobbler is shown in the following figure:

1. Manage distro

The step where cobbler becomes available is to define distro, which can be implemented by specifying an external installation of the boot kernel and ramdisk files. If you already have a completed installation tree (such as the installation image of os), it is recommended to import between improt:

[root@node1] # mount / dev/cdrom / media mount: block device / dev/sr0 is write-protected, mounting read-only [root@node1 ~] # cobbler import-- name=centos6.5-x86-64-- path=/media/ task started: 2014-04-23_214916_import task started (id=Media import, time=Wed Apr 23 21:49:16 2014) Found a candidate signature: breed=redhat, version=rhel6 Found a matching signature: breed=redhat Version=rhel6 Adding distros from path / var/www/cobbler/ks_mirror/centos6.5-x86-64: creating new distro: centos6.5- 64-x86_64 trying symlink: / var/www/cobbler/ks_mirror/centos6.5-x86-64-> / var/www/cobbler/links/centos6.5-64-x86_64 creating new profile: centos6.5- 64-x86_64 associating repos checking 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- 64-x86_64 processing repo at: / var/www/cobbler/ks_mirror/centos6.5-x86-64 need to process repo/comps: / var/www/cobbler/ks_mirror/centos6.5-x86-64 looking for / var/www/cobbler/ks_mirror/centos6.5-x86-64/repodata/*comps*.xml Keeping repodata as-is: / var/www/cobbler/ks_mirror/ Centos6.5-x86-64/repodata * * TASK COMPLETE * *

List all distro:

[root@node1 ~] # cobbler distro list centos6.5-64-x86_64

If you have a kickstart file, you can also import it using-- kickstart=/path/to/kickstart_file, so import automatically generates a profile for the imported distro

two。 Manage profile

Cobbler uses profile to provide the configuration that locks need to be installed for a specific category of requirements, that is, to generate a specific system installation configuration by providing a kiskstart file on the basis of distro. Distro's profile can appear in the pxe boot menu as one of the installation options. The explanation of the kickstark file can follow my related blog http://wangfeng7399.blog.51cto.com/3518031/1369553. If you don't go out, you won't give any more details:

[root@node1] # cobbler profile add-- name=centos6.5-x86_64-- distro=centos6.5-64-x86_64 kickstart=/root/anaconda-ks.cfg

List the profile on the current system:

[root@node1 ~] # cobbler profile list centos6.5- 64-x86_64 centos6.5-x86_64

Delete a profile:

[root@node1] # cobbler profile remove-- name=centos6.5-64-x86_64

3. Restart the service and synchronize the data to the response directory

[root@node1 ~] # service cobblerd restart Stopping cobbler daemon: [OK] Starting cobbler daemon: [OK] [root@node1 ~] # cobbler sync task started: 2014-04-23_220652_sync task started (id=Sync Time=Wed Apr 23 22:06:52 2014) running pre-sync triggers cleaning trees removing: / var/www/cobbler/images/centos6.5-64-x86_64 removing: / var/lib/tftpboot/pxelinux.cfg/default removing: / var/lib/tftpboot/grub/images removing: / var/lib/tftpboot/grub/efidefault removing: / var/lib/tftpboot/images/centos6.5-64-x86_64 removing: / var/lib/tftpboot/s390x/profile_list copying bootloaders trying hardlink / var/lib/cobbler/loaders/pxelinux.0-> / var/lib/tftpboot/pxelinux.0 trying hardlink / var/lib/cobbler/loaders/menu.c32-> / var/lib/tftpboot/menu.c32 trying hardlink / var/lib/cobbler/loaders/yaboot-> / var/lib/tftpboot/yaboot omit N lines received on stderr: running shell triggers from / var/lib/cobbler/triggers/sync/post/* running python triggers from / var/lib/cobbler/triggers/change/* Running python trigger cobbler.modules.scm_track running shell triggers from / var/lib/cobbler/triggers/change/* TASK COMPLETE * *

4. test

You can see our customized system startup page and start installing the system.

System installed successfully, log in to the system

VI. Use cobbler_web

Cobbler_web supports multiple authentication methods, such as authn_configfil, authn_ldap or authn_pam. The default is authn_denyall, which denies login to all users. Here are two ways to authenticate users to log in to cobbler_web

1. Use the authn_pam module to authenticate cobbler_web users

First, modify the value of the module parameter in the [authentication] section of the modules to authn_pam, then set the system user and set the password for the user, then add the set system user to the admin group of cobbler_web, modify the / etc/cobbler/users.conf file, and add the set user to the value of the admin parameter.

two。 Use the authn_configfile module to authenticate cobbler_web users

First, modify the value of the module parameter in the [authentication] section of modules to authn_configfile, then create its authentication file / etc/cobbler/users.digest, and add the required users. It is important to note that when adding * * users, you need to use the "- c" option for the htdigest command, and other users cannot be used later.

Authn_pam is used in this department.

[root@node1] # vi / etc/cobbler/modules.conf [authentication] module = authn_pam [root@node1 ~] # useradd wangfeng7399 [root@node1 ~] # passwd wangfeng7399 Changing password for user wangfeng7399. New password: Retype new password: passwd: all authentication tokens updated successfully. [root@node1 ~] # vi / etc/cobbler/users.conf [admins] admin = "wangfeng7399"

The above is all the contents of the article "how to install and use the Cobbler system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report