主机环境:ubuntu 18.04
devstack版本:pike
安装devstack过程中出现了多个问题,经过几天的摸索,终于安装成功,详细的步骤如下:
1、设置网卡并重启主机
cd /etc/network
vi interfaces
auto enp0s3
iface enp0s3 inet static
address 192.168.104.10
network 255.255.255.0
gateway 192.168.104.1
2、创建用户,设置sudoer
sudo useradd -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
3、安装git
apt install git -y
4、下载devstack
sudo su - stack
git clone https://git.openstack.org/openstack-dev/devstack -b stable/pike
5、修改配置文件
在 /opt/stack/devstack 目录下,创建 local.conf。
devstack-controller
[[local|localrc]]
MULTI_HOST=true
HOST_IP=192.168.104.10 # management & api network
LOGFILE=/opt/stack/logs/stack.sh.log
# Credentials
ADMIN_PASSWORD=admin
MYSQL_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz
# enable neutron-ml2-vlan
disable_service n-net
enable_service q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron,q-lbaas,q-fwaas,q-vpn
Q_AGENT=linuxbridge
ENABLE_TENANT_VLANS=True
TENANT_VLAN_RANGE=3001:4000
PHYSICAL_NETWORK=default
LOG_COLOR=False
LOGDIR=$DEST/logs
SCREEN_LOGDIR=$LOGDIR/screen
# 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/spice-html5.git
enable_service placement-api
enable_service placement-client
6、修改启动脚本
在stack.sh 226行添加
cd /opt/stack/devstack
vi stack.sh
FORCE=YES
7、先下载以下两个文件(如脚本下载速度快可无需提前下载)
cd 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
8、设置.cache权限,如无该目录可先创建
cd /opt/stack
chmod 755 .cache
9、启动脚本
./stack.sh
参考文章:
https://www.cnblogs.com/CloudMan6/p/5357273.html#!comments
感谢以上文章中 JIMI24网友评论的提醒。