devstack安裝all in one openstack(pike)
環境說明:
這邊利用virtualbox開啟一台vm,網卡第一張設定Bridge Adapter模式,第二張設定Host-only Network模式
OS
|
16.04
|
kernel
|
4.4.0-87-generic
|
Host | Private IP (Management IP)/Interface(eth1) | Public IP/Interface(eth0) |
controller | 192.168.100.4 | 172.20.3.53 |
首先建立一個user為stack
$ adduser stack
$ echo 'stack ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/stack
$ chmod 0440 /etc/sudoers.d/stack
|
更新軟體清單以及套件
$ apt-get update && apt-get -y upgrade
|
安裝ntp並設定
$ apt-get install -y git ntp
# 編輯ntp.conf 加入以下server
$ vim /etc/ntp.conf
server time.stdtime.gov.tw
|
切換stack並clone devstack
$ su stack
$ cd
$ git clone https://github.com/openstack-dev/devstack.git
$ cd devstack
$ git checkout stable/pike |
(Optional) 如果想使用murano,必須另外下載source code,如果沒有要用murano可跳過這步
$ git clone https://github.com/openstack/murano.git -b stable/kilo
$ cd murano/contrib/devstack
# 複製murano source code
$ export DEVSTACK_DIR=~/devstack
$ cp lib/murano ${DEVSTACK_DIR}/lib
$ cp lib/murano-dashboard ${DEVSTACK_DIR}/lib
$ cp extras.d/70-murano.sh ${DEVSTACK_DIR}/extras.d
$ cd ${DEVSTACK_DIR}
|
編輯localrc
$ vim localrc
# 加入以下設定
HOST_IP=主機ip
HORIZON_BRANCH=stable/pike
KEYSTONE_BRANCH=stable/pike
NOVA_BRANCH=stable/pike
NEUTRON_BRANCH=stable/pike
GLANCE_BRANCH=stable/pike
CINDER_BRANCH=stable/pike
# 設定相關網路
PUBLIC_INTERFACE=eth0
FIXED_RANGE=192.168.1.0/24
NETWORK_GATEWAY=192.168.1.1
FLOATING_RANGE=172.24.1.0/24
PUBLIC_NETWORK_GATEWAY=172.24.1.1
FLAT_INTERFACE=eth1
# 設定相關服務的密碼
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_TOKEN=password
SERVICE_PASSWORD=password
ADMIN_PASSWORD=password
# 停用nova-network,啟用neutron
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-lbaas
enable_service q-vpn
# 啟用nova-consoleauth
enable_service n-cauth
enable_service cinder
enable_service c-api
enable_service c-vol
enable_service c-sch
enable_service c-bak
FORCE_CEPH_INSTALL=yes
enable_plugin devstack-plugin-ceph git://git.openstack.org/openstack/devstack-plugin-ceph
CEPH_RELEASE=${CEPH_RELEASE:-jewel}
CEPH_LOOPBACK_DISK_SIZE=10G
CEPH_FSID=$(uuidgen)
GLANCE_CEPH_USER=glance
GLANCE_CEPH_POOL=images
GLANCE_CEPH_POOL_PG=8
GLANCE_CEPH_POOL_PGP=8
NOVA_CEPH_POOL=vms
NOVA_CEPH_POOL_PG=8
NOVA_CEPH_POOL_PGP=8
CINDER_CEPH_POOL=volumes
CINDER_CEPH_POOL_PG=8
CINDER_CEPH_POOL_PGP=8
CINDER_CEPH_USER=cinder
CINDER_CEPH_UUID=$(uuidgen)
CINDER_BAK_CEPH_POOL=backup
CINDER_BAK_CEPH_POOL_PG=8
CINDER_BAKCEPH_POOL_PGP=8
CINDER_BAK_CEPH_USER=cinder-bak
CEPH_REPLICAS=${CEPH_REPLICAS:-1}
REMOTE_CEPH=False
REMOTE_CEPH_ADMIN_KEY_PATH=/etc/ceph/ceph.client.admin.keyring
CINDER_DRIVER=ceph
CINDER_ENABLED_BACKENDS=ceph
# 基本設定
VERBOSE=True
LOG_COLOR=True
GIT_BASE="http://github.com"
Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True
|
執行stack.sh,就可以根據你上面所輸入的host_ip登入到horizon,密碼為ADMIN_PASSWORD設定值
$ ./stack.sh
$ source openrc admin demo
|
==Troubleshooting==
issue1:
如果是run在virtualbox上,然後floating_range跟host_ip設在不同網段
請在host上輸入
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
issue2:
登入horizon出現no such table: django_session
請到/opt/stack/horizon底下輸入
$ python manage.py syncdb
|
留言
張貼留言