为devstack加速

本文介绍如何通过更换系统源、pip 源及 Git 源来优化 DevStack 的性能。具体步骤包括更换 CentOS 或 Ubuntu 的系统源为阿里云源,调整 pip 配置使用阿里的 PyPI 简单镜像,以及切换 Git 协议为 HTTPS 以避免 git clone 卡顿。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、更换系统源

devstack配置过程中会安装系统依赖,所以配置好系统源 当然是第一步

centos root执行:

 curl firxiao.com/sh/chrepo.sh|sh

ubuntu 普通用户执行:

curl firxiao.com/sh/chapt.sh|sudo sh

脚本会自动将源配置为aliyun的源

二、更换pip源

openstack是python项目 好多依赖都要用pip install 当然要换pip源啦

  执行以下命令即可

mkdir ~/.pip
cat << EOF > ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
EOF


三、更换git源

 在执行devstack的过程中 要去clone官方的源码

 默认用的是git://协议 如果你发现每次都是在git clone那卡住 

  那么你可以更换为https://协议

  更改stackrc中GIT_BASE即可

diff --git a/stackrc b/stackrc
index d16fcf6..2290edd 100644
--- a/stackrc
+++ b/stackrc
@@ -161,7 +161,8 @@ USE_CONSTRAINTS=$(trueorfalse False USE_CONSTRAINTS)
 
 # Base GIT Repo URL
 # Another option is https://git.openstack.org
-GIT_BASE=${GIT_BASE:-git://git.openstack.org}
+#GIT_BASE=${GIT_BASE:-git://git.openstack.org}
+GIT_BASE=${GIT_BASE:-https://git.openstack.org}
 
 # Which libraries should we install from git instead of using released
 # versions on pypi?

  也可以更换为 https://github.com/openstack   


好啦 配置完以后 你的devstack 会不会快许多呢?


转载于:https://my.oschina.net/firxiao/blog/481595

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值