Nexus3 Repository代理pypi设置与应用

目录

1. 创建Blob库并指定路径

2. 创建pypi阿里镜像源

3. 创建pypi腾讯镜像源

4. 创建一个pypi组管理

5. 配置pip

6. 下载测试

扩展:配置好后无法下载解决思路。


 

Nexus 存储库中的 Blob 存储是指一种用于存储大量非结构化数据的技术。在 Nexus 存储库的上下文中,Blob 存储通常用于存储二进制大对象(Binary Large Objects),例如软件包、图像、音频和视频文件等。Blob 存储是一种高效的方式来存储和检索大量数据,因为它可以提供高吞吐量和低延迟的数据访问。

存储库(Repository)在 Nexus 中是一个用于组织和管理软件构件(如 Maven、NPM、Docker 等包)的地方。每个存储库可以包含多个版本的构件,并且可以根据需要设置不同的访问权限和存储策略。存储库的主要作用是提供一个中心化的位置来存储和分发软件构件,以便开发人员可以轻松地共享和重用代码。

区别在于,Blob 存储是一种底层的数据存储技术,而存储库是一种上层的抽象,用于管理特定的软件构件。存储库利用 Blob 存储来实际保存数据,但它还提供了额外的功能,如版本控制、访问控制、元数据管理和服务端插件等。简而言之,Blob 存储是存储库中数据实际存放的地方,而存储库是管理和访问这些数据的界面和逻辑。

下面我将使用部署好的Nexus Repository存储库。

 

1. 创建Blob库并指定路径

 

 

2. 创建pypi阿里镜像源

 

阿里pypi镜像地址:  https://mirrors.aliyun.com/pypi/

 

3. 创建pypi腾讯镜像源

 

 腾讯pypi镜像地址:Index of /pypi/

 

4. 创建一个pypi组管理

 

 

 

5. 配置pip

首先确保安装了python3和pip

[root@nexus ~]# yum install -y python3 pip

配置pip

将配置的链接配置下述位置,在连接最后记得加上simple 

[root@nexus ~]# mkdir /root/.pip
[root@nexus ~]# vim .pip/pip.conf
[global]
index-url=http://192.168.226.26:8081/repository/pypi/simple
trusted-host=192.168.226.26

 

6. 下载测试

 

[root@nexus ~]# pip install requests
[root@nexus ~]# pip install virtualenv

这样就下载好了。

 现在回到命令行卸载刚下载的包,重新下载测试看有缓存的安装速度,会很快。

# 卸载
[root@nexus ~]# pip uninstall requests
[root@nexus ~]# pip uninstall virtualenv

# 安装
[root@nexus ~]# pip install requests
[root@nexus ~]# pip install virtualenv

这样安装就很快了。 


扩展:配置好后无法下载解决思路。

 

检查配置文件,是否和存储库的路径一致,在配置/root/.pip/pip.conf时注意链接最后加上simple

如果仅配置root家目录的pip配置,会导致普通用户不可用,记得给需要的普通用户加上sudo权限并给该用户的家目录中配置pip再使用。 

如果要给全部用户使用pip下载,首先要有sudo权限,然后在/etc/pip.conf配置即可。

  • 11
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
looking in indexes: https://nexuscimgmt.sgp.dbs.com:8443/nexus/repository/pypi-all/simple/ could not fetch url https://nexuscimgmt.sgp.dbs.com:8443/nexus/repository/pypi-all/simple/flask/: there was a problem confirming the ssl certificate: httpsconnectionpool(host='nexuscimgmt.sgp.dbs.com', port=8443): max retries exceeded with url: /nexus/repository/pypi-all/simple/flask/ (caused by sslerror(sslcertverificationerror(1, '[ssl: certificate_verify_failed] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))) - skipping could not fetch url https://nexuscimgmt.sgp.dbs.com:8443/nexus/repository/pypi-all/simple/pip/: there was a problem confirming the ssl certificate: httpsconnectionpool(host='nexuscimgmt.sgp.dbs.com', port=8443): max retries exceeded with url: /nexus/repository/pypi-all/simple/pip/ (caused by sslerror(sslcertverificationerror(1, '[ssl: certificate_verify_failed] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))) - skipping warning: retrying (retry(total=4, connect=none, read=none, redirect=none, status=none)) after connection broken by 'sslerror(sslcertverificationerror(1, '[ssl: certificate_verify_failed] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))': /nexus/repository/pypi-all/simple/flask/ warning: retrying (retry(total=3, connect=none, read=none, redirect=none, status=none)) after connection broken by 'sslerror(sslcertverificationerror(1, '[ssl: certificate_verify_failed] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))': /nexus/repository/pypi-all/simple/flask/ warning: retrying (retry(total=2, connect=none, read=none, redirect=none, status=none)) after connection broken by 'sslerror(sslcertverificationerror(1, '[ssl: certificate_verify_failed] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))': /nexus/repository/pypi-all/simple/flask/ warning: retrying
06-28
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ZZDICT

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值