当前位置:网站首页>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
边栏推荐
- yarn : 无法加载文件 yarn.ps1,因为在此系统上禁止运行脚本。
- Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
- 『怎么用』装饰者模式
- 『怎么用』观察者模式
- [C language] dynamic memory management, flexible array
- 一文搞懂try、catch、finally(包含return)执行流程(全网最详细解析)
- registration status: 204
- C language and SQL Server database technology
- 分享一个避免递归的部门设计方法
- C#语言和SQL Server数据库技术
猜你喜欢

redis的五种数据结构原理分析

nacos2.1.0集群搭建

Activemq-- delayed delivery and scheduled delivery

Leetcode组合总和+剪枝

数据查询语言(DQL)

Uniapp intercepts route jumps through addinterceptor to control whether the page needs to log in

Composition of the interview must ask items

Programmers can't SQL? Ashes Engineer: all waiting to be eliminated! This is a must skill!

SQL injection

mysql中的数据结果排名
随机推荐
Comments on specific applications of camera
How can technologists start their personal brand? Exclusive teaching of top five KOLs
Nacos搭建配置中心出现client error: invalid param. endpoint is blank
Opencv realizes simple face tracking
excl批量导入数据,后台公共解析方法
Mongodb exploration phase [easy to understand]
MySQL的索引、视图与事务
保姆级Scanner类使用详解
抽象类和接口的区别(最详细)
Probe into Druid query timeout configuration → who is the querytimeout of datasource and jdbctemplate effective?
Learning Weekly - total issue 63 - an open source local code snippet management tool
Uniapp intercepts route jumps through addinterceptor to control whether the page needs to log in
ActiveMQ -- JDBC Journal of persistent mechanism
office文件对应的Content-Type类型
log4j2基础配置
Shell脚本
activemq--消息重试机制
将list集合的某一字段拼接单个String
redis的五种数据结构原理分析
Notes on in-depth analysis of C language 2