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

Centos7 YUM Warehouse Service and PXE Network installation

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Blog catalogue

1. YUM software repository

Second, the type of Yum source

Matters needing attention in configuring PXE automatic batch makeup machine

Deploy PXE remote installation service

1. YUM software repository

With the help of YUM software warehouse, we can complete the tasks of installing, uninstalling and automatically upgrading rpm software packages, and can automatically find and solve the dependencies between rpm packages, without the need for administrators to install each rpm package one by one, which makes it easier for administrators to maintain a large number of Linux servers.

To successfully use the YUM mechanism to update systems and software, you need a software repository (repository) that contains various rpm installation package files and their dependent software, and the server that provides the software repository is also known as the "source" server. As long as the information such as the address of the software repository is correctly specified in the client, the software can be installed or updated through the corresponding "source" server.

YUM software repositories are usually released with the help of HTTP or FTP protocols, so that software source services can be provided to all clients in the network. In order to facilitate the client to query the software package. To obtain information such as dependencies, you need to provide warehouse data (repodata) in the software repository, which collects the header information of all rpm packages under the directory.

1. The location of the client configuration software repository

You need to specify at least one available software repository on the client before you can download and install software packages using the yum tools 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/benet enabled=1 gpgcheck=0

In the above operations, the file centos7.repo needs to be created manually. 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; "gpgcheck" and "gpgkey" are configured to check the integrity of the software package, if not required, it can be omitted.

Type local source: Linux operating system CD is a yum repository; HTTP source: upload data to ftp users for access; FTP 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, 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 httpd 5, Source of RPM package 1) official centos

The update system encapsulates rpm software directly in IOS.

2) third-party organizations release rpm packages

Update new functions; make changes on an official basis.

3) user-defined rpm package collection

Open source hobbies modify packets update packets

4) user creates yum source [root@centos01 ~] # createrepo-g / mnt/repodata/repomd.xml. / benet/ 3. Precautions for configuring PXE automatic batch makeup machine

PXE is a network boot technology developed by intel, which works in Client/Server mode and allows clients to download boot images from remote servers through the network and load installation files or the whole operating system.

The network card of the client supports PXE protocol (integrated BOOTROM chip), and the motherboard supports network booting; there is a DHCP server in the network to automatically assign addresses and specify the location of boot files for clients; the server provides 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 booting 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 vsftpd 3, 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 = Dgram protocol = udp wait = yes user = root server = / usr/sbin/in.tftpd server_args =-s / var/lib/tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4} [root@centos01 yum.repos.d] # systemctl start tftp [root@centos01 yum.repos.d] # systemctl enable tftp 4, 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, Configure the startup menu (typical and unattended startup menus can choose one of the two configurations according to the actual needs):

[root@centos01 pxeboot] # mkdir / var/lib/tftpboot/pxelinux.cfg

1) typical startup menu Unable to implement unattended installation: [root@centos01 pxeboot] # vim / var/lib/tftpboot/pxelinux.cfg/default default autoprompt 1label auto kernel vmlinuz append initrd=initrd.img method= ftp://192.168.100.10/centos7label linux text kernel vmlinuz append text initrd=initrd.img method= ftp://192.168.100.10/centos7label linux rescue kernel vmlinuz append 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 auto kernel vmlinuz append 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 a typical startup menu, then many of the next operations are unnecessary. As long as you install the DHCP server, you can 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; default-lease-time 21600; max-lease-time 43200; next-server 192.168.100.10; filename "pxelinux.0";} [root@centos01 pxeboot] # systemctl start dhcpd [root@centos01 pxeboot] # systemctl enable dhcpd 8, prepare to install the answer file:

After you install the system-config-kickstart tool on a centos 7 system, you can configure the installation answer file through the graphical wizard tool:

[root@centos01 pxeboot] # yum-y install system-config-kickstart

1) 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

However, the above configuration file is almost there, and you need to write three more lines at the end of the configuration file to select the minimum installation:

% packages@ ^ minimum% end

After writing, 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 (just wait patiently for completion):

Installation succeeded:

-this is the end of this article. Thank you for reading-

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