In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to build Cobbler unattended installation server. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
Cobbler is an open source project supported by RedHat to deploy and install systems. Therefore, it is better to support Redhat series OS.
Cobbler is not only a pxe server, it can also manage dns (bind), dhcp. In general, dhcp is not allowed in the production environment of data centers, but pxe must require dhcp, so we need to allocate IP according to the mac address, so that dhcp will not affect the network.
The advantages of Cobbler: automatic management of the configuration between various servers, more powerful management functions. And it also has a Web management interface, which allows you to install a host at the click of a mouse. Multiple template files for Kickstart can be configured.
Introduction to Cobbler
Network installation server suite Cobbler (cobbler) in the past, we have been working as a promising migrant worker. Since Red Hat launched Kickstart a few years ago, we have suddenly felt that our price has doubled. No longer need to carve a CD to install Linux, as long as we get rid of PXE, DHCP, TFTP, and the dazzling Kickstart script, we can click on the magic wand and install hundreds of servers in an instant, just like Harry Potter. This pile of gaudy things can not be understood by ordinary people. If you don't have a college degree or above, you can't pass CET-4, so you can't play around at all. All in all, what a promising and skilled job it is. Unfortunately, the latest Red Hat (the Cobbler project was originally released around 2008) released the network installation server suite Cobbler (cobbler), which has successfully lowered the technical threshold of Linux network installation from college or above to below junior high school, even cobblers can learn. It was a bolt from the blue for us migrant workers who had been in the field of installation for many years and had a lot of experience, and still wanted to run a thousand miles in the stables.
Environment:
CentOS Linux release 7.6.1810
VMware Workstation Pro 14
Cobbler running process
Server side:
Step 1: start the Cobbler service
Step 2: check for Cobbler errors and execute the Cobbler check command
Step 3: perform configuration synchronization and execute the Cobbler sync command
Step 4: copy the relevant startup files to the TFTP directory
Step 5: start the DHCP service to provide address assignment
Step 6: DHCP service assigns IP address
Step 7: TFTP transfer startup files
Step 8: the Server side receives the installation information
Step 9: send ISO image not Kickstart files on the Server side
Client side:
Step 1: the client starts in PXE mode
Step 2: the client gets the IP address
Step 3: get the startup file through the TFTP server
Step 4: enter the Cobbler installation selection interface
Step 5: the client determines the loading information
Step 6: prepare to install the system according to the configuration information
Step 7: load the Kickstart file
Step 8: transfer other files installed by the system
Step 9: install the system
Set up Cobbler unattended installation server
1 Environment initialization
Cobbler server: CentOS Linux release 7.6.1810
The memory requirements of the Cobbler server are not high, as long as it can run the Cobbler service.
# turn off selinux and firewall [root@Jaking ~] # systemctl stop firewalld.service & & systemctl disable firewalld.service & & iptables-F & & setenforce selinux permanently close selinux execute the following command [root@Jaking ~] # sed-I's bank for sed
2 install and configure Cobbler
Installing epel-release,Cobbler and tftp-server first is not available in the base source
[root@Jaking ~] # yum install-y epel-release
In fact, some software for installing Cobbler will be installed as dependencies, such as tftp and httpd services. For convenience, we can install them together to avoid related problems.
[root@Jaking ~] # yum install-y cobbler cobbler-web dhcp tftp-server pykickstart httpd rsync xinetd
Note: the yum source must be equipped, otherwise all the above software can not be installed!
[root@Jaking ~] # vim / etc/yum.repos.d/CentOS-Base.repo# add the following source [aliyun-os] name=aliyun-osbaseurl= https://mirrors.aliyun.com/centos/7/os/x86_64/enabled=1gpgcheck=0[aliyun-epel]name=aliyun-epelbaseurl=https://mirrors.aliyun.com/epel/7/x86_64/enabled=1gpgcheck=0[aliyun-extra]name=aliyun-extrabaseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/enabled=1gpgcheck=0 to the CentOS-Base.repo configuration file
Description of the function of software
Cobbler # Cobbler package cobbler-web # Cobbler Web service package pykickstart # Cobbler check kickstart syntax errors httpd # Apache Web service
Introduction to Cobbler working directory
[root@Jaking ~] # ls / etc/cobbler/auth.conf genders.template named.template secondary.template zone.templatecheetah_macros import_rsync_whitelist power settings zone_templatescobbler_bash iso pxe tftpd.templatecompletions ldap reporting users.confdhcp.template modules.conf rsync.exclude users .digestdnsmasq.template mongodb.conf rsync.template version/etc/cobbler # configuration file directory / etc/cobbler/settings # Cobbler main configuration file This file is YAML format, and Cobbler is a program written by python. / etc/cobbler/dhcp.template # configuration template for DHCP service / etc/cobbler/tftpd.template # configuration template for tftp service / configuration template for etc/cobbler/rsync.template # rsync service / etc/Cobbler/iso # iso template configuration file directory / etc/cobbler/pxe # pxe template file directory / etc/cobbler/power # configuration file directory for power supply / etc/cobbler/users.conf # Web service authorization profile / etc/cobbler / users.digest # username and password configuration file for Web access / etc/cobbler/dnsmasq.template # configuration template for DNS service / etc/cobbler/modules.conf # Cobbler module configuration file / var/lib/cobbler # Cobbler data directory / var/lib/cobbler/config # configuration file / var/lib/cobbler/kickstarts # various bootstrap programs / var/www stored in kickstart file / var/lib/cobbler/loaders # by default / cobbler # system installation image directory / var/www/cobbler/ks_mirror # imported system image list / var/www/cobbler/images # imported system image startup file / var/www/cobbler/repo_mirror # yum source storage directory / var/log/cobbler # log directory / var/log/cobbler/install.log # client system installation log / var/log/cobbler/cobbler.log # Cobbler log
Start the Cobbler and httpd services first
[root@Jaking ~] # systemctl start cobblerd httpd
Check configuration
[root@Jaking] # cobbler checkThe 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: change' disable' to 'no' in / etc/xinetd.d/tftp4: 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: enable and start rsyncd.service with systemctl6: debmirror package is not installed, it will be required to manage debian deployments and repositories7: 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 one8: 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 above problems need to be solved step by step.
Problem 1: change the server address to 192.168.1.7
[root@Jaking] # vim / etc/cobbler/settings change: 390 server: 127.0.1 to: 390 server: 192.168.1.7
Question 2: change the next_server address to 192.168.1.7
[root@Jaking] # vim / etc/cobbler/settings change: 278 next_server: 127.0.1 to: 278 next_server: 192.168.1.7
Question 3: modify tftp service to be managed by xinetd service
[root@Jaking ~] # vim / etc/xinetd.d/tftp change: 14 disable = yes: 14 disable = no incidentally modify xinetd and tftpd service boot boot [root@Jaking ~] # systemctl start xinetd tftp & & systemctl enable xinetd tftp
Question 4: download the operating system boot file
[root@Jaking] # cobbler get-loaderstask started: 2020-01-04_031204_get_loaderstask started (id=Download Bootloader Content Time=Sat Jan 4 03:12:04 2020) downloading https://cobbler.github.io/loaders/README to / var/lib/cobbler/loaders/READMEdownloading https://cobbler.github.io/loaders/COPYING.elilo to / var/lib/cobbler/loaders/COPYING.elilodownloading https://cobbler.github.io/loaders/COPYING.yaboot to / var/lib/cobbler/loaders/COPYING.yabootdownloading https://cobbler.github.io/loaders/COPYING.syslinux to / var/lib/cobbler/loaders/COPYING.syslinuxdownloading https : / / cobbler.github.io/loaders/elilo-3.8-ia64.efi to / var/lib/cobbler/loaders/elilo-ia64.efidownloading https://cobbler.github.io/loaders/yaboot-1.3.17 to / var/lib/cobbler/loaders/yabootdownloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to / var/lib/cobbler/loaders/pxelinux.0downloading https://cobbler.github.io/loaders/menu.c32-3.86 to / var/ Lib/cobbler/loaders/menu.c32downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to / var/lib/cobbler/loaders/grub-x86.efidownloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to / var/lib/cobbler/loaders/grub-x86_64.efi*** TASK COMPLETE *
Question 5: modify the rsyncd service to boot and enable it.
[root@Jaking] # systemctl start rsyncd & & systemctl enable rsyncd
Question 6: regarding debian-related deployment management configuration, ignore.
Debmirror package is not installed, it will be required to manage debiandeployments and repositories # debmirror package is not installed, it is required to manage debian deployment and repository
Question 7: change the operating system default password
[root@Jaking] # openssl passwd-1-salt 'root'' 123456 change 1$ root$j0bp.KLPyr.u9kgQ428D10 [root@Jaking ~] # vim / etc/cobbler/settings to: 101 default_password_crypted: "$1 $mF86/UHC$WvcIcX2t6crBz2onWxyac." For: 101 default_password_crypted: "$1$ root$j0bp.KLPyr.u9kgQ428D10" Note: root is the user description, 123456 is the password
Question 8: power management related services, ignored.
Fencing tools were not found, and are required to use the (optional) powermanagement features. Install cman or fence-agents to use them
After modifying the above configuration, you can check the DHCP configuration. Since Cobbler automatically manages the DHCP service, we only need to modify the template configuration file in Cobbler.
[root@Jaking ~] # vim / etc/cobbler/dhcp.template change: 22 option routers 192.168.1.5; # modify default gateway address to: 22 option routers 192.168.1.1; # change to actual gateway: 23 option domain-name-servers 192.168.1.1; # modify DNS address to: 23 option domain-name-servers 114.114.114.114 As follows: 21 subnet 192.168.1.0 netmask 255.255.255.0 {22 option routers 192.168.1.1; 23 option domain-name-servers 114.114.114.114; 24 option subnet-mask 255.255.255.0; 25 range dynamic-bootp 192.168.1.100 192.168.1.254; 26 default-lease-time 21600; 27 max-lease-time 43200 28 next-server $next_server
Note: the configuration defaults to 192.168.1.0, depending on your installed vlan partition. Now it is an experimental environment, so the configuration remains the same.
Note: the default gateway address is 192.168.1.5, which needs to be changed to your own local area network gateway.
$next_server is the variable value is the address 192.168.1.7 in the main configuration file that we modified earlier.
Modify Cobbler Management dhcp Service
[root@Jaking ~] # vim / etc/cobbler/settings change: 242 manage_dhcp: 0 to: 242 manage_dhcp: 1
To synchronize configuration files, you need to restart Cobblerd first
[root@Jaking ~] # systemctl restart cobblerd [root@Jaking ~] # cobbler synctask started: 2020-01-04_032552_synctask started (id=Sync Time=Sat Jan 4 03:25:52 2020) running pre-sync triggerscleaning treesremoving: / 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.c32trying hardlink / var/lib/cobbler/loaders/yaboot-> / var/lib/tftpboot/yaboottrying hardlink / usr/share/syslinux/memdisk-> / var/lib/tftpboot/memdisktrying hardlink / var/lib/cobbler/loaders/grub-x86.efi-> / var/lib/tftpboot/grub/grub-x86.efitrying hardlink / var/lib/cobbler/loaders/grub-x86_64.efi-> / var/lib/tftpboot/grub/grub-x86_64.eficopying distros to tftpbootcopying imagesgenerating PXE configuration filesgenerating PXE menu structurerendering DHCP filesgenerating / etc/dhcp/dhcpd.confrendering 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: dhcpd-t-qreceived on stdout: received on stderr: running: service dhcpd restartreceived on stdout: received on stderr: Redirecting to / bin/systemctl restart dhcpd.servicerunning shell triggers from / var/lib/cobbler/triggers/sync/post/*running python triggers from / var/lib/cobbler/triggers/change/*running python trigger cobbler.modules.manage_gendersrunning python trigger cobbler.modules.scm_trackrunning shell triggers from / var/lib/cobbler/triggers/change/**** TASK COMPLETE *
Watch to see if the DHCP service starts.
Re-check, leaving 2 problems that can be ignored.
[root@Jaking] # cobbler checkThe following are potential configuration items that you may want to fix:1: debmirror package is not installed, it will be required to manage debian deployments and repositories2: 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.
Import image and configuration
Add Mirror
Mount the CD-ROM drive
[root@Jaking ~] # mount / dev/sr0 / mnt
Import image (for a long time)
[root@Jaking] # cobbler import-path=/mnt/-name=CentOS-7.6-arch=x86_64task started: 2020-01-04_033346_importtask started (id=Media import, time=Sat Jan 4 03:33:46 2020) Found a candidate signature: breed=redhat, version=rhel6Found a matching signature: breed=redhat Version=rhel6Adding distros from path / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64:creating new distro: CentOS-7.6-x86_64trying symlink: / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64-> / var/www/cobbler/links/CentOS-7.6-x86_64creating new profile: CentOS-7.6-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/CentOS-7.6-x86_64 for CentOS-7.6-x86_64processing repo at: / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64need to process repo/comps: / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64looking for / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/repodata/*comps*.xmlKeeping repodata as-is: / var/www/cobbler/ks _ mirror/CentOS-7.6-x86_64/repodata*** TASK COMPLETE *
Look at the image. Above is the name of the image, and below is the startup menu.
[root@Jaking ~] # cobbler listdistros:CentOS-7.6-x86_64profiles:CentOS-7.6-x86_64
Synchronize Cobbler configuration
[root@Jaking ~] # systemctl restart cobblerd [root@Jaking ~] # cobbler sync
At this point, the construction of Cobbler unattended installation server is complete!
Next, you only need to create a CentOS system on top of VMware Workstation Pro 14, and the network mode can be bridged to achieve unattended installation (no need to select an image).
The above is how to build the Cobbler unattended installation server, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.