In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use the Cobbler quick installation system", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use the Cobbler quick installation system" this article.
Cobbler can be used to quickly establish a Linux network installation environment, it has successfully lowered the technical threshold of Linux network installation from college or above to below junior high school, even cobblers can learn.
Environment:
CentOS Linux release 7.6.1810 VMware Workstation Pro 14
Customize the software package installed by the system
View the default ks file
[root@Jaking ~] # cobbler reportdistros:=Name: CentOS-7.6-x86_64Architecture: x86_64TFTP Boot Files: {} Breed: redhatComment: Fetchable Files: {} Initrd: / Var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/images/pxeboot/initrd.imgKernel: / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/images/pxeboot/vmlinuzKernel Options: {} Kernel Options (Post Install): {} Kickstart Metadata: {'tree':' http://@@http_server@@/ Cblr/links/CentOS-7.6-x86_64'} Management Classes: [] OS Version: rhel6Owners: ['admin'] Red Hat Management Key: Red Hat Management Server: Template Files: {} profiles:=Name: CentOS-7.6-x86_64TFTP Boot Files : {} Comment: DHCP Tag: defaultDistribution: CentOS-7.6-x86_64Enable gPXE?: 0Enable PXE Menu?: 1Fetchable Files: {} Kernel Options: {} Kernel Options (Post Install) : {} Kickstart: / var/lib/cobbler/kickstarts/sample_end.ksKickstart Metadata: {} Management Classes: [] Management Parameters: Name Servers: [] Name Servers Search Path: [] Owners: ['admin'] Parent Profile: Internal proxy: Red Hat Management Key: Red Hat Management Server: Repos: [] Server Override: Template Files: {} Virt Auto Boot: 1Virt Bridge: xenbr0Virt CPUs: 1Virt Disk Driver Type: RawVirt File Size (GB): 5Virt Path: Virt RAM (MB): 512Virt Type: kvm
Note: distros is the distribution version, that is, CD image information. Profiles refers to the ks answer file. Systems refers to the name of the physical machine installed through Cobbler.
[root@Jaking ~] # cd / var/lib/cobbler/kickstarts/ [root@Jaking kickstarts] # lsdefault.ks legacy.ks sample_esx4.ks sample.ksesxi4-ks.cfg pxerescue.ks sample_esxi4.ks sample_old.seedesxi5-ks.cfg sample_autoyast.xml sample_esxi5.ks sample.seedinstall_profiles sample_end.ks sample_esxi6.ks sample.seed.28
You can see that there are many default configuration files.
Upload CentOS7.ks to the Cobbler server. The configuration file CentOS7.ks contains software packages related to development tools.
[root@Jaking kickstarts] # rz [root@Jaking kickstarts] # lsCentOS7.ks install_profiles sample_end.ks sample_esxi6.ks sample.seed.28default.ks legacy.ks sample_esx4.ks sample.ksesxi4-ks.cfg pxerescue.ks sample_esxi4.ks sample_old.seedesxi5-ks.cfg sample_autoyast.xml sample_esxi5.ks sample.seed [root@Jaking kickstarts] # cat CentOS7.ks# Cobbler for Kickstart Configurator for CentOS7 by clsninstallurl- -url=$treetextlang en_US.UTF-8keyboard uszerombrbootloader-- location=mbr-- driveorder=sda-- append= "crashkernel=auto rhgb quiet" # Network information$SNIPPET ('network_config') # network-- bootproto=dhcp-- device=eth0-- onboot=yes-- noipv6-- hostname=CentOS7timezone-- utc Asia/Shanghaiauthconfig-- enableshadow-- passalgo=sha512rootpw-- iscrypted $default_password_cryptedclearpart-all-- initlabelpart / boot-- fstype xfs-- size 1024part swap-- size 1024part /-fstype xfs-size 1-- growfirstboot-- disableselinux-- disabledfirewall-- disabledlogging-- level=inforeboot%pre$SNIPPET ('log_ks_pre') $SNIPPET (' kickstart_start') $SNIPPET ('pre_install_network_config') # Enable installation monitoring$SNIPPET (' pre_anamon')% end%packages@additional-devel@development@platform-develbash-completionchronydos2unixkexec-toolslrzszsysstattreevimwgetgitnet-tools%end%postsystemctl disable postfix.service%end [root@Jaking kickstarts] # cobbler profile list # View the current startup item Profile CentOS-7.6-x86_64 used
Change the kickstart file where name is CentOS-7.6-x86_64 to CentOS7.ks
[root@Jaking kickstarts] # cobbler profile edit-- name CentOS-7.6-x86_64-- kickstart=/var/lib/cobbler/kickstarts/CentOS7.ks [root@Jaking kickstarts] # cobbler report | grep KickstartKickstart Metadata: {'tree':' http://@@http_server@@/cblr/links/CentOS-7.6-x86_64'}Kickstart: / var/lib/cobbler/kickstarts/CentOS7.ksKickstart Metadata: {}
Change the name of the Nic to eth0 by passing parameters to the kernel
[root@Jaking kickstarts] # cobbler profile edit-name CentOS-7.6-x86_64-kopts='net.ifnames=0 biosdevname=0'
The configuration file is as follows:
[root@Jaking kickstarts] # vim CentOS7.ks # check the configuration file. Default is fine. There is no need to modify # Cobbler for Kickstart Configurator for CentOS7 by clsnInstall # installation system url-- url=$tree # url address is Cobbler built-in variable text # text installation If you change it to a graphical interface, it will be Graphicallang en_US.UTF-8 # language keyboard us # keyboard zerombr # this parameter is used to clear boot information, and you need to make it effective. You can add yes after the parameter. Optional, generally not. Bootloader-- location=mbr-- driveorder=sda-- append= "crashkernel=auto rhgb quiet" # specifies how the bootloader is installed. This option is required for both installation and upgrade. # Network information$SNIPPET ('network_config') # this parameter indicates that the network is configured using the script in the% pre below The related scripts are stored in / var/lib/cobbler/snippets#. If you do not need script configuration, you can enable the following configuration # network-- bootproto=dhcp-- device=eth0-- onboot=yes-- noipv6--hostname=CentOS7timezone-- utc Asia/Shanghai # time zone authconfig-- enableshadow-- passalgo=sha512 # encryption shadowrootpw-- iscrypted $default_password_crypted # set the root password clearpart-- all-- initlabel #-- all initializes the disk label to the default setting. Part / boot-- fstype xfs-- size 1024 # boot Partition size part swap-- size 1024 # swap Partition size part /-- fstype xfs-- size 1-- grow # Root Partition size firstboot-- disable # determines whether to start the setup Agent when the system boots for the first time and disable it. Selinux-- disabled # sets the SELinux state firewall in the system-- disabled # in the system beaver setting and firewall state logging-- level=info # this command controls the error log of anaconda during installation, which has no effect on the installed system. The specific script name used earlier is specified in% pre # pre after reboot # installation. $SNIPPET ('log_ks_pre') $SNIPPET (' kickstart_start') $SNIPPET ('pre_install_network_config') # Enable installation monitoring$SNIPPET (' pre_anamon')% end%packages # custom installation, where you can generate your own ks file and copy the corresponding configuration here. The current configuration is to minimize installation and install common system tools. @ additional-devel@development@platform-develbash-completionchronydos2unixkexec-toolslrzszsysstattreevimwgetgitnet-tools%end%post # executes actions after installation, either by executing scripts or directly executing commands. Systemctl disable postfix.service%end
Customize the Cobbler boot menu (name, timeout, default startup menu)
[root@Jaking kickstarts] # vim / etc/cobbler/pxe/pxedefault.templateDEFAULT menuPROMPT 0MENU TITLE Jaking # menu name TIMEOUT 100 # timeout TOTALTIMEOUT 6000ONTIMEOUT $pxe_timeout_profileLABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT-1 $pxe_menu_items # this variable is my custom boot menu and copied to the top of the LABEL local configuration item, otherwise the default startup is still local. MENU end
Synchronize Cobbler configuration
[root@Jaking kickstarts] # systemctl restart cobblerd [root@Jaking kickstarts] # cobbler synctask started: 2020-01-04_050537_synctask started (id=Sync Time=Sat Jan 4 05:05:37 2020) running pre-sync triggerscleaning treesremoving: / var/www/cobbler/images/CentOS-7.6-x86_64removing: / var/lib/tftpboot/pxelinux.cfg/defaultremoving: / var/lib/tftpboot/grub/imagesremoving: / var/lib/tftpboot/grub/grub-x86.efiremoving: / var/lib/tftpboot/grub/grub-x86_64.efiremoving: / var/lib/tftpboot/grub/efidefaultremoving: / var/lib/tftpboot/images/CentOS -7.6-x86_64removing: / var/lib/tftpboot/s390x/profile_listcopying bootloaderstrying 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 files for distro: CentOS-7.6-x86_64trying hardlink / var/www/cobbler/ks_mirror/CentOS-7 .6-x86_64/images/pxeboot/vmlinuz-> / var/lib/tftpboot/images/CentOS-7.6-x86_64/vmlinuztrying hardlink / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/images/pxeboot/initrd.img-> / var/lib/tftpboot/images/CentOS-7.6-x86_64/initrd.imgcopying imagesgenerating PXE configuration filesgenerating PXE menu structurecopying files for distro: CentOS-7.6-x86_64trying hardlink / var/www/cobbler/ks_mirror/CentOS -7.6-x86_64/images/pxeboot/vmlinuz-> / var/www/cobbler/images/CentOS-7.6-x86_64/vmlinuztrying hardlink / var/www/cobbler/ks_mirror/CentOS-7.6-x86_64/images/pxeboot/initrd.img-> / var/www/cobbler/images/CentOS-7.6-x86_64/initrd.imgWriting template files for CentOS-7.6-x86_64rendering DHCP filesgenerating / etc/dhcp/dhcpd.confrendering TFTPD filesgenerating / etc/xinetd.d/ Tftpprocessing boot_files for distro: CentOS-7.6-x86_64cleaning 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 *
Create a new virtual machine for testing.
Practice-using Cobbler Custom installation system-using Cobbler Custom installation system
Note: the memory should be large enough and the network mode should be consistent with the network mode of the Cobbler server.
Omit the creation process and go directly to the boot interface:
Practice-using Cobbler Custom installation system-using Cobbler Custom installation system
As you can see, 1262 packages need to be installed, which is no longer the original minimized installation.
Practice-using Cobbler Custom installation system-using Cobbler Custom installation system
After the installation is successful, by default start command line mode and enter root 123456 to log in to the system:
Practice-using Cobbler Custom installation system-using Cobbler Custom installation system
Set the default startup mode to graphical mode graphical.target
[root@localhost ~] # systemctl get-defaultmulti-user.target [root@localhost ~] # systemctl set-default graphical.targetRemoved symlink / etc/systemd/system/default.target.Created symlink from / etc/systemd/system/default.target to / usr/lib/systemd/system/graphical.target. [root@localhost ~] # systemctl get-default graphical.target [root@localhost ~] # reboot-use Cobbler custom installation system practice-use Cobbler custom installation system
Unable to start graphical mode properly
Solution method
Install graphical software
[root@localhost ~] # yum install-y xorg* gnome* glx*
Switch to graphical mode
[root@localhost ~] # init 5
The above is all the contents of the article "how to use Cobbler Quick install 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.
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.