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 explains "CentOS 7 YUM warehouse service and PXE automatic batch how to configure", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to configure CentOS 7's YUM warehouse service and PXE automatic batch.
First, YUM software warehouse to complete the installation, uninstall, automatic upgrade of rpm software packages and other tasks can use the YUM software warehouse, administrators can use the YUM software warehouse automatic search features to find and solve the dependency between rpm packages, making the administrator's task more relaxed.
1. The client configuration software repository location needs to specify at least one available software repository on the client before you can download and install the software package using the yum tool described in the next section. The software repository information used by the yum tool is stored in a file with the extension ".repo" in the / etc/yum.repos.d directory.
[root@CentOS01] # vim / etc/yum.repos.d/local.repo [local] name=centos baseurl= file:///root/benetenabled=1 gpgcheck=0 in the above operations, the file centos7.repo needs to be manually created. If there are other unused "* .repo" files in the / etc/yum.repos.d directory, it is recommended to delete them. "enabled=1" is the default and can be omitted; the two-line configuration of "gpgcheck" and "gpgkey" is used to check the integrity of the software package. If this requirement is not required, it can be omitted.
Second, the type of Yum source local source: Linux operating system CD is a yum repository
FTP source: uploading data to ftp users for access
HTTP source: need to connect to the Internet, easy to update data, need high-speed bandwidth
1. Configure local source [root@centos01] # vim / etc/yum.repos.d/local.repo [local] name=centosbaseurl= file:///mntenabled=1gpgcheck=02, configure ftp source [root@centos01 ~] # vim / etc/yum.repos.d/local.repo [ftp] name=centosbaseurl= ftp://192.168.100.10/enabled=1gpgcheck=03, Configure HTTP source [root@centos01 ~] # cd / etc/yum.repos.d/ [root@centos01 yum.repos.d] # wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyum.com/repo/Centos-7.repo4, The use of YUM [root@centos01 ~] # yum cleam all [root@centos01 ~] # yum list [root@centos01 ~] # yum info dhcp [root@centos01 ~] # yum-y install dhcp [root@centos01 ~] # yum-y remove dhcp [root@centos01 ~] # yum search httpd5, RPM package 1) the official centos update system encapsulates rpm software directly in IOS
2) third-party organizations release rpm packages to update new functions; modify them on an official basis
3) user-defined rpm package collection personal modification packet update package for open source hobby
4) users create yum source [root@centos01 ~] # createrepo-g / mnt/repodata/repomd.xml. / benet/ 3. Configuration of PXE automatic batch installation system matters needing attention PXE is a network boot technology developed by intel, which works in Client/Server mode, allowing clients to download boot images from remote servers over the network and load installation files or the entire operating system.
The network card of the client supports PXE protocol (integrated BOOTROM chip), and the motherboard supports network boot.
There is a DHCP server in the network to automatically assign addresses to clients and specify boot file locations
The server provides the download of boot image files through TFTP (simple File transfer Protocol); one condition is the hardware requirement, which is currently available on most servers and most PC, as long as boot from Nerwork or LAN is allowed in the BIOS setting.
4. Deploy PXE remote installation service 1. Configure YUM repository And install the ftp service: [root@centos01 ~] # mount / dev/cdrom / media [root@centos01 ~] # cd / etc/yum.repos.d/ [root@centos01 yum.repos.d] # rm-rf * [root@centos01 yum.repos.d] # vim a.repo [yum] baseurl= file:///mediagpgcheck=0[root@centos01 yum.repos.d] # yum-y install vsftpd*2, Prepare the centos7 installation source and start the ftp service: [root@centos01 yum.repos.d] # mkdir / var/ftp/centos7 [root@centos01 yum.repos.d] # cp-rf / media/* / var/ftp/centos7/ [root@centos01 yum.repos.d] # systemctl start vsftpd [root@centos01 yum.repos.d] # systemctl enable vsftpd3, Install and start the TFTP service: [root@centos01 yum.repos.d] # yum-y install tftp-server [root@centos01 yum.repos.d] # vim / etc/xinetd.d/tftp.. service tftp {socket_type = dgramprotocol= udpwait= yesuser= rootserver= / usr/sbin/in.tftpdserver_args =-s / var/lib/tftpbootdisable = no per_source= 11cps = 1002flags = IPv4 } [root@centos01 yum.repos.d] # systemctl start tftp [root@centos01 yum.repos.d] # systemctl enable tftp4 、 Prepare the Linux kernel, initialize the image file (on the system disk): [root@centos01 ~] # cd / media/images/pxeboot/ [root@centos01 pxeboot] # cp vmlinuz initrd.img / var/lib/tftpboot/5, prepare the PXE bootstrap: [root@centos01 pxeboot] # yum-y install syslinux [root@centos01 pxeboot] # cp / usr/share/syslinux/pxelinux.0 / var/lib/tftpboot/6, Configuration startup menu (typical and unattended installation startup menu can choose one of the two according to actual needs): [root@centos01 pxeboot] # mkdir / var/lib/tftpboot/pxelinux.cfg1) typical startup menu Unable to implement unattended installation: [root@centos01 pxeboot] # vim / var/lib/tftpboot/pxelinux.cfg/defaultdefault autoprompt 1label autokernel vmlinuzappend initrd=initrd.img method= ftp://192.168.100.10/centos7label linux textkernel vmlinuzappend text initrd=initrd.img method= ftp://192.168.100.10/centos7label linux rescuekernel vmlinuzappend rescue initrd=initrd.img method= ftp://192.168.100.10/centos72) unattended installation startup menu: [root@centos01 pxeboot] # vim / var/lib/tftpboot/pxelinux .cfg / default default autoprompt 0label autokernel vmlinuzappend initrd=initrd.img method= ftp://192.168.100.10/centos7 ks= ftp://192.168.100.10/ks.cfg in the above two startup menus What I configure here is unattended installation, if you choose the typical startup menu, then a lot of the next operation is unnecessary, as long as you install the DHCP server to deploy the system.
7. Install and enable DHCP server: [root@centos01 pxeboot] # yum-y install dhcp [root@centos01 pxeboot] # vim / etc/dhcp/dhcpd.conf..subnet 192.168.100.0 netmask 255.255.255.0 {range 192.168.100.100 192.168.100.200 option domain-name-servers 8.8.8.8 option domain-name "internal.example.org" Option routers 192.168.100.254 option broadcast-address 192.168.100.255 centos centos system after installing the system-config-kickstart tool, you can use the graphical wizard tool to configure the installation answer file:
[root@centos01 pxeboot] # yum-y install system-config-kickstart1) Open the graphical program:
2) configure the installation response parameters:
3) since the ftp service allows anonymous access by default, you do not need to specify a user name and password:
4) Bootloader:
5) Partition information (choose the appropriate hard disk partition scheme according to the actual demand):
6) Network configuration and firewall:
7) write a post-installation script and save it to the documentation directory:
Saved answer file: [root@centos01 ~] # vim ks.cfg (you can copy this file directly to omit the steps of graphical configuration Modify it according to the actual needs and use it): # platform=x86, AMD64 Or Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard 'us'# Root passwordrootpw-iscrypted $1 $bauETRq3 $WOpze2jeKD9q3qgKK50xj0# Use network installationurl-url= "ftp://ftp:192.168.100.10/centos7"# System languagelang zh_CN# System authorization informationauth--useshadow--passalgo=sha512# Use graphical installgraphicalfirstboot-disable# SELinux configurationselinux-disabled# Firewall configurationfirewall-disabled# Network informationnetwork--bootproto=dhcp-device=ens32# Reboot after installationreboot# System timezonetimezone Asia/Shanghai# System bootloader configurationbootloader-location=mbr# Partition clearing informationclearpart-all# Disk partitioning Informationpart / boot-- fstype= "xfs"-- size=500part / home-- fstype= "xfs"-- size=4096part swap-- fstype= "swap"-- size=2048part /-- fstype= "xfs"-- grow-- size=1%post-- interpreter=/bin/bashcd / etc/yum.repos.drm-rf * echo-e "[base]" > aa.repoecho-e "baseurl= ftp://192.168.100.10/centos7" > > aa.repoecho-e" gpgcheck=0 > > aa.repo%end, but the configuration file above is almost there. Three more lines need to be written at the end of the configuration file to select the minimum installation:
After% packages@ ^ minimum% end is written, save and exit.
9. Copy the auto answer file to the specified directory (the path of the "ks=" item specified in the previous boot menu): [root@centos01 ~] # cp / root/ks.cfg / var/ftp/10, OK, boot the client, and verify the effect (wait patiently for completion):
Installation succeeded:
As long as you correctly specify information such as the address of the software repository, you can install or update the software through the corresponding "source" server.
At this point, I believe you "CentOS 7 YUM warehouse services and PXE automatic batch how to configure" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.