devstack单节点安装-Rocky版本(all in one)
【摘要】 实验环境VMware Workstation 15.2ubuntu18.046G内存40G硬盘容量前期准备虚拟机能访问外网,并添加一条DNS:8.8.8.8或8.8.4.4更换源重新编辑源vi /etc/apt/sources.list更换内容为deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe mult...
实验环境
- VMware Workstation 15.2
- ubuntu18.04
- 6G内存
- 40G硬盘容量
虚拟机能访问外网,并添加一条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用户下再次执行更换豆瓣源
- sudo su - stack 切换为stack用户
- mkdir ~/.pip && vi ~/.pip/pip.conf
此处同样更换为豆瓣源
执行下面命令更新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(新建)
- vi 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
在这里可以看到web登陆地址,账号和密码。
宿主机浏览器输入http://192.168.XX.XX/dashboard即可登陆openstack
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)