In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to install Cobbler automation deployment in Linux system. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
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, and can complete the configuration of the PXE network installation environment using simple commands. At the same time, it can also manage DHCP, DNS, and yum repositories, and construct system ISO images.
Set up Cobbler unattended installation server 1 environment initialization
Cobbler server: CentOS Linux release 7.6.1810 Cobbler server does not have high memory requirements, 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 permanent shutdown selinux execute the following command [root@Jaking ~] # sed-I's bank sed for etc/selinux/config2 Cobbler installation and configuration
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 max-lease-time 23 option domain-name-servers 114.114.114.114 max-lease-time 24 option subnet-mask 255.255.255.0 max-lease-time 192.168.1.100 192.168.1.254 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
Build Cobbler unattended installation server build Cobbler unattended installation server
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 article on "how to install Cobbler Automation deployment in Linux system" ends here. I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.