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

Remote YUM Warehouse and NFS Service of Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Overview of YUM

Software update mechanism based on RPM package construction

Dependencies can be resolved automatically

All software packages are provided by a centralized YUM software repository

The way the software repository is provided

FTP service: ftp://...

HTTP service: http://...

Local directory: file://...

The source of RPM software package

Collection of RPM packages released by Centos

A collection of RPM packages released by third-party organizations

User-defined collection of RPM packages

Query of software package

Yum list [Software name]

Yum info [Software name]

Yum search

Software package upgrade

Yum update updates software packages, software and system kernels

Yum upgrade updates only software packages

Case list: build a remote YUM repository, a server as a yum server and a client as a client access

1. Connect the centos7 image to the server on the server, and mount it.

[root@server ~] # mount / dev/cdrom / mnt mount [root@server ~] # df-hT view

2, install the vsftpd service software on the server side and create a site

[root@server ~] # yum install vsftpd-y install ftp service [root@server ~] # cd / var/ftp [root@server ftp] # mkdir centos7 create centos7 site [root@server ftp] # cp-rf / mnt/* centos7/ & copy image to site [1] 2891 [root@server ftp] # jobs [1] + running cp-I-rf / mnt/* centos7/ & [root@server ftp] # mkdir other create a custom site [root@server ftp] # createrepo-g / mnt/repodata/repomd.xml other/ [root@server repodata] # systemctl start vsftpd enable vxftpd service [root@server repodata] # systemctl stop firewalld.service close firewall [root@server repodata] # setenforce 0

3. Install the ftp service software on the client and create the yum configuration file

[root@client ~] # yum install ftp-y

[root@client ~] # cd / etc/yum.repos.d/ back up all [root@client yum.repos.d] # lsCentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repoCentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo [root@client yum.repos.d] # mkdir bak [root@client yum.repos.d] # mv Cen* bak [root@client yum.repos.d] # in the configuration file directory of yum Lsbak [root@client yum.repos.d] # vim centos7.repo re-edit a yum configuration file [base] yum access path information for name=centos7.packages centos7 baseurl= ftp://192.168.109.133/centos7enabled=1gpgcheck=1gpgkey=ftp://192.168.109.133/centos7/RPM-GPG-KEY-CentOS-7[other]name=other.packages other yum information baseurl= ftp://192.168.109.133/otherenabled=1gpgcheck=0

4. Clear the yum cache and install using remote yum

[root@client yum.repos.d] # yum clean all clear yum cache [root@client yum.repos.d] # yum install httpd-y

NFS shared storage service

Network file system

Dependent on RPC (remote procedure call)

Nfs-utils,rpcbind package needs to be installed

System service: nfs,rpcbind

Shared profile: / etc/exports

Case list:

1. Add a hard disk as shared storage on the server side, create and format / dev/sdb1, and set up automatic mount

[root@localhost] # vim / etc/fstab [root@localhost ~] # mount-a [root@localhost ~] # df-hT

2. Install the nfs-utils,rpcbind package on the server

[root@localhost ~] # yum install nfs-utils rpcbind-y [root@localhost ~] # systemctl enable nfs setting Boot self-boot [root@localhost ~] # systemctl enable rpcbind

3. Edit server / etc/exports shared profile information

[root@localhost ~] # vim / etc/exports Editing profile [root@localhost ~] # systemctl start nfs enables service [root@localhost ~] # systemctl start rpcbind [root@localhost ~] # systemctl stop firewalld.service closes firewall [root@localhost ~] # setenforce 0 [root@localhost ~] # showmount-e to view sharing

4, mount the server's / mnt on the client to the local website site

[root@localhost ~] # systemctl stop firewalld.service disable firewall [root@localhost ~] # setenforce 0 [root@client ~] # mount 192.168.109.133:/mnt / var/www/html/ mount [root@client ~] # df-hT

Or set it to auto mount

5. Install the httpd website service on the client, edit a web page information, and view

[root@client ~] # cd / var/www/html [root@client html] # vim index.html Editing Web Page Information [root@client html] # systemctl start httpd.service enable httpd service

6. We can find the files of a website created in the mnt directory of the server.

If the server is down, we must not be able to tab when we unmount it. Enter it all by yourself, or you will regret it.

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