ubuntu14.04 案頭版/伺服器版安裝DevStack教程,ubuntu16.04devstack

來源:互聯網
上載者:User

ubuntu14.04 案頭版/伺服器版安裝DevStack教程,ubuntu16.04devstack

官網安裝教程連結:https://docs.openstack.org/developer/devstack/ 

我在ubuntu14.04 LTS 案頭版/伺服器版都安裝DevStack成功後,在這裡記錄下安裝過程。

介紹下安裝環境:

  VMware Workstation Pro 12

  ubuntu14.04 LTS 系統

安裝前準備:

  1、系統更換ubuntu源 http://blog.csdn.net/u010053463/article/details/49300625,從連結中選擇一個資料來源,我選擇的源如下:

deb http://mirrors.yun-idc.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.yun-idc.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.yun-idc.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.yun-idc.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.yun-idc.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ubuntu/ trusty-backports main restricted universe multiverse

 

  2、ubuntu手動設定一個IP,便於在ubuntu系統重啟後,DevStack能夠使用。

  3、ubuntu配置一張能夠訪問外網的網卡即可。

  4、由於安裝環境時會涉及到pip工具,需要把pip源的地址映射到國內:

[global]timeout = 6000index-url = http://pypi.douban.com/simple/[install]trusted-host = pypi.douban.com

安裝步驟

配置pip源

root@ubuntu:/# mkdir /root/.piproot@ubuntu:/# vi /root/.pip/pip.conf[global]timeout = 6000index-url = http://pypi.douban.com/simple/[install]trusted-host = pypi.douban.com

下載DevStack

安裝git工具並下載DevStack

root@ubuntu:/# sudo apt-get install gitroot@ubuntu:/# cd /homeroot@ubuntu:/# git clone http://git.trystack.cn/openstack-dev/devstack.git -b stable/mitaka

建立stack使用者

在非root使用者下建立stack

Devstack@ubuntu:~$ cd /home/devstack/tools/Devstack@ubuntu:~$ sudo ./create-stack-user.sh

為stack使用者授權

在root使用者下

root@ubuntu:/# vi /etc/sudoers#找到如下一行:root ALL=(ALL:ALL) ALL#添加stack授權:stack ALL=(ALL:ALL) ALLroot@ubuntu:/# chown -R stack:stack /home/devstackroot@ubuntu:/# chown -R stack:stack /opt/stack

建立local.conf檔案

進入/home/devstack目錄下,建立並編輯local.conf檔案

root@ubuntu:/# cd /home/devstackroot@ubuntu:/home/devstack# vi local.conf

在local.conf檔案中添加如下內容(配置IP根據自身環境修改):

[[local|localrc]]  # 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    # CredentialsDATABASE_PASSWORD=pass  DATABASE_PASSWORD=pass  ADMIN_PASSWORD=pass  SERVICE_PASSWORD=pass  SERVICE_TOKEN=pass  RABBIT_PASSWORD=pass    HOST_IP=192.168.28.138  SERVICE_HOST=192.168.28.138  MYSQL_HOST=192.168.28.138 RABBIT_HOST=192.168.28.138  GLANCE_HOSTPORT=192.168.28.138:9292    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    # only support IP v4   SERVICE_IP_VERSION=4  ## Neutron optionsQ_USE_SECGROUP=True  FLOATING_RANGE="192.168.28.0/24"  FIXED_RANGE="10.0.1.0/24"  NETWORK_GATEWAY="10.0.1.254"  Q_FLOATING_ALLOCATION_POOL=start=192.168.28.230,end=192.168.28.250  PUBLIC_NETWORK_GATEWAY="192.168.28.2"  Q_L3_ENABLED=True  PUBLIC_INTERFACE=eth0  Q_USE_PROVIDERNET_FOR_PUBLIC=True  OVS_PHYSICAL_BRIDGE=br-ex  PUBLIC_BRIDGE=br-ex  OVS_BRIDGE_MAPPINGS=public:br-ex    # VLAN configuration.Q_PLUGIN=ml2  ENABLE_TENANT_VLANS=True

以stack使用者運行指令碼安裝DevStack:

root@ubuntu:/home/devstack# su stackroot@ubuntu:/home/devstack# ./stack.sh

經過如上配置,即可完成安裝。

安裝過程中會有相關報錯。

錯誤:

解決方案如下:

運行指令:

pythonimport openstackimport pbr.versionprint(pbr.version.VersionInfo('openstacksdk').version_string())quit()./unstack.sh./clean.sh./stack.sh

在/usr/local/lib/python2.7/dist-packages/openstack/session.py 第29行中修改“openstacksdk/%s” 為 “openstacksdk/0.8.1”後,重新安裝。

 

 

 

    

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.