您的位置:首页 > 运维架构

devstack安装openstack pike

2018-05-24 13:54 441 查看

1.环境说明

物理机操作系统:ubuntu-16.04.4-server-amd64
controller:192.168.18.61 ubuntu61
compute:192.168.18.62 ubuntu62
compute:192.168.18.63 ubuntu63

2.修改apt源

vi /etc/apt/source.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

apt-get update

3.安装 python-pip

apt-get install python-pip
检验是否安装成功:pip -V

4.下载devstack

cd /home
git clone https://git.openstack.org/openstack-dev/devstack -b stable/pike
国内源
git clone https://git.openstack.org/openstack-dev/devstack -b stable/pike

5.创建stack用户

cd /home/devstack/tools/
./create-stack-user.sh
cd /home/
mv devstack /opt/stack
chown -R stack:stack /opt/stack/devstack
chmod 777 /dev/pts/0


6.设置pip的镜像源

分别为root和stack用户设置使用国内的pip源

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/

su - stack
$ 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/


7.编辑controller节点的local.conf

cd /opt/stack/devstack
vi local.conf
[[local|localrc]]
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

#初次安装设置true,重复安装设置为False
#RECLONE=False
RECLONE=True

MULTI_HOST=true

HOST_IP=192.168.18.61
LOGFILE=/opt/stack/logs/stack.sh.log

ADMIN_PASSWORD=123456
MYSQL_PASSWORD=123456
RABBIT_PASSWORD=123456
SERVICE_PASSWORD=123456
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz

disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-metering
enable_service neutron

Q_USE_SECGROUP=True
FLOATING_RANGE="192.168.18.0/24"
FIXED_RANGE="10.0.0.0/24"
Q_FLOATING_ALLOCATION_POOL=start=192.168.18.220,end=192.168.18.230
PUBLIC_NETWORK_GATEWAY="192.168.18.3"
Q_L3_ENABLED=True
PUBLIC_INTERFACE=enp7s0f0
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex

Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True

LOG_COLOR=True
LOGDIR=/opt/stack/logs
SCREEN_LOGDIR=$LOGDIR/screen

chown -R stack:stack /opt/stack/devstack/local.conf


8.切换到stack用户,执行安装脚本

su - stack
cd devstack/
./stack.sh

中间如果出错
./unstack.sh 后重新安装
还是出错,
./clean.sh 后重新安装

安装完成输出
=========================
DevStack Component Timing
=========================
Total runtime 3375

run_process       15
test_with_retry    6
apt-get-update    11
pip_install      756
osc              237
wait_for_service  25
git_timed        546
dbsync           239
apt-get          361
=========================

This is your host IP address: 192.168.18.61
This is your host IPv6 address: ::1
Horizon is now available at http://192.168.18.61/dashboard Keystone is serving at http://192.168.18.61/identity/ The default users are: admin and demo
The password: 123456


9.安装compute节点

同controller节点操作一致:

更新apt源
安装 python-pip
下载devstack
创建stack用户
设置pip的镜像源

编辑local.conf

cd /opt/stack/devstack
vi local.conf
[[local|localrc]]

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

RECLONE=False

MULTI_HOST=true
HOST_IP=192.168.18.62
LOGFILE=/opt/stack/logs/stack.sh.log

ADMIN_PASSWORD=123456
MYSQL_PASSWORD=123456
RABBIT_PASSWORD=123456
SERVICE_PASSWORD=123456
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz

SERVICE_HOST=192.168.18.61
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
Q_HOST=$SERVICE_HOST
KEYSTONE_AUTH_HOST=$SERVICE_HOST
KEYSTONE_SERVICE_HOST=$SERVICE_HOST

ENABLED_SERVICES=n-cpu,q-agt,neutron
Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True
NEUTRON_CREATE_INITIAL_NETWORKS=False
enable_service placement-api

NOVA_VNC_ENABLED=True
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html"
VNCSERVER_LISTEN=$HOST_IP
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN

LOG_COLOR=True

disable_service tempest

切换到stack用户,执行安装脚本
su - stack cd devstack/ ./stack.sh安装完成输出

=========================
DevStack Component Timing
=========================
Total runtime    275

run_process        4
apt-get-update     8
pip_install      109
osc               14
wait_for_service  16
apt-get           28
=========================

This is your host IP address: 192.168.18.62
This is your host IPv6 address: ::1

WARNING:
Using lib/neutron-legacy is deprecated, and it will be removed in the future

Services are running under systemd unit files.
For more information see: https://docs.openstack.org/devstack/latest/systemd.html 
DevStack Version: pike
Change: 73d848772186bf674e12f6253263aed9e164413a Merge "Bump the Cinder LVM backing file size to 24Gb." into stable/pike 2018-04-21 05:10:38 +0000
OS Version: Ubuntu 16.04 xenial

最后,要让计算节点注册在控制节点上运行
root@ubuntu61:/opt/stack/devstack/tools# ./discover_hosts.sh
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  OpenStack devstack