Deploy YUM warehouse and NFS shared service

Directory

1. YUM Warehouse Service

1. Overview of YUM

2. Prepare the installation source

2.1. How the software warehouse is provided

2.2. The source of the RPM package

3. Overview of YUM tools

3.1. YUM configuration file

3.2. Package query

2. How to provide YUM source

1. Configure the local yum source

3. NFS shared storage service

1. NFS (Network File System) network file system

2. Features

4. Experiment


1. YUM warehouse service

1.YUM overview

YUM (Yellow dog Updater Modified) is a software update mechanism based on RPM packages

  • Dependencies can be resolved automatically
  • All packages are provided from a centralized YUM repository

2. Prepare installation source

2.1. How to provide software warehouse

  • FTP service: ftp://…..
  • OHTTP service: http://…
  • Local directory: file://…

2.2. The source of the RPM package

  • A collection of RPM packages released by CentOS
  • A collection of RPM packages released by third-party organizations
  • A collection of user-defined RPM packages

3. Overview of YUM tools

3.1.YUM configuration file

  • Basic settings: letc/yum.conf
  • Warehouse settings: letc/yum.repos.d/*.repo
  • Log file: /var/log/yum.log

3.2. Package query

Query packages

  • yum info[software name]

  • yum search

  • yum whatprovides

Query Package Group

  • yum grouplist [package group name]
  • yum groupinfo

Install software

  • yum install [software name]
  • yum groupinstall

Upgrade software

  • yum update
  • yum group update

Uninstall software

  • yum remove
  • yum groupremove

Download RPM packages without installing

  • yum reinstall -y bash –downloadonly #Download the installed rpm package
  • yum install package name -y –downloadonly –downloaddir=/tmp/ #Download the RPM package to the specified directory

Check the history to find the packages it depends on

  • yum history

  • yum history list lists recent history

  • yum history info id lists the detailed information of a certain time,

  • yum history undo id Undo a change

  • yum history help view help

  • yum history redo adds the sequence number and re-executes the operation in the sequence number

2. How to provide YUM source

1. Configure local yum source

  1. mount /dev/sr0 /mnt #Mount the disc to the /mnt directory (the premise is that the virtual machine is mounted on a disc)
  2. cd /etc/yum.repos.d/
  3. mkdir repos.bak create directory
  4. mv *.repo repos.bak/ Move the source in yum.repos.d to the repos.bak directory
  5. vim local.repo compiled file
  6. yum clean all & amp; & amp; yum makecache ##clean yum cache and update
[local] #warehouse category
name=local #warehouse name
baseurl=file:///mnt #Specify the URL access path as the CD mount directory
enabled=1 #Open this yum source, this is the default item, can be omitted
gpgcheck=0 #Do not verify the signature of the package

3. NFS shared storage service

1. NFS(Network File System) Network File System

  • Rely on RPC (side procedure call)
  • The nfs-utils and rpcbind packages need to be installed
  • System services: nfs, rpcbind
  • Shared configuration file: /etc/exports

2. Features

  • Using TCP/IP to Transfer Network Files
  • low security
  • easy to operate
  • Suitable for LAN environment

4. Experiment

Create a shared directory on the first virtual machine and grant all permissions to the shared directory

Modify the shared policy configuration file /etc/exports

Start rpcbind and nfs services (when manually loading NFS shared services, you should start rpcbind first, and then start nfs)

View the shared directory published by the service

View the specified ip address sharing

Also set up a shared directory on the second virtual machine

create file on server

The second sync is successful

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. CS introductory skill tree Introduction to LinuxFirst-knowledge Linux31680 People are learning systematically