当前位置:网站首页>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
边栏推荐
- 『每日一问』简单聊聊JMM/说说对JMM的了解
- C language and SQL Server database technology
- ActiveMQ -- kahadb of persistent mechanism
- Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
- Silicon Valley class lesson 11 - official account news and wechat authorization
- Flask SSTI注入学习
- Write two channel (stereo) immediately Wav file
- Nacos搭建配置中心出现client error: invalid param. endpoint is blank
- Redis operation uses cursor instead of keys
- excl批量导入数据,后台公共解析方法
猜你喜欢

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

CentOS changes MySQL database directory
![[BUUCTF-n1book][第二章 web进阶]SSRF Training](/img/29/8894d04b27e0e73c4458c27bd9b935.png)
[BUUCTF-n1book][第二章 web进阶]SSRF Training

activemq--可持久化机制之JDBC的journal

ActiveMQ -- JDBC Journal of persistent mechanism

Nacos启动报错Unable to start web server

jsPDF生成PDF文件,文件不全问题,后台进行文件下载,前台不下载

『每日一问』简单聊聊JMM/说说对JMM的了解

Neural network learning (1) Introduction

『每日一问』ReentrantLock加锁解锁
随机推荐
Neural network learning (1) Introduction
Comments on specific applications of camera
[selected] from simple to deep, you will understand MQ principles and application scenarios
Common tool classes under JUC package
Solve NPM error: cannot find module 'shelljs‘
Two Sum
Mongodb installation and use
MySQL appends a string to the string of a field in the table [easy to understand]
在Ubuntu中安装MySQL并创建新用户
activemq--消息重试机制
activemq--可持久化机制
API健康状态自检
Interviewer: tell me the difference between redis and mongodb? [easy to understand]
log4j2基础配置
Ctfhub skill tree Web
Wechat applet obtains the data of ---- onenet and controls the on-board LED of STM32
一文搞懂为什么要同时重写equals方法和hashCode方法+实例分析
MySQL的索引、视图与事务
Redis数据库基础
数据控制语言(DCL)