一、devstack介紹
devstack目前是支援ubuntu16.04和centos 7,而且devstack官方建議使用ubuntu16.04,是以我們使用ubuntu 16.04進行安裝。
預設無論是devstack和openstack,都是采用master的代碼進行安裝,這樣經常會出現,今天安裝成功,明天失敗,代碼時刻在變化。是以我們不僅僅要指定openstack的版本,還需要指定devstack的版本,才能提供安裝成功的機率。
二、devstack的安裝
1、環境準備
我使用的作業系統為ubuntu 16.04的版本,預設的軟體包源是國外的,速度相對來說比較慢,是以我們修改檔案/etc/apt/sources.list,使用如下指令更改:
更新一下源。
2、下載下傳devstack
安裝devstack痛苦的其中一個原因,是openstack代碼,都需要從github下載下傳,這樣由于網絡的原因,經常導緻各種錯誤,簡直讓人崩潰,各種錯誤,目前國内已經提供了完整的openstack的github的mirror:http://git.trystack.cn,這樣devstack成功機率會大大提高。
另外devstack還會下載下傳image,下載下傳的過程也是非常緩慢。trystack也提供大家常用的image下載下傳:http://images.trystack.cn。
目前官方github上面保留着三個穩定的版本,我們這邊安裝ocata版。
3、建立stack使用者
目前devstack腳本已經不支援直接使用root身份運作,你需要建立stack使用者運作。
修改devstack目錄權限,讓stack使用者可以運作。
4、配置pip源
openstack很多元件需要從pip源下載下傳,預設是國外的源,我們需要設定為國内的源,以便可以快速的進行配置,在root和stack的加目錄下面都配置一下。
首先分别在家目錄下面都建立.pip的目錄,然後在目錄下面建立檔案pip.conf,内容如下:
5、配置檔案
對檔案local.conf進行簡單修改,如下内容:
6、安裝
中途可能會出現多次錯誤,大部分都是因為網絡的原因,重複運作指令即可。
三、驗證
經過長時間的等待之後,根據網絡狀态,大約1個小時的時間,出現下面的界面即可是安裝完成。
然後我們進行登入檢視。
可以看到登入成功,服務都運作正常。
附錄:
1、all-in-one single machine
set floating_range to a range not used on the local network, i.e. 192.168.1.224/27. this configures ip addresses ending in 225-254 to be used as floating ips.
set fixed_range and fixed_network_size to configure the internal address space used by the instances.
set flat_interface to the ethernet interface that connects the host to your local network. this is the interface that should be configured with the static ip address mentioned above.
set the administrative password. this password is used for the admin and demo accounts set up as openstack users.
set the mysql administrative password. the default here is a random hex string which is inconvenient if you need to look at the database directly for anything.
set the rabbitmq password.
set the service password. this is used by the openstack services (nova, glance, etc) to authenticate with keystone.
2、multi-node lab
configure cluster controller
configure compute nodes
另外一個模闆
devstack-controller
devstack-compute