当前位置:网站首页>Publish Yum private server using nexus3 (offline intranet)
Publish Yum private server using nexus3 (offline intranet)
2022-07-25 09:24:00 【zk_ Kang】
The company's servers are not networked , The company requires the intranet to be built yum Private clothes
I found that this part is rarely found in online tutorials , I hope this article can help you
First of all, you should build it correctly nexus3, I use docker Built , You can baidu by yourself or refer to the connection I wrote docker install nexus3 ( offline / Intranet )_zk_Kang The blog of -CSDN Blog ,
Relatively simple , Image download , Mapping directory , To start, etc.
Let me start with my thoughts ,
1. The Intranet environment is installed nexus3- Use docker, Remember to map directories , If you are linux, That's easy , Just look at the directory you installed .
2. After installation nexus3 Created on yum Environmental Science --yum Kuhe yum source address .
3. Download the image source package from a machine with an external network environment
4. Import the downloaded image source package to the intranet
5. Import the image source package in batches to nexus3 Upper yum Source address
Install as follows -- Note that the one in the red box is built by myself

1. Create a library ( If you want to use default, This step can be omitted , Look directly at step two )
as follows - Click on create blob store

The latest version I use , It's changed here. You need to choose here type by file, If you don't have this , It doesn't matter , To look down .

Define the library name as yum-hub
After creation, you can see , Here you are size Should be 0, I put something in it, so size Not for 0

2. establish yum Mirror source
Here you are proxy( agent ) hosted( Local mirror source )group(proxy and hosted The combination of )
You can only create hosted and group , You can also create just one hosted( Anyway, you have no Internet , One is enough , Of course, in case of subsequent expansion of the local image source , It is suggested to establish a group, Will all hosted Put in group)
Here is a demonstration of proxy It also demonstrates ,-- If you have Internet conditions in this step, you can take a look
1. spot create repository

2. establish proxy agent

Below http://url, Just write an Alibaba image source

3.hosted- Local mirror source
I circled all the important places with red boxes ,
Here we need to pay attention to the following allow redeplov, The meaning of contract awarding can be repeated here

4. Build a group
hold proxy( agent ) hosted( Local mirror source ) All joined group
Remember hosted( Local mirror source ) On, ha , If you are an intranet, there is no proxy 了 , There is no need to establish , Not to mention .
Who's on , Who are you looking for first , I found it locally , Don't download , This is the role of private servers , Save bandwidth .
LAN downloads are faster than networking

5. After the foundation of

Now ,yum It's empty

3. Download Image Source
Machine with internet , I was in liunx Operated on the machine .
For details, please refer to this blog written by this blogger , I downloaded it according to what he wrote . I didn't install all his downloads , I downloaded a base library
# Download Alibaba image source
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# Download Ali epel Source
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# Delete cache
yum clean all
# Update cache
yum makecache
# View the list of image sources
yum repolist
# Install the synchronization tool
yum install -y yum-utils
# install repo Production tools
yum install -y createrepo
# install wget
yum install -y wget
# Create directory
mkdir -p /home/repos_local/centos/7
# Sync
reposync -r base -p /home/repos_local/centos/7
# establish repo data
createrepo /home/repos_local/centos/7/baseI'll be done here , Put... Directly /home/repos_local This package can be delivered to the intranet . I'm going to home Give orders .
Compress command :tar -cvf xx.tar.gz repos_local
4. Batch upload to intranet server
First turn on the decompression
tar -zxvf xx.tar.gz
After decompression, enter the directory and directly execute the command , Copy all , Direct execution , You may write a document , Perform the same , I compare lazy , I will directly execute . Remember *** For your password , hinder ip The address has to be changed .
The directory hierarchy here , You can define yourself , I also defined myself .
#! /bin/bash
for i in `ls /home/repos_local/CentOS7/base/Packages`;
do curl -v --user 'admin:***' --upload-file /home/repos_local/CentOS7/base/Packages/$i http://ip:8081/repository/yum/CentOS7/base/Packages/$i;
doneWhen you're done, you can yum-hosted Next, I see what you uploaded rpm It's packed
5. Use yum Private clothes
All the previous work is for this step
Get into /etc/yum.repos.d Under the table of contents ,
If there is a suffix in this directory repo The file of , Build a mkdir bak Put... In this directory repo File move to bak Under the table of contents
stay /etc/yum.repos.d Create a new one in the directory repo file , Name at will
vi centos.repo
The contents are as follows , Here I see some places that write base, But through my actual discovery, I wrote base layer yum Can not use , If this happens to you , You can write first base layer , hinder Packages, If not , Re reform .
My address here is yum Of group route
# Unnecessary warehouses can be commented out
# All intranet warehouses are closed gpgcheck check
# base Warehouse
[base]
name=Local CentOS-7 Base
baseurl=http://xxx:8081/repository/yum-group/CentOS7/base/Packages/
enabled=1
gpgcheck=0
After writing , You can use it
Test it , The following two clear the cache , Let the new yum Download from the new configuration .
yum clean all
yum makecache
# Test a download
yum -y install httpd
That's it , I hope this article can help you .
yum repolist-- Execute this command , Check your image source
边栏推荐
- OverTheWire-Bandit
- 动态添加多tab,并初始化每个tab页面
- Neural network learning (1) Introduction
- Solve NPM error: cannot find module 'shelljs‘
- [SCADA case] myscada helps VIB company realize the modernization and upgrading of production line
- activemq--可持久化机制之JDBC的journal
- TCP网络应用程序开发流程
- log4j2基础配置
- Nacos启动报错Unable to start web server
- PHP介绍
猜你喜欢
![[WSN communication] optimize HWSN energy-saving clustering protocol based on MATLAB biogeography [including Matlab source code, 1989]](/img/47/c804acc3f8de1f0cd5938c3d889e46.png)
[WSN communication] optimize HWSN energy-saving clustering protocol based on MATLAB biogeography [including Matlab source code, 1989]

Jspdf generates PDF files. There is a problem of incomplete files. Files are downloaded in the background, but not in the foreground

Guangzhou has carried out in-depth "100 day action" to check the safety of self built commercial houses, and more than 2 million houses have been checked in two months

sqli-labs Basic Challenges Less11-22

Silicon Valley classroom lesson 12 - official account on demand course and live broadcast management module

将list集合的某一字段拼接单个String

idea中将lib目录下的jar包加入到项目中

Nacos启动报错Unable to start web server

无法再web服务器上启动调试,web服务器未能找到请求资源

『每日一问』简单聊聊JMM/说说对JMM的了解
随机推荐
[common tools] obtain system status information based on psutil and gputil
ActiveMQ -- JDBC code of persistent mechanism
Two Sum
数据控制语言(DCL)
Shell脚本
ActiveMQ -- dead letter queue
[C language] dynamic memory management, flexible array
ActiveMQ -- kahadb of persistent mechanism
前台页面打印
PHP网站设计思路
[learn rust together] a preliminary understanding of rust package management tool cargo
registration status: 204
Arrange the array into the smallest number
C#语言和SQL Server数据库技术
MySQL的索引、视图与事务
Notes on in-depth analysis of C language 2
【线程知识点】-- 自旋锁
[deep learning] overview | the latest progress of deep learning
Nacos搭建配置中心出现client error: invalid param. endpoint is blank
Silicon Valley classroom lesson 12 - official account on demand course and live broadcast management module