当前位置:网站首页>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
边栏推荐
- Do you know these methods of MySQL database optimization?
- activemq--持久化机制之LevelDB
- idea 热部署
- Network principle (2) -- network development
- yarn : 无法加载文件 yarn.ps1,因为在此系统上禁止运行脚本。
- 数据查询语言(DQL)
- Reverse Integer
- 【线程知识点】-- 自旋锁
- [selected] from simple to deep, you will understand MQ principles and application scenarios
- idea实用tips---如今将pom.xml(红色)改为pom.xml(蓝色)
猜你喜欢

centos更改mysql数据库目录

Unable to start debugging on the web server, the web server failed to find the requested resource

idea实用tips---如今将pom.xml(红色)改为pom.xml(蓝色)

Neural network learning (1) Introduction

Bi business interview with data center and business intelligence (I): preparation for Industry and business research

How can technologists start their personal brand? Exclusive teaching of top five KOLs

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

sql注入

activemq--消息重试机制
![[BUUCTF-n1book][第二章 web进阶]SSRF Training](/img/29/8894d04b27e0e73c4458c27bd9b935.png)
[BUUCTF-n1book][第二章 web进阶]SSRF Training
随机推荐
Opencv realizes simple face tracking
ActiveMQ -- persistent mechanism
activemq--死信队列
『每日一问』LockSupport怎么实现线程等待、唤醒
Ctfhub skill tree Web
[BUUCTF-n1book][第二章 web进阶]SSRF Training
MySQL排序
activemq--延迟投递和定时投递
Nacos搭建配置中心出现client error: invalid param. endpoint is blank
Analysis of concat and group in MySQL_ Use of concat
Kubedm introduction
C language and SQL Server database technology
[SCADA case] myscada helps VIB company realize the modernization and upgrading of production line
分布式一致性协议之Raft
『每日一问』简单聊聊JMM/说说对JMM的了解
[C language] dynamic memory management, flexible array
log4j2基础配置
Ranking of data results in MySQL
sqli-labs安装 环境:ubuntu18 php7
C#语言和SQL Server数据库技术