虚拟机能访问外网,并添加一条DNS:8.8.8.8或8.8.4.4
重新编辑源
vi /etc/apt/sources.list
更换内容为
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
更新源列表
sudo apt-get update
更新软件(比较源,更新更高版本的软件)
sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install python-pip
sudo pip install --upgrade pip
sudo pip install -U os-testr
sudo useradd -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo su – stack
sudo su
mkdir ~/.pip && vi ~/.pip/pip.conf
更换为以下内容:
[global]
index-url = https://pypi.douban.com/simple
download_cache = ~/.cache/pip
[install]
use-mirrors = true
mirrors = http://pypi.douban.com/
在stack用户下再次执行更换豆瓣源
此处同样更换为豆瓣源
执行下面命令更新pip软件,注意在root和stack下都要更换pip源
sudo pip install --upgrade pip
首先切换回stack用户下~目录,这里选择下载Rocky版本:
git clone https://github.com/openstack-dev/devstack -b stable/rocky
切换到stack用户的devstack/files目录下,执行如下命令:
wget -c https://github.com/coreos/etcd/releases/download/v3.1.10/etcd-v3.1.10-linux-amd64.tar.gz
wget -c https://github.com/coreos/etcd/releases/download/v3.1.7/etcd-v3.1.7-linux-amd64.tar.gz
这里的etcd文件会在最后执行stack.sh脚本时用到,用来安装etcd组件。不过etcd的安装包会可能由于网络问题无法成功,大家可以在网上找etcd的安装包,下载后拷贝至/files目录,同样可以成功。(本文底部提供了etcd-v3.2.17版本的资源,自取)
在stack用户的/devstack目录下配置local.conf(新建)
[[local|localrc]]
# Define images to be automatically downloaded during the DevStack built process.
DOWNLOAD_DEFAULT_IMAGES=False
IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"
# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/sice-html5.git
# Credentials
DATABASE_PASSWORD=admin
ADMIN_PASSWORD=admin
SERVICE_PASSWORD=admin
SERVICE_TOKEN=admin
RABBIT_PASSWORD=admin
#FLAT_INTERFACE=enp0s3
HOST_IP=192.168.xx.xx
enable_service placement-api
enable_service placement-client
disable_service etcd3
在/stack/devstack目录下执行./stack.sh安装脚本
./stack.sh
宿主机浏览器输入http://192.168.XX.XX/dashboard即可登陆openstack
1.执行./stack.sh报错:stack.sh failing giving error “g-api did not start”
清理安装再重新安装:
./unstack.sh && ./clean.sh
./stack.sh
2.执行./stack.sh下载cirrors镜像时连接超时
在网络上找到cirros-0.3.0-x86_64-disk.img镜像文件,下载后拷贝至/opt/stack/devstack/files/目录下(最后有资源)
3./opt/stack 目录权限问题
chmod 777 /opt/stack -R
4.用户权限不足,执行./stack.sh报错:
OSError:[Errno13]Permissiondenied:’/usr/local/lib/python2.7/dist-packages/
sudo chown -R stack:stack /usr/local/lib/python2.7
5.执行./stack.sh报错:
WARNING: The directory ‘/opt/stack/.cache/pip/http’ or its parent directory is not owned by the curr
sudo chown -R root /opt/stack/.cache/pip/
sudo chown -R root /opt/stack/.cache/pip/http/
6.执行./stack.sh报错:
env: ‘/opt/stack/requirements/.venv/bin/pip’: No such file or directory
在stack用户devstack目录下:
stack@hjc-virtual-machine:~/devstack$ virtualenv ../requirements/.venv/
或stack用户~目录下执行:virtualenv …/requirements/.venv/
7.执行./stack.sh报错:Cannot uninstall ‘psutil’. It is a distutils installed project
sudo pip install qdarkstyle --ignore-installed
安装过程:
https://blog.csdn.net/weixin_40275691/article/details/102887245?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/hunjiancuo5340/article/details/85005995
https://www.cnblogs.com/love9527/p/8298959.html
处理报错:
https://blog.csdn.net/ANXIN997483092/article/details/81365588
https://blog.csdn.net/qq_41241568/article/details/79615314
https://blog.csdn.net/zswang9/article/details/79684764
https://blog.csdn.net/qq_40907977/article/details/103452775
资源:
etcd文件:百度网盘 https://pan.baidu.com/s/12sFTeuUz6WzXs83hI9VaJw 提取码:4dk5,解压为文件夹后拷贝;
cirrors镜像:百度网盘 https://pan.baidu.com/s/1BPoiWR9MgQ2rIUQ4ZwQsVg 提取码:p6a7,直接拷贝。