使用 devstack 腳本很簡單,安裝 git,然後下載 devstack 代碼到本地,運行 stack.sh 腳本依次設定 MySQL, RabbitMQ, OpenStack Dashboard 和Keystone 的密碼,密碼輸入後 stack.sh 腳本會自動開始安裝必要的軟件包和庫並下載最新的 OpenStack 及其組件代碼,整個過程自動完成無需干預
$ sudo apt-get update
$ sudo apt-get install git
$ git clonegit://github.com/openstack-dev/devstack.git
$ cd devstack/
創建localrc文件,內容如下:
FLOATING_RANGE=192.168.100.224/27
FIXED_RANGE=10.10.10.0/24
FIXED_NETWORK_SIZE=256
ADMIN_PASSWORD=root
MYSQL_PASSWORD=root
PULIC_INTERFACE=eth0
FLAT_INTERFACE=eth1
RABBIT_PASSWORD=root
SERVICE_TOKEN=root
SERVICE_PASSWORD=root
HOST_IP=192.168.0.4 #設置爲你虛擬機第1塊網卡的固定IP地址
NOVNCPROXY_URL="http://42.62.73.241:6080/vnc_auto.html" #42.62.73.241是你虛擬機的公網IP地址
執行安裝腳本
$ ./stack.sh
出現以下內容顯示創建完畢,可以登錄Horizon
Horizon is now available athttp://192.168.0.2/
Keystone is serving athttp://192.168.0.2:5000/v2.0/
Examples on using novaclient command lineis in exercise.sh
The default users are: admin and demo
The password: root
This is your host ip: 192.168.0.2
2014-11-24 07:44:17.564 | stack.shcompleted in 2181 seconds.
默認安裝目錄在/opt/stack下:
stack@ustack:~$ pwd
/opt/stack
stack@ustack:~$ ls
cinder data glance heat heat-cfntools heat-templates horizon keystone nova noVNC requirements status tempest
查看Openstack安裝版本:
root@ustack:/opt/stack/keystone# git branch
* master
root@ustack:/opt/stack/keystone# git remote-v
origin git://git.openstack.org/openstack/keystone.git(fetch)
origin git://git.openstack.org/openstack/keystone.git(push)
root@ustack:/opt/stack/keystone# git branch--all
* master
remotes/origin/HEAD -> origin/master
remotes/origin/feature/hierarchical-multitenancy
remotes/origin/feature/key-dist
remotes/origin/master
remotes/origin/stable/icehouse
remotes/origin/stable/juno